- All Implemented Interfaces:
RemoteResource
,LayerContent
,Loadable
A Bing maps layer displays map content from a Bing Maps web service, providing access to static map tiles and imagery meta-data. Map style and culture can be customized prior to loading the layer.
Functional characteristics
Bing maps require an API key from Microsoft. There are two ways to set this key:
- By providing an ArcGIS portal configured with a Bing Maps key. For more information, see "How to install a Microsoft Bing Key".
- By providing a Bing Maps key directly for this layer. For more information, see "Getting a Bing Maps Key".
getKey()
and call Loadable.retryLoadAsync()
. To use the BingMapsLayer you must adhere to
Microsoft's Mobile Brand Guidelines.
Bing maps layers do not support identify, query, selection, or time.
Performance characteristics
Bing maps layers perform similarly to other tiled layers. Raster tiles are fetched from Bing's servers on demand.
Example for working with Bing Maps layer
BingMapsLayer bingMapsLayer = new BingMapsLayer(Style.AERIAL, <bing-maps-key>"); bingMapsLayer.addDoneLoadingListener(new Runnable() { public void run() { if (bingMapsLayer.getLoadStatus() == LoadStatus.LOADED) { // work with bingMapsLayer here } } }); map.getOperationalLayers().add(bingMapsLayer);The layer is loaded when displayed in a
MapView
or a SceneView
; if using the layer without a
MapView
or a SceneView
, call the Layer.loadAsync()
method. Use the layer done
loading event to determine when the layer is ready, and check the load status before using the layer; see
Layer.addDoneLoadingListener(Runnable)
and Layer.getLoadStatus()
.- Since:
- 100.1.0
- See Also:
-
Property Summary
Properties inherited from class com.esri.arcgisruntime.layers.Layer
loadError, loadStatus
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The list of Bing maps layer styles.Nested classes/interfaces inherited from class com.esri.arcgisruntime.layers.ImageTiledLayer
ImageTiledLayer.BufferSize, ImageTiledLayer.NoDataTileBehavior
-
Constructor Summary
ConstructorDescriptionBingMapsLayer
(BingMapsLayer.Style style, Portal portal) Creates a Bing maps layer with the given style and the Bing Maps API Key given by the specified portal.BingMapsLayer
(BingMapsLayer.Style style, String key) Creates a Bing maps layer with the given style and Bing Maps API Key. -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Creates a deep copy of this BingMapsLayer instance.The culture for this Bing maps layer.getKey()
Gets Bing Maps API key for this layer.Gets the portal from which this layer got its Bing Maps API key (if applicable).getStyle()
Gets the Bing Maps style used to display this layer.protected String
getTileUrl
(TileKey tileKey) ThrowsUnsupportedOperationException
.getUri()
ThrowsUnsupportedOperationException
.void
setCulture
(String culture) Sets the culture.void
Sets Bing Maps API key for this layer.Methods inherited from class com.esri.arcgisruntime.layers.ServiceImageTiledLayer
copyTo, getCredential, getRequestConfiguration, getTile, setCredential, setRequestConfiguration
Methods inherited from class com.esri.arcgisruntime.layers.ImageTiledLayer
getBufferSize, getNoDataTileBehavior, getTileInfo, setBufferSize, setNoDataTileBehavior
Methods inherited from class com.esri.arcgisruntime.layers.ImageAdjustmentLayer
getBrightness, getContrast, getGamma, setBrightness, setContrast, setGamma
Methods inherited from class com.esri.arcgisruntime.layers.Layer
addDoneLoadingListener, addLoadStatusChangedListener, addVisibilityChangedListener, cancelLoad, canChangeVisibility, canShowInLegend, fetchLegendInfosAsync, getAttribution, getDescription, getFullExtent, getId, getItem, getLoadError, getLoadStatus, getMaxScale, getMinScale, getName, getOpacity, getSpatialReference, getSubLayerContents, isIdentifyEnabled, isVisible, isVisibleAtScale, loadAsync, loadErrorProperty, loadStatusProperty, removeDoneLoadingListener, removeLoadStatusChangedListener, removeVisibilityChangedListener, retryLoadAsync, setCanShowInLegend, setDescription, setId, setMaxScale, setMinScale, setName, setOpacity, setVisible
-
Constructor Details
-
BingMapsLayer
Creates a Bing maps layer with the given style and the Bing Maps API Key given by the specified portal.- Parameters:
style
- the type of Bing maps layer such as aerial or roadportal
- a portal that provides a Bing Maps API key- Throws:
IllegalArgumentException
- if style is nullIllegalArgumentException
- if portal is null- Since:
- 100.1.0
-
BingMapsLayer
Creates a Bing maps layer with the given style and Bing Maps API Key.- Parameters:
style
- style of the Bing maps layerkey
- the Bing Maps API key- Throws:
IllegalArgumentException
- if style is nullIllegalArgumentException
- if key is null or empty- Since:
- 100.1.0
-
-
Method Details
-
getCulture
The culture for this Bing maps layer.Culture determines the language used for labels in this layer. English (en-US) is used by default. For a list of all available options, see Supported Culture Codes.
The value of
getCulture()
cannot be changed after the layer loads.Attempting to set the value to null will throw a NullPointerException exception.
- Returns:
- the culture that was set, or "en-US" if not set or was set to an invalid value
- Since:
- 100.1.0
-
setCulture
Sets the culture.This determines the language that is used to display text. If the culture is not set or is set to an invalid value, then "en-US" is used.
See Supported Culture Codes for a list of valid culture codes.
This should be called before loading the layer.
- Parameters:
culture
- the culture to set- Throws:
IllegalArgumentException
- if culture is null or emptyArcGISRuntimeException
- if set after the layer has loaded- Since:
- 100.1.0
-
getPortal
Gets the portal from which this layer got its Bing Maps API key (if applicable).- Returns:
- the Portal the layer will load its Bing Maps API key from, or null if none
- Since:
- 100.1.0
-
getStyle
Gets the Bing Maps style used to display this layer.The value of
getStyle()
cannot be changed after the layer loads.- Returns:
- the style used to create this layer
- Since:
- 100.1.0
-
getKey
Gets Bing Maps API key for this layer.The value of
getKey()
cannot be changed after the layer loads.- Returns:
- the key that was set
- Since:
- 100.1.0
-
setKey
Sets Bing Maps API key for this layer.The value of
getKey()
cannot be changed after the layer loads.- Parameters:
key
- the key to set- Throws:
IllegalArgumentException
- if key is null or empty- Since:
- 100.1.0
-
getUri
ThrowsUnsupportedOperationException
.- Returns:
- the URI of this RemoteResource
- Throws:
UnsupportedOperationException
- always throws this exception- Since:
- 100.1.0
-
getTileUrl
ThrowsUnsupportedOperationException
.- Specified by:
getTileUrl
in classServiceImageTiledLayer
- Parameters:
tileKey
- tile key for which the url is to be returned- Returns:
- the url to be used to request a tile, can't be null or empty
- Throws:
UnsupportedOperationException
- always throws this exception- Since:
- 100.1.0
-
copy
Creates a deep copy of this BingMapsLayer instance.- Returns:
- a deep copy of this BingMapsLayer instance, which means that copies of all fields of this layer are made including its loading state
- Since:
- 100.1.0
-