question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FEATURE: widgets, map types?

See original GitHub issue

I couldn’t figure out from the docs how to add the map types and bing maps widgets for the different terrain types to the cesium tool bar. Could you clarify?

ex:

screenshot from 2017-11-07 15-24-33

my current failing attempt:

ngOnInit() {
        const imageryViewModels = [];
        imageryViewModels.push(new Cesium.ProviderViewModel({
             name : 'Open\u00adStreet\u00adMap',
             iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/openStreetMap.png'),
             tooltip : 'OpenStreetMap (OSM) is a collaborative project to create a free editable \
        map of the world.\nhttp://www.openstreetmap.org',
             creationFunction : function() {
                 return Cesium.createOpenStreetMapImageryProvider({
                     url : 'https://a.tile.openstreetmap.org/'
                 });
             }
         }));

        imageryViewModels.push(new Cesium.ProviderViewModel({
             name : 'Black Marble',
             iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/blackMarble.png'),
             tooltip : 'The lights of cities and villages trace the outlines of civilization \
        in this global view of the Earth at night as seen by NASA/NOAA\'s Suomi NPP satellite.',
             creationFunction : function() {
                 return Cesium.createTileMapServiceImageryProvider({
                     url : 'https://cesiumjs.org/blackmarble',
                     credit : 'Black Marble imagery courtesy NASA Earth Observatory',
                     flipXY : true
                 });
             }
         }));

        imageryViewModels.push(new Cesium.ProviderViewModel({
             name : 'Natural Earth\u00a0II',
             iconUrl : Cesium.buildModuleUrl('Widgets/Images/ImageryProviders/naturalEarthII.png'),
             tooltip : 'Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/',
             creationFunction : function() {
                 return Cesium.createTileMapServiceImageryProvider({
                     url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII')
                 });
             }
         }));

        const widget = new Cesium.CesiumWidget('cesiumContainer', { imageryProvider: false });
        const baseLayers = new Cesium.BaseLayerPicker('baseLayerPickerContainer', {
            globe: widget.scene.globe,
            imageryProviderViewModels: imageryViewModels
        });
    }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
eitanfrcommented, Nov 8, 2017

hi, you need to do 2 things:

  1. init the cesium viewer with baseLayerPicker=false
  2. create your own baseLayerPicker and add it to your cesium map viewer
// use ViewerConfigurationService to give initial options to the cesium map viewer . 
// check out demo-map.compoennt.ts for usage example 
export class DemoMapComponent {
	constructor(private viewerConf: ViewerConfiguration) {
		viewerConf.viewerOptions = {
			baseLayerPicker : false,
			// and any options you want accourding cesium viewer doc. 
		};
    }
}
//Finally, create the baseLayerPicker widget using view models like you did
const imageryViewModels = // create like you did

// add the wiget to your glboe 
const globe =  this.mapsManagerService.getMap().getCesiumViewer().scene.globe.
const baseLayerPicker = new Cesium.BaseLayerPicker('baseLayerPickerContainer', {
    globe : globe,
    imageryProviderViewModels : imageryViewModels
});
0reactions
eitanfrcommented, May 6, 2020

Great! closing

Read more comments on GitHub >

github_iconTop Results From Across the Web

Map widget—ArcGIS Experience Builder | Documentation
The Map widget allows you to display 2D and 3D geographic information. You can enable tools in the map, such as Zoom, Locate,...
Read more >
Interactive Google Maps Widget — Features (30+ custom ...
Featuring Silver, Retro, Night and Custom styles, it allows to adapt your map to the general concept of your website and achieve visual...
Read more >
FEATURE: widgets, map types? · Issue #159 - GitHub
I couldn't figure out from the docs how to add the map types and bing maps widgets for the different terrain types to...
Read more >
Map Widget - Temenos Quantum Documentation
A Map widget provides you the capability to display pre-defined locations (latitude and longitude) on an onscreen map. Platforms like iPhone (above 3.0),...
Read more >
Widgets - Earth Engine - Google Developers
Note that checking the box turns on a layer displayed on the map. As with other UI components, the Map of the Code...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found