UNPKG

sj-ng-webgl-globe

Version:

The fastest way to embed a 3D reactive globe in your Angular application using WebGL Earth. It is an open-source virtual globe made with HTML5 and Canvas WebGL technology. It comes with a JavaScript API adapting the popular LeafletJS API. On top of this A

212 lines (205 loc) 7.57 kB
import { Injectable, ɵɵdefineInjectable, Component, ViewEncapsulation, ViewChild, Input, NgModule } from '@angular/core'; /** * @fileoverview added by tsickle * Generated from: lib/sj-ng-webgl-globe.service.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class SjNgWebglGlobeService { constructor() { } } SjNgWebglGlobeService.decorators = [ { type: Injectable, args: [{ providedIn: 'root' },] } ]; /** @nocollapse */ SjNgWebglGlobeService.ctorParameters = () => []; /** @nocollapse */ SjNgWebglGlobeService.ngInjectableDef = ɵɵdefineInjectable({ factory: function SjNgWebglGlobeService_Factory() { return new SjNgWebglGlobeService(); }, token: SjNgWebglGlobeService, providedIn: "root" }); /** * @fileoverview added by tsickle * Generated from: lib/sj-ng-webgl-globe.component.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @record */ function Options() { } if (false) { /** @type {?|undefined} */ Options.prototype.center; /** @type {?|undefined} */ Options.prototype.zoom; /** @type {?|undefined} */ Options.prototype.altitude; /** @type {?|undefined} */ Options.prototype.atmosphere; /** @type {?|undefined} */ Options.prototype.sky; /** @type {?|undefined} */ Options.prototype.minAltitude; /** @type {?|undefined} */ Options.prototype.maxAltitude; /** @type {?|undefined} */ Options.prototype.dragging; /** @type {?|undefined} */ Options.prototype.tilting; /** @type {?|undefined} */ Options.prototype.zooming; /** @type {?|undefined} */ Options.prototype.scrollWheelZoom; /** @type {?|undefined} */ Options.prototype.unconstrainedRotation; /** @type {?|undefined} */ Options.prototype.proxyHost; } class SjNgWebglGlobeComponent { // Marker data constructor() { this.options = { center: [null, null], zoom: null, altitude: 7000000, atmosphere: false, sky: false, minAltitude: 20, dragging: true, tilting: true, zooming: true, scrollWheelZoom: true, unconstrainedRotation: false, proxyHost: '' }; } /** * @return {?} */ ngOnInit() { this.options = { center: this.center, zoom: this.zoom, altitude: this.altitude, atmosphere: this.atmosphere, sky: this.sky, minAltitude: this.minAltitude, maxAltitude: this.maxAltitude, dragging: this.dragging, tilting: this.tilting, zooming: this.zooming, scrollWheelZoom: this.scrollWheelZoom, unconstrainedRotation: this.unconstrainedRotation, proxyHost: this.proxyHost }; this.globe = new WE.map(this.sjGlobe.nativeElement, this.options); WE.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors' }).addTo(this.globe); console.log(this.markers); if (this.markers !== undefined && this.markers.length > 0) { this.markers.forEach((/** * @param {?} m * @param {?} i * @return {?} */ (m, i) => { /** @type {?} */ const marker = WE.marker([m.latitude, m.longitude]).addTo(this.globe); if (m.isPopupEnable) { marker.bindPopup(m.popupHTML, { maxWidth: 200, closeButton: false }); } })); } } } SjNgWebglGlobeComponent.decorators = [ { type: Component, args: [{ selector: 'sj-ng-webgl-globe', template: "<div #sjGlobe></div>", encapsulation: ViewEncapsulation.None, styles: [` .cesium-credit-textContainer{ display: none; } `] }] } ]; /** @nocollapse */ SjNgWebglGlobeComponent.ctorParameters = () => []; SjNgWebglGlobeComponent.propDecorators = { sjGlobe: [{ type: ViewChild, args: ['sjGlobe', { static: true },] }], center: [{ type: Input, args: ['center',] }], zoom: [{ type: Input, args: ['zoom',] }], altitude: [{ type: Input, args: ['altitude',] }], atmosphere: [{ type: Input, args: ['atmosphere',] }], sky: [{ type: Input, args: ['sky',] }], minAltitude: [{ type: Input, args: ['minAltitude',] }], maxAltitude: [{ type: Input, args: ['maxAltitude',] }], dragging: [{ type: Input, args: ['dragging',] }], tilting: [{ type: Input, args: ['tilting',] }], zooming: [{ type: Input, args: ['zooming',] }], scrollWheelZoom: [{ type: Input, args: ['scrollWheelZoom',] }], unconstrainedRotation: [{ type: Input, args: ['unconstrainedRotation',] }], proxyHost: [{ type: Input, args: ['proxyHost',] }], markers: [{ type: Input, args: ['markers',] }] }; if (false) { /** @type {?} */ SjNgWebglGlobeComponent.prototype.globe; /** @type {?} */ SjNgWebglGlobeComponent.prototype.options; /** @type {?} */ SjNgWebglGlobeComponent.prototype.sjGlobe; /** @type {?} */ SjNgWebglGlobeComponent.prototype.center; /** @type {?} */ SjNgWebglGlobeComponent.prototype.zoom; /** @type {?} */ SjNgWebglGlobeComponent.prototype.altitude; /** @type {?} */ SjNgWebglGlobeComponent.prototype.atmosphere; /** @type {?} */ SjNgWebglGlobeComponent.prototype.sky; /** @type {?} */ SjNgWebglGlobeComponent.prototype.minAltitude; /** @type {?} */ SjNgWebglGlobeComponent.prototype.maxAltitude; /** @type {?} */ SjNgWebglGlobeComponent.prototype.dragging; /** @type {?} */ SjNgWebglGlobeComponent.prototype.tilting; /** @type {?} */ SjNgWebglGlobeComponent.prototype.zooming; /** @type {?} */ SjNgWebglGlobeComponent.prototype.scrollWheelZoom; /** @type {?} */ SjNgWebglGlobeComponent.prototype.unconstrainedRotation; /** @type {?} */ SjNgWebglGlobeComponent.prototype.proxyHost; /** @type {?} */ SjNgWebglGlobeComponent.prototype.markers; } /** * @fileoverview added by tsickle * Generated from: lib/sj-ng-webgl-globe.module.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class SJNgWebglGlobeModule { } SJNgWebglGlobeModule.decorators = [ { type: NgModule, args: [{ declarations: [SjNgWebglGlobeComponent], imports: [], exports: [SjNgWebglGlobeComponent] },] } ]; /** * @fileoverview added by tsickle * Generated from: public-api.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * Generated from: sj-ng-webgl-globe.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ export { SJNgWebglGlobeModule, SjNgWebglGlobeComponent, SjNgWebglGlobeService }; //# sourceMappingURL=sj-ng-webgl-globe.js.map