|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.esri.wms.client.Map
public class Map
Connects to an OGC WMS server and represents the WMS map to be displayed.
ServerConnection server = new ServerConnection("http://server/");
Map map = new Map(server);
MapURL mapUrl = map.getMapURL(server.getMapFormats().get(0));
String url = mapUrl.getURL();
System.out.println(url);
| Constructor Summary | |
|---|---|
Map(Layer layer,
ServerConnection wmsServer)
Instantiates an object of Map from the given layer and server. |
|
Map(ServerConnection wmsServer)
Instantiates a object of Map from the given server connection. |
|
| Method Summary | |
|---|---|
void |
applyLayerFilter(List<String> layers)
Only the layers in the given list will be enabled. |
List<Layer> |
getAllLayers()
Returns all map sub-layers in a list. |
Color |
getBackgroundColor()
Gets the background color of the Map. |
SpatialReference |
getDefaultSpatialReference()
Gets the default spatial reference for the map rendering. |
Envelope |
getExtent()
Gets the extend of current map. |
Envelope |
getFullExtent()
Gets the full extent of the Map. |
int |
getHeight()
Gets the height of the map. |
Layer |
getLayer()
Gets the layer of the Map. |
List<String> |
getLayerFilter()
Returns the layers filter which associated with the map. |
String |
getLayerStyleString()
Creates the value of the STYLES parameter which is a comma-separated list of one or more valid style names. |
InputStream |
getMapAsStream(String mime)
Creates a GetMap request URL based on current map and server settings. |
String |
getMapLayerString()
Creates the value of the LAYERS parameter which is a comma-separated list of one or more valid layer names. |
MapURL |
getMapURL(String mime)
Creates a GetMap request URL based on current map and server settings. |
List<Layer> |
getQueryableLayers()
Creates the value of the QUERY_LAYERS parameter which is a comma-separated list of one or more valid layer names. |
List<SpatialReference> |
getSpatialReferences()
Gets the supported spatial references of the Map. |
int |
getWidth()
Gets the width of the Map. |
ServerConnection |
getWmsServer()
Gets the server to which the map connect. |
Boolean |
isTransparent()
Returns true if the map has a transparent background. |
FeatureInfo |
query(Point point,
List<Layer> queryLayers,
int count,
String format)
Gets feature information on the given point. |
void |
setBackgroundColor(Color backgroundColor)
Sets the background color of the Map. |
void |
setDefaultSpatialReference(SpatialReference defaultSpatialReference)
Sets the default spatial reference for the map rendering. |
void |
setExtent(Envelope extent)
Sets the extend of the map. |
void |
setHeight(int height)
Sets the height of the map. |
void |
setTransparent(Boolean transparent)
Sets to true if the map has a transparent background. |
void |
setWidth(int width)
Sets the width of the Map. |
Point |
toMapPoint(Point point)
Transforms a point from the screen spatial reference system to the map reference system. |
Point |
toScreenPoint(Point point)
Transforms a point from the map spatial reference system to the screen reference system. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Map(Layer layer,
ServerConnection wmsServer)
layer - the layer to add to the map.wmsServer - the server connection object.public Map(ServerConnection wmsServer)
| Method Detail |
|---|
public Color getBackgroundColor()
public void setBackgroundColor(Color backgroundColor)
backgroundColor - The backgroundColor to set.public Envelope getFullExtent()
public int getHeight()
public void setHeight(int height)
height - The height to set.public Layer getLayer()
public Boolean isTransparent()
public void setTransparent(Boolean transparent)
transparent - Sets to true if the map has a transparent background.public List<SpatialReference> getSpatialReferences()
public int getWidth()
public void setWidth(int width)
width - The width to set.public ServerConnection getWmsServer()
public List<Layer> getAllLayers()
public MapURL getMapURL(String mime)
MapURL mapUrl = map.getMapURL(server.getMapFormats().get(0)); String url = mapUrl.getURL(); System.out.println(url);
mime - the format of the return map.
public InputStream getMapAsStream(String mime)
throws IOException
mime - the format of the return map.
IOException
public FeatureInfo query(Point point,
List<Layer> queryLayers,
int count,
String format)
throws ServiceException,
IOException
point - a screen pointqueryLayers - the layers to query.count - Number of features about which to return information (default=1).format - Return format of feature information (MIME type).
ServiceException
IOExceptionpublic Point toScreenPoint(Point point)
point - the point in map spatial reference system.public Point toMapPoint(Point point)
point - the point in screen spatial reference system.public Envelope getExtent()
public void setExtent(Envelope extent)
public SpatialReference getDefaultSpatialReference()
public void setDefaultSpatialReference(SpatialReference defaultSpatialReference)
defaultSpatialReference - public String getMapLayerString()
public String getLayerStyleString()
public List<Layer> getQueryableLayers()
public void applyLayerFilter(List<String> layers)
layers - the layer name list to enable.public List<String> getLayerFilter()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||