|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.esri.map.Layer
com.esri.map.BingMapsLayer
public class 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 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.map.Layer |
---|
Layer.LayerStatus |
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. |
protected int[] |
displayLevels
|
static int |
initWithDpi
The DPI for Bing Maps. |
protected ConcurrentHashMap<String,Future<?>> |
pending
|
protected static ExecutorService |
pool
|
Fields inherited from class com.esri.map.Layer |
---|
_credentials, _progress, _resolutionList, serviceInfo |
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 | |
---|---|
protected void |
cancelRequest(int lod,
int col,
int row)
|
void |
clearTiles()
Cancels all current tile request. |
protected void |
createNativeLayer()
|
String |
getAppId()
Returns the Bing Maps key. |
String |
getCulture()
Returns the culture of the layer (format: [language]-[REGION], e.g.: en-US) see Culture Parameter |
LayerLegendInfoCollection |
getLegend()
|
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). |
protected void |
getTileAsynch(int lod,
int col,
int row,
com.esri.map.TiledMapServiceLayer.TileListener tilecallback)
get byte array of the tile at the specified level, column and row. |
protected void |
init(boolean isVisible,
int[] displayLevels,
String title,
float opacity)
This method is called only when composing a Map from a Web Map. |
protected void |
initializeNativeLayer()
|
protected void |
internalInit()
|
protected long |
nativeCreateLayer()
|
protected boolean |
nativeInitialize(long layerHandle,
int pWKT,
String wkt,
double originX,
double originY,
double minX,
double minY,
double maxX,
double maxY,
double[] lodScale,
double[] lodResolution,
int lodCount,
int dpi,
int tilePixelWidth,
int tilePixelHeight)
|
protected void |
nativeSetCachePath(long layerHandle,
String path)
|
protected void |
nativeSetTile(long layerHandle,
int lod,
int col,
int row,
byte[] pData,
int size)
|
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. |
protected void |
requestTile(int lod,
int col,
int row)
|
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. see BingMapsLayer.MapStyle for
available values. |
void |
setMapVersion(String mapVersion)
Sets the map version (format: v[map version], e.g.: v0). |
void |
setUrl(String url)
Sets the URL. |
protected void |
updateProgress()
Update progress. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BING_MAPS_SPATIAL_REFERENCE_WKID
public static final double BING_MAPS_XMIN
public static final double BING_MAPS_YMIN
public static final double BING_MAPS_XMAX
public static final double BING_MAPS_YMAX
public static final int initWithDpi
protected int[] displayLevels
protected final ConcurrentHashMap<String,Future<?>> pending
protected static final ExecutorService pool
Constructor Detail |
---|
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).
appId
- the Bing Maps key.mapStyle
- the map style. See BingMapsLayer.MapStyle
for available valuespublic BingMapsLayer(String appId, BingMapsLayer.MapStyle mapStyle, boolean initLayer)
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 |
---|
public URL getLogoUrl()
public void setUrl(String url)
url
- the URLprotected void internalInit()
protected void initializeNativeLayer()
initializeNativeLayer
in class Layer
protected void getTileAsynch(int lod, int col, int row, com.esri.map.TiledMapServiceLayer.TileListener tilecallback)
public BingMapsLayer.MapStyle getMapStyle()
public void setMapStyle(BingMapsLayer.MapStyle mapStyle)
BingMapsLayer.MapStyle
for
available values.
mapStyle
- the map style to setpublic String getMapVersion()
public void setMapVersion(String mapVersion)
mapVersion
- the map version to setpublic String getCulture()
public void setCulture(String culture)
culture
- the culture to setpublic String getAppId()
public void setAppId(String appId)
appId
- the Bing Maps key to setpublic void refresh()
public LayerLegendInfoCollection getLegend()
getLegend
in class Layer
protected void requestTile(int lod, int col, int row)
protected void cancelRequest(int lod, int col, int row)
public void clearTiles()
protected void init(boolean isVisible, int[] displayLevels, String title, float opacity)
Layer
init
in class Layer
protected void createNativeLayer()
createNativeLayer
in class Layer
protected void updateProgress()
protected long nativeCreateLayer()
protected boolean nativeInitialize(long layerHandle, int pWKT, String wkt, double originX, double originY, double minX, double minY, double maxX, double maxY, double[] lodScale, double[] lodResolution, int lodCount, int dpi, int tilePixelWidth, int tilePixelHeight)
protected void nativeSetTile(long layerHandle, int lod, int col, int row, byte[] pData, int size)
protected void nativeSetCachePath(long layerHandle, String path)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |