public class

BingMapsLayer

extends TiledServiceLayer
java.lang.Object
   ↳ com.esri.android.map.Layer
     ↳ com.esri.android.map.TiledLayer
       ↳ com.esri.android.map.TiledServiceLayer
         ↳ com.esri.android.map.bing.BingMapsLayer

Class Overview

BingMapsLayer class is used to define the Layer populated from Bing Maps that can be added to the MapView object.

BingMapsLayer allows you to work with maps from Bing Maps. Bing Maps requires a key in order to allow access to the tiles. Information on how to obtain a key can be found on this page: Getting a Bing Maps Key

The following are examples of how you can work with the BingMapsLayer class. The code will add a map with a Bing Maps Layer of Aerial style.

Java usage:
 MapView mv = new MapView(this);
 mv.addLayer(new BingMapsLayer(
 "[your Bing Maps key]", MapStyle.Aerial));
 setContentView(mv);
 

To initialize a Bing map in a WebMap please see the class description of the MapView.

Summary

Nested Classes
enum BingMapsLayer.MapStyle

Map styles available for the imagery:

  • Aerial - Aerial imagery
  • AerialWithLabels - Aerial imagery with a road overlay
  • Road - Roads without additional imagery. 
  • Constants
    double BING_MAPS_XMAX Maximum X coordinate in meters for the full extent of Bing Maps service.
    double BING_MAPS_XMIN Minimum X coordinate in meters for the full extent of Bing Maps service.
    double BING_MAPS_YMAX Maximum Y coordinate in meters for the full extent of Bing Maps service.
    double BING_MAPS_YMIN Minimum Y coordinate in meters for the full extent of Bing Maps service.
    [Expand]
    Inherited Constants
    From class com.esri.android.map.TiledServiceLayer
    [Expand]
    Inherited Fields
    From class com.esri.android.map.TiledServiceLayer
    From class com.esri.android.map.Layer
    Public Constructors
    BingMapsLayer(String appId, BingMapsLayer.MapStyle mapStyle)

    Creates a BingMapsLayer object from Bing Maps key and map style.

    BingMapsLayer(String appId, BingMapsLayer.MapStyle mapStyle, boolean initLayer)
    Creates a BingMapsLayer object from Bing Maps key and map style.
    Public Methods
    String getAppId()
    Returns the Bing Maps key.
    Bitmap getBingLogo(int width, int height)
    Returns the Bing Logo bitmap.
    String getCulture()
    Returns the culture of the layer (format: [language]-[REGION], e.g.: en-US)
    see Culture Parameter
    URL getLogoUrl()
    Returns a URL object for Bing Maps logo.
    BingMapsLayer.MapStyle getMapStyle()
    Returns the style of the Bing Maps layer.
    String getMapVersion()
    Returns the map version (format: v[map version], e.g.: v0).
    void refresh()
    Fetches the information for the tiles again if any of the parameters have changed (map version, map style, culture...) and refreshes the tiles accordingly.
    void reinitializeLayer(UserCredentials usercredentials)
    This method has no impact on the BingMapsLayer.
    void reinitializeLayer(String appID)
    Re-initializes the layer with the given appID.
    void setAppId(String appId)
    Sets the Bing Maps key.
    void setCulture(String culture)
    Sets the culture of the layer (format: [language]-[REGION], e.g.: en-US)
    see Culture Parameter
    void setMapStyle(BingMapsLayer.MapStyle mapStyle)
    Sets the map style of the Bing Maps layer.
    void setMapVersion(String mapVersion)
    Sets the map version (format: v[map version], e.g.: v0).
    Protected Methods
    byte[] getTile(int lev, int col, int row)
    get byte array of the tile at the specified level, column and row.
    void initLayer()
    Initializes the layer.
    [Expand]
    Inherited Methods
    From class com.esri.android.map.TiledServiceLayer
    From class com.esri.android.map.TiledLayer
    From class com.esri.android.map.Layer
    From class java.lang.Object
    From interface com.esri.android.map.popup.PopupLayer

    Constants

    public static final double BING_MAPS_XMAX

    Maximum X coordinate in meters for the full extent of Bing Maps service.

    Constant Value: 2.003750834278E7

    public static final double BING_MAPS_XMIN

    Minimum X coordinate in meters for the full extent of Bing Maps service.

    Constant Value: -2.003750834278E7

    public static final double BING_MAPS_YMAX

    Maximum Y coordinate in meters for the full extent of Bing Maps service.

    Constant Value: 2.0037508342787E7

    public static final double BING_MAPS_YMIN

    Minimum Y coordinate in meters for the full extent of Bing Maps service.

    Constant Value: -2.003750834278E7

    Public Constructors

    public BingMapsLayer (String appId, BingMapsLayer.MapStyle mapStyle)

    Creates a BingMapsLayer object from Bing Maps key and map style.

    This constructor is used if you instantiate the BingMapsLayer pragmatically (see the class description for an example of this usage).

    Parameters
    appId the Bing Maps key.
    mapStyle the map style. See BingMapsLayer.MapStyle for available values

    public BingMapsLayer (String appId, BingMapsLayer.MapStyle mapStyle, boolean initLayer)

    Creates a BingMapsLayer object from Bing Maps key and map style.

    Parameters
    appId -the Bing Maps key.
    mapStyle -the map style.
    initLayer set to true to initialize the the layer, or the layer will not initialized.

    Public Methods

    public String getAppId ()

    Returns the Bing Maps key.

    Returns
    • the Bing Maps key

    public Bitmap getBingLogo (int width, int height)

    Returns the Bing Logo bitmap.

    Parameters
    width - logo width in integer
    height - logo height in integer
    Returns
    • a Bitmap object for Bing Logo

    public String getCulture ()

    Returns the culture of the layer (format: [language]-[REGION], e.g.: en-US)
    see Culture Parameter

    Returns
    • the culture of the layer

    public URL getLogoUrl ()

    Returns a URL object for Bing Maps logo.

    Returns
    • a URL object for Bing Maps logo.

    public BingMapsLayer.MapStyle getMapStyle ()

    Returns the style of the Bing Maps layer.

    Returns
    • the style of the layer

    public String getMapVersion ()

    Returns the map version (format: v[map version], e.g.: v0).

    Returns
    • the map version

    public void refresh ()

    Fetches the information for the tiles again if any of the parameters have changed (map version, map style, culture...) and refreshes the tiles accordingly.

    public void reinitializeLayer (UserCredentials usercredentials)

    This method has no impact on the BingMapsLayer. Please use reinitializeLayer(String) instead.

    Parameters
    usercredentials the usercredentials

    public void reinitializeLayer (String appID)

    Re-initializes the layer with the given appID.

    Parameters
    appID the new appID.

    public void setAppId (String appId)

    Sets the Bing Maps key.

    Parameters
    appId the Bing Maps key to set

    public void setCulture (String culture)

    Sets the culture of the layer (format: [language]-[REGION], e.g.: en-US)
    see Culture Parameter

    Parameters
    culture the culture to set

    public void setMapStyle (BingMapsLayer.MapStyle mapStyle)

    Sets the map style of the Bing Maps layer. see BingMapsLayer.MapStyle for available values.

    Parameters
    mapStyle the map style to set

    public void setMapVersion (String mapVersion)

    Sets the map version (format: v[map version], e.g.: v0).

    Parameters
    mapVersion the map version to set

    Protected Methods

    protected byte[] getTile (int lev, int col, int row)

    get byte array of the tile at the specified level, column and row.

    Throws
    Exception

    protected void initLayer ()

    Initializes the layer. The implementation should submit the OnStatusChangedListener.STATUS event accordingly.