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.
@Component({selector: 'demo-map',templateUrl: './demo-map.component.html',providers: [ViewerConfiguration], // Don't forget to Provide it})export class DemoMapComponent {constructor(private viewerConf: ViewerConfiguration) {// viewerOptions will be passed the Cesium.Viewer contstuctorviewerConf.viewerOptions = {selectionIndicator: false,timeline: false,infoBox: false,fullscreenButton: false,baseLayerPicker: false,animation: false,shouldAnimate: false,homeButton: false,geocoder: false,navigationHelpButton: false,navigationInstructionsInitiallyVisible: false,mapMode2D: Cesium.MapMode2D.ROTATE,};// Will be called on viewer initialistionviewerConf.viewerModifier = (viewer: any) => {// Remove default double click zoom behaviourviewer.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);};}}
<ac-map id="main-map"></ac-map>