|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.map.WebMap
public class WebMap
This class is used to open a Web Map by URL, ID or PortalItem
and add it to a
JMap
instance. Simply create an instance of this class using either
the full URL of the Web Map, the item ID or a PortalItem
. Note
that if the web map is to be constructed from an item ID and a Portal
instance is not provided, the item is assumed to be hosted on arcgis.com.
If the WebMap
instance is created with a Portal
or
PortalItem
, add the Web Map to a JMap by calling either initializeMap(JMap)
or initializeMapAsync(JMap)
. Otherwise, add to a JMap by
calling either initializeMap(JMap, String, String)
or
initializeMapAsync(JMap, String, String)
. If you are using the
asynchronous version of this, you can listen for map ready events from the
JMap to know when the map control is usable. To find out when individual
layers are ready, you can listen for LayerList
events on the
JMap's LayerList (JMap.getLayers()
).
If the Web Map contains a Bing Maps Layer, then provide the key using setBingKey(String)
.
Constructor Summary | |
---|---|
WebMap(PortalItem item)
Instantiate a new web map using the given PortalItem . |
|
WebMap(PortalItem item,
OnWebMapLoadListener listener)
Instantiate a new web map using the given PortalItem . |
|
WebMap(String itemId)
Instantiates a new web map using just the item ID of the web map item. |
|
WebMap(String itemId,
OnWebMapLoadListener listener)
Instantiates a new web map using just the item ID of the web map item. |
|
WebMap(String itemId,
Portal portal)
Instantiate a new web map using the given item ID and Portal . |
|
WebMap(String itemId,
Portal portal,
OnWebMapLoadListener listener)
Instantiate a new web map using the given item ID and Portal . |
|
WebMap(URL itemURL)
Instantiates a new web map using the full URL of the web map item. |
|
WebMap(URL itemURL,
OnWebMapLoadListener listener)
Instantiates a new web map using the full URL of the web map item. |
Method Summary | ||
---|---|---|
String |
getBingKey()
Returns the key that was set to access a Bing Maps layer. |
|
List<Bookmark> |
getBookmarks()
Get a list of Bookmark s defined by this web map. |
|
UserCredentials |
getCredentials()
Get the user credentials used to access this web map. |
|
com.esri.core.internal.io.handler.IdentityManager |
getIdentityManager()
|
|
PortalItem |
getInfo()
Gets information on this web map. |
|
Envelope |
getInitExtent()
Get this web map's initial extent. |
|
List<WebMapQuery> |
getPredifinedQueries()
Get a list of WebMapQuery s defined by this web map. |
|
String |
getVersion()
Get this web map's version. |
|
protected void |
handleMapServerLayer(WebMapLayer webMapLayer,
String url)
Handle a map server layer. |
|
void |
initializeMap(JMap map)
Read the layers from a web map and add them to the given JMap
instance. |
|
void |
initializeMap(JMap map,
String uname,
String pwd)
Read the layers from a web map and add them to the given JMap
instance. |
|
void |
initializeMapAsync(JMap map)
Asynchronous version of initializeMap(JMap) . |
|
void |
initializeMapAsync(JMap map,
String uname,
String pwd)
Asynchronous version of initializeMap(JMap, String, String) . |
|
|
loadServiceInfo(com.esri.core.internal.tasks.Task<T> task,
WebMapLayer wmlayer)
|
|
void |
setBingKey(String bingKey)
Sets the key to be used to access a Bing Maps layer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WebMap(PortalItem item)
PortalItem
.
item
- portal item describing web mappublic WebMap(String itemId, Portal portal)
Portal
.
itemId
- ID of web map itemportal
- portal serving the web mappublic WebMap(URL itemURL)
itemURL
- the item URLpublic WebMap(String itemId) throws MalformedURLException
itemId
- the item id
MalformedURLException
- a malformed URL exceptionpublic WebMap(PortalItem item, OnWebMapLoadListener listener)
PortalItem
.
item
- portal item describing web mappublic WebMap(String itemId, Portal portal, OnWebMapLoadListener listener)
Portal
.
itemId
- ID of web map itemportal
- portal serving the web mappublic WebMap(URL itemURL, OnWebMapLoadListener listener)
itemURL
- the item URLpublic WebMap(String itemId, OnWebMapLoadListener listener) throws MalformedURLException
itemId
- the item id
MalformedURLException
- a malformed URL exceptionMethod Detail |
---|
public String getBingKey()
public void setBingKey(String bingKey)
bingKey
- key to be used to access any Bing Maps layer.public void initializeMap(JMap map) throws Exception
JMap
instance. Calling this method will remove all layers from the given
JMap
and replace them with the web map's layers. Listening
for a map ready event on the given JMap
will tell you when
the map control is usable. Listening for layer list events on the
JMap
's layer list will allow you to get a reference to each
layer added and add layer event listeners if desired.
map
- the map to add the layers to
Exception
public void initializeMap(JMap map, String uname, String pwd) throws Exception
JMap
instance. Calling this method will remove all layers from the given
JMap
and replace them with the web map's layers. Listening
for a map ready event on the given JMap
will tell you when
the map control is usable. Listening for layer list events on the
JMap
's layer list will allow you to get a reference to each
layer added and add layer event listeners if desired.
map
- the map to add the layers touname
- the user name, if anypwd
- the password, if any
Exception
public void initializeMapAsync(JMap map)
initializeMap(JMap)
.
map
- the map to add the layers topublic void initializeMapAsync(JMap map, String uname, String pwd)
initializeMap(JMap, String, String)
.
map
- the map to add the layers touname
- the user name, if anypwd
- the password, if anypublic UserCredentials getCredentials()
public Envelope getInitExtent()
public PortalItem getInfo()
public List<Bookmark> getBookmarks()
Bookmark
s defined by this web map. Use this method after corresponding JMap
is ready.
JMap
is not ready.public List<WebMapQuery> getPredifinedQueries()
WebMapQuery
s defined by this web map.
public String getVersion()
protected void handleMapServerLayer(WebMapLayer webMapLayer, String url)
webMapLayer
- the web map layerurl
- the URL of the referenced service layerpublic <T> com.esri.map.InteractiveTask.InteractiveTaskResult<T> loadServiceInfo(com.esri.core.internal.tasks.Task<T> task, WebMapLayer wmlayer) throws Exception
Exception
public com.esri.core.internal.io.handler.IdentityManager getIdentityManager()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |