java.lang.Object | ||||
↳ | com.esri.android.map.Layer | |||
↳ | com.esri.android.map.TiledLayer | |||
↳ | com.esri.android.map.TiledServiceLayer | |||
↳ | com.esri.android.map.bing.BingMapsLayer |
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 Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
enum | BingMapsLayer.MapStyle | Map styles available for the 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
|
Maximum X coordinate in meters for the full extent of Bing Maps service.
Minimum X coordinate in meters for the full extent of Bing Maps service.
Maximum Y coordinate in meters for the full extent of Bing Maps service.
Minimum Y coordinate in meters for the full extent of Bing Maps service.
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).appId | the Bing Maps key. |
---|---|
mapStyle | the map style. See BingMapsLayer.MapStyle for available values |
Creates a BingMapsLayer object from Bing Maps key and map style.
appId | -the Bing Maps key. |
---|---|
mapStyle | -the map style. |
initLayer | set to true to initialize the the layer, or the layer will not initialized. |
Returns the Bing Logo bitmap.
width | - logo width in integer |
---|---|
height | - logo height in integer |
Returns the culture of the layer (format: [language]-[REGION], e.g.: en-US)
see Culture Parameter
Returns a URL object for Bing Maps logo.
Returns the style of the Bing Maps layer.
Returns the map version (format: v[map version], e.g.: v0).
Fetches the information for the tiles again if any of the parameters have changed (map version, map style, culture...) and refreshes the tiles accordingly.
This method has no impact on the BingMapsLayer. Please use reinitializeLayer(String)
instead.
usercredentials | the usercredentials |
---|
Re-initializes the layer with the given appID.
appID | the new appID. |
---|
Sets the Bing Maps key.
appId | the Bing Maps key to set |
---|
Sets the culture of the layer (format: [language]-[REGION], e.g.: en-US)
see Culture Parameter
culture | the culture to set |
---|
Sets the map style of the Bing Maps layer. see BingMapsLayer.MapStyle
for available values.
mapStyle | the map style to set |
---|
Sets the map version (format: v[map version], e.g.: v0).
mapVersion | the map version to set |
---|
get byte array of the tile at the specified level, column and row.
Exception |
---|
Initializes the layer. The implementation should submit the OnStatusChangedListener.STATUS
event accordingly.