com.esri.android.map.bing
Class BingMapsLayer

java.lang.Object
  extended by com.esri.android.map.Layer
      extended by com.esri.android.map.TiledLayer
          extended by com.esri.android.map.TiledServiceLayer
              extended by com.esri.android.map.bing.BingMapsLayer

public class BingMapsLayer
extends TiledServiceLayer

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.


Nested Class Summary
static class BingMapsLayer.MapStyle
           Map styles available for the imagery: Aerial - Aerial imagery AerialWithLabels - Aerial imagery with a road overlay Road - Roads without additional imagery.
 
Nested classes/interfaces inherited from class com.esri.android.map.TiledServiceLayer
TiledServiceLayer.TileInfo
 
Field Summary
static int BING_MAPS_SPATIAL_REFERENCE_WKID
          The WKID of spatial reference for the Bing Maps Imagery service.
static double BING_MAPS_XMAX
          Maximum X coordinate in meters for the full extent of Bing Maps service.
static double BING_MAPS_XMIN
          Minimum X coordinate in meters for the full extent of Bing Maps service.
static double BING_MAPS_YMAX
          Maximum Y coordinate in meters for the full extent of Bing Maps service.
static double BING_MAPS_YMIN
          Minimum Y coordinate in meters for the full extent of Bing Maps service.
static int initWithDpi
          The DPI for Bing Maps.
 
Constructor Summary
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.
 
Method Summary
 String getAppId()
          Returns the Bing Maps key.
 android.graphics.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
 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).
 
Methods inherited from class com.esri.android.map.TiledServiceLayer
getTileInfo, recycle
 
Methods inherited from class com.esri.android.map.TiledLayer
clearTiles, getBrightness, getContrast, getCurrentLevel, getGamma, setBrightness, setContrast, setGamma
 
Methods inherited from class com.esri.android.map.Layer
getCredentials, getDefaultSpatialReference, getExtent, getFullExtent, getHeight, getID, getName, getOpacity, getPopupInfo, getResolution, getSpatialReference, getTitle, getUrl, getUrlHashCode, getWidth, isInitialized, isRecycled, isVisible, isWebMapBaselayer, setName, setOnStatusChangedListener, setOpacity, setPopupInfos, setVisible
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BING_MAPS_SPATIAL_REFERENCE_WKID

public static final int BING_MAPS_SPATIAL_REFERENCE_WKID
The WKID of spatial reference for the Bing Maps Imagery service. The value is 102100.

See Also:
Constant Field Values

BING_MAPS_XMIN

public static final double BING_MAPS_XMIN
Minimum X coordinate in meters for the full extent of Bing Maps service.

See Also:
Constant Field Values

BING_MAPS_YMIN

public static final double BING_MAPS_YMIN
Minimum Y coordinate in meters for the full extent of Bing Maps service.

See Also:
Constant Field Values

BING_MAPS_XMAX

public static final double BING_MAPS_XMAX
Maximum X coordinate in meters for the full extent of Bing Maps service.

See Also:
Constant Field Values

BING_MAPS_YMAX

public static final double BING_MAPS_YMAX
Maximum Y coordinate in meters for the full extent of Bing Maps service.

See Also:
Constant Field Values

initWithDpi

public static final int initWithDpi
The DPI for Bing Maps. The value is 96.

See Also:
Constant Field Values
Constructor Detail

BingMapsLayer

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

BingMapsLayer

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.
Method Detail

getLogoUrl

public URL getLogoUrl()
Returns a URL object for Bing Maps logo.

Returns:
a URL object for Bing Maps logo.

getMapStyle

public BingMapsLayer.MapStyle getMapStyle()
Returns the style of the Bing Maps layer.

Returns:
the style of the layer

setMapStyle

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

getMapVersion

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

Returns:
the map version

setMapVersion

public void setMapVersion(String mapVersion)
Sets the map version (format: v[map version], e.g.: v0).

Parameters:
mapVersion - the map version to set

getCulture

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

setCulture

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

getAppId

public String getAppId()
Returns the Bing Maps key.

Returns:
the Bing Maps key

setAppId

public void setAppId(String appId)
Sets the Bing Maps key.

Parameters:
appId - the Bing Maps key to set

refresh

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.


getBingLogo

public android.graphics.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

reinitializeLayer

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

Overrides:
reinitializeLayer in class Layer
Parameters:
usercredentials - the new credentials to try.

reinitializeLayer

public void reinitializeLayer(String appID)
Re-initializes the layer with the given appID.

Parameters:
appID - the new appID.


Copyright © 2012. All Rights Reserved.