Class

cesium

BaseLayerPicker

Related Doc: package cesium

Permalink

class BaseLayerPicker extends Object

BaseLayerPicker with its drop-panel open.

The BaseLayerPicker is a single button widget that displays a panel of available imagery and terrain providers. When imagery is selected, the corresponding imagery layer is created and inserted as the base layer of the imagery collection; removing the existing base. When terrain is selected, it replaces the current terrain provider. Each item in the available providers list contains a name, a representative icon, and a tooltip to display more information when hovered. The list is initially empty, and must be configured before use, as illustrated in the below example.

alias BaseLayerPicker.

- {Element|String} container The parent HTML container node or ID for this widget. - The options object takes the following properties - {Globe} options.globe The Globe to use. - {ProviderViewModel[]} [options.imageryProviderViewModels=[]] The array of ProviderViewModel instances to use for imagery. - {ProviderViewModel} [options.selectedImageryProviderViewModel] The view model for the current base imagery layer, if not supplied the first available imagery layer is used. - {ProviderViewModel[]} [options.terrainProviderViewModels=[]] The array of ProviderViewModel instances to use for terrain. - {ProviderViewModel} [options.selectedTerrainProviderViewModel] The view model for the current base terrain layer, if not supplied the first available terrain layer is used.

exception {DeveloperError} Element with id "container" does not exist in the document.

Annotations
@RawJSType() @native() @JSName( "Cesium.BaseLayerPicker" )
Example:
  1. // In HTML head, include a link to the BaseLayerPicker.css stylesheet, // and in the body, include: //Create the list of available providers we would like the user to select from. //This example uses 3, OpenStreetMap, The Black Marble, and a single, non-streaming world image. var imageryViewModels = []; imageryViewModels.push(new Cesium.ProviderViewModel({ name : 'Open­Street­Map', 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 II', 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') }); } })); //Create a CesiumWidget without imagery, if you haven't already done so. var cesiumWidget = new Cesium.CesiumWidget('cesiumContainer', { imageryProvider: false }); //Finally, create the baseLayerPicker widget using our view models. var layers = cesiumWidget.imageryLayers; var baseLayerPicker = new Cesium.BaseLayerPicker('baseLayerPickerContainer', { globe : cesiumWidget.scene.globe, imageryProviderViewModels : imageryViewModels });

See also

ImageryLayerCollection

ImageryProvider

TerrainProvider

Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BaseLayerPicker
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BaseLayerPicker(container: |[Element, String], options: BaseLayerPickerOptions)

    Permalink
  2. new BaseLayerPicker()

    Permalink
    Attributes
    protected

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. var container: Element

    Permalink
  7. def destroy(): Dynamic

    Permalink
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. def isDestroyed(): Boolean

    Permalink
  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  22. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  23. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  24. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  25. var viewModel: BaseLayerPickerViewModel

    Permalink
  26. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped