Class BingMapsLayer

  • All Implemented Interfaces:
    RemoteResource, LayerContent, Loadable

    public final class BingMapsLayer
    extends ServiceImageTiledLayer
    Defines a tiled layer that uses Microsoft Bing Maps.

    A BingMapsLayer can be created from a Portal or using a Bing Maps key.

    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.

    Since:
    100.1.0
    See Also:
    Layer
    • Method Detail

      • getCulture

        public String getCulture()
        Gets the culture that was set, or "en-US" if not set or was set to an invalid value.
        Returns:
        the culture that was set, or "en-US" if not set or was set to an invalid value
        Since:
        100.1.0
      • setCulture

        public void setCulture​(String culture)
        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 empty
        ArcGISRuntimeException - if set after the layer has loaded
        Since:
        100.1.0
      • getPortal

        public Portal getPortal()
        Gets the portal used to create this layer or null if none was used.
        Returns:
        the portal used to create this layer or null if none was used
        Since:
        100.1.0
      • getStyle

        public BingMapsLayer.Style getStyle()
        Gets the style used to create this layer.
        Returns:
        the style used to created this layer
        Since:
        100.1.0
      • getKey

        public String getKey()
        Gets the key that was set.
        Returns:
        the key that was set
        Since:
        100.1.0
      • setKey

        public void setKey​(String key)
        Sets the key.
        Parameters:
        key - the key to set
        Throws:
        IllegalArgumentException - if key is null or empty
        Since:
        100.1.0
      • copy

        public BingMapsLayer 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