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.TiledLayer
    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(String appID)
    Re-initializes the layer with the given appID.
    void reinitializeLayer(UserCredentials usercredentials)
    This method has no impact on the BingMapsLayer.
    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 and Supported Culture Codes.
    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 String: the Bing Maps key.
    mapStyle BingMapsLayer.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 String: -the Bing Maps key.
    mapStyle BingMapsLayer.MapStyle: -the map style.
    initLayer boolean: 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
    String the Bing Maps key

    public Bitmap getBingLogo (int width, int height)

    Returns the Bing Logo bitmap.

    Parameters
    width int: - logo width in integer
    height int: - logo height in integer
    Returns
    Bitmap 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
    String the culture of the layer

    public URL getLogoUrl ()

    Returns a URL object for Bing Maps logo.

    Returns
    URL a URL object for Bing Maps logo.

    public BingMapsLayer.MapStyle getMapStyle ()

    Returns the style of the Bing Maps layer.

    Returns
    BingMapsLayer.MapStyle the style of the layer

    public String getMapVersion ()

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

    Returns
    String 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 (String appID)

    Re-initializes the layer with the given appID.

    Parameters
    appID String: the new appID.

    public void reinitializeLayer (UserCredentials usercredentials)

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

    Parameters
    usercredentials UserCredentials: the usercredentials

    public void setAppId (String appId)

    Sets the Bing Maps key.

    Parameters
    appId String: 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 and Supported Culture Codes. Call refresh() method after setting a new culture.

    Parameters
    culture String: 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 BingMapsLayer.MapStyle: the map style to set

    public void setMapVersion (String mapVersion)

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

    Parameters
    mapVersion String: 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.

    Parameters
    lev int: an integer representing the scale level
    col int: an integer representing the column
    row int: an integer representing the row
    Returns
    byte[] byte array of tiles
    Throws
    Exception

    protected void initLayer ()

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