Hi,
I am trying to create an angular 2 application that will have a 2D map
using Cesium.
Can any one elaborate how to get Cesium map in my angular 2 app?
I tried adding it to my package.json file:
(function(global){
global.CESIUM_BASE_URL = './node_modules/cesium/Build/CesiumUnminified';
System.config({
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
map: {
...
// paths serve as alias
'cesium': 'npm:cesium/Build/CesiumUnminified'
...
},
packages: {
...
'cesium': {
main: './Cesium.js',
meta: {
'*.js': {
format: 'global'
}
}
},
...
}
});})(this);
my cesium.component.ts file:
let Cesium = require('Cesium');
import { Injectable } from '@angular/core';
@Injectable()
export class CesiumComponent {
public viewer: any = null;
constructor() {
this.viewer = new Cesium.Viewer('cesiumContainer');
}
}
my cesium.module.ts file:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { CesiumComponent } from './cesium.component';
@NgModule({
imports: [ BrowserModule ],
declarations: [ CesiumComponent ],
bootstrap: [ CesiumComponent ]
})
export class CesiumModule { }
any idea?
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.