Viewer Configuration
ViewerConfiguration Service for setting the initial Cesium viewer options.
  • The service must be provided by component that defined <ac-map/> or any components higher in the hierarchy.
  • use viewerOptions and viewerModifier() to initialise the Cesium Viewer.
demo-map.component.html
demo-map.component.ts
1
@Component({
2
selector: 'demo-map',
3
templateUrl: './demo-map.component.html',
4
providers: [ViewerConfiguration], // Don't forget to Provide it
5
})
6
export class DemoMapComponent {
7
constructor(private viewerConf: ViewerConfiguration) {
8
9
// viewerOptions will be passed the Cesium.Viewer contstuctor
10
viewerConf.viewerOptions = {
11
selectionIndicator: false,
12
timeline: false,
13
infoBox: false,
14
fullscreenButton: false,
15
baseLayerPicker: false,
16
animation: false,
17
shouldAnimate: false,
18
homeButton: false,
19
geocoder: false,
20
navigationHelpButton: false,
21
navigationInstructionsInitiallyVisible: false,
22
mapMode2D: Cesium.MapMode2D.ROTATE,
23
};
24
25
// Will be called on viewer initialistion
26
viewerConf.viewerModifier = (viewer: any) => {
27
// Remove default double click zoom behaviour
28
viewer.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
29
};
30
}
31
}
32
Copied!
1
<ac-map id="main-map"></ac-map>
Copied!
Last modified 2yr ago
Copy link