|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.map.Layer com.esri.map.OpenStreetMapLayer
public class OpenStreetMapLayer
Layer that supports OpenStreetMap (OSM) tile servers.
Default tile servers used are:
OpenStreetMapLayer(ArrayList, int, int, String)
, or use
#setTileServerURLs(ArrayList, int, int)
. Some of the tile servers available are
listed at
Tile Servers.setKey(String)
can be used replace the placeholder with actual key at runtime. Layer.getCopyrightText()
, Layer.setCopyrightText(String)
.JMap
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.esri.map.Layer |
---|
Layer.LayerStatus |
Field Summary | |
---|---|
protected int[] |
displayLevels
|
static int |
DPI
Resolution - dots per inch. |
protected ConcurrentHashMap<String,Future<?>> |
pending
|
protected static ExecutorService |
pool
|
static double |
XMAX
Maximum X coordinate in meters for the full extent. |
static double |
XMIN
Minimum X coordinate in meters for the full extent. |
static double |
YMAX
Maximum Y coordinate in meters for the full extent. |
static double |
YMIN
Minimum Y coordinate in meters for the full extent. |
Fields inherited from class com.esri.map.Layer |
---|
_credentials, _progress, _resolutionList, serviceInfo |
Constructor Summary | |
---|---|
OpenStreetMapLayer()
Creates an instance of OpenStreetMapLayer with default tile servers and attribution. |
|
OpenStreetMapLayer(ArrayList<String> tileServerURLs,
int minZoomLevel,
int maxZoomLevel,
String attributionText)
Creates an instance of OpenStreetMapLayer with specified tile servers. |
Method Summary | |
---|---|
protected void |
cancelRequest(int lod,
int col,
int row)
|
void |
clearTiles()
Cancels all current tile request. |
protected void |
createNativeLayer()
|
SpatialReference |
getDefaultSpatialReference()
Gets the defaultSpatialReference of the Layer. |
protected Rectangle |
getExtentBoundsOnScreen()
|
LayerLegendInfoCollection |
getLegend()
|
com.esri.map.JMap.LogoInfo |
getLogoInfo()
Gets the logo info. |
int |
getMaxZoomLevel()
Returns the maximum zoom level. |
int |
getMinZoomLevel()
Returns the minimum zoom level. |
double |
getResolution()
Gets the resolution of the Layer. |
protected void |
getTileAsynch(int lod,
int col,
int row,
com.esri.map.TiledMapServiceLayer.TileListener tilecallback)
|
ArrayList<String> |
getTileServerURLs()
The URLs used to fetch tiles from. |
String |
getUrl()
Gets the URL of the map service associated with the layer. |
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 style, attribution) and refreshes the tiles accordingly. |
protected void |
requestTile(int lod,
int col,
int row)
|
void |
setKey(String key)
Replaces the placeholder "{KEY}" in the tile server URLs. |
void |
setLogoInfo(com.esri.map.JMap.LogoInfo logoInfo)
Sets the logo info. |
void |
setTileServerURLs(ArrayList<String> tileServerURLs,
int minZoomLevel,
int maxZoomLevel,
String attributionText)
Sets the URLs used to fetch tiles from. |
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 double XMIN
public static final double YMIN
public static final double XMAX
public static final double YMAX
public static final int DPI
protected int[] displayLevels
protected final ConcurrentHashMap<String,Future<?>> pending
protected static final ExecutorService pool
Constructor Detail |
---|
public OpenStreetMapLayer()
OpenStreetMapLayer
with default tile servers and attribution.
Default tile servers used are:
OpenStreetMapLayer(ArrayList, int, int, String)
public OpenStreetMapLayer(ArrayList<String> tileServerURLs, int minZoomLevel, int maxZoomLevel, String attributionText)
OpenStreetMapLayer
with specified tile servers.
tile
- servers that follow OSM specification to fetch tiles from.minimum
- zoom levelmaximum
- zoom levelattributionText
- attribution to be used.
IllegalArgumentException
- if the tile server URLs are null or empty, or if
the zoom levels are negative.OpenStreetMapLayer()
Method Detail |
---|
public com.esri.map.JMap.LogoInfo getLogoInfo()
public void setLogoInfo(com.esri.map.JMap.LogoInfo logoInfo)
logoInfo
- the logo info.public ArrayList<String> getTileServerURLs()
setTileServerURLs(ArrayList, int, int, String)
public void setTileServerURLs(ArrayList<String> tileServerURLs, int minZoomLevel, int maxZoomLevel, String attributionText)
tileServerURLs
- URLs to be used to fetch tiles. Should not be null or empty.minZoomLevel
- minimum zoom level supported by the tile servers.maxZoomLevel
- maximum zoom level supported by the tile servers.attributionText
- text to be displayed as attribution.
IllegalArgumentException
- if the tile server URLs are null or empty, or if
the zoom levels are negative.getTileServerURLs()
public int getMinZoomLevel()
public int getMaxZoomLevel()
public void refresh()
public LayerLegendInfoCollection getLegend()
getLegend
in class Layer
public double getResolution()
Layer
getResolution
in class Layer
public SpatialReference getDefaultSpatialReference()
Layer
getDefaultSpatialReference
in class Layer
public String getUrl()
Layer
getUrl
in class Layer
public void setUrl(String url)
url
- the URLpublic void setKey(String key)
key
- key to be used.protected void internalInit()
protected Rectangle getExtentBoundsOnScreen()
protected void getTileAsynch(int lod, int col, int row, com.esri.map.TiledMapServiceLayer.TileListener tilecallback)
protected void cancelRequest(int lod, int col, int row)
protected void initializeNativeLayer()
initializeNativeLayer
in class Layer
protected void requestTile(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 |