convertScreenToMapCoord
Description
Converts a specified set of screen pixel coordinates to coordinates in the map's coordinate system, and returns them.
Parameters
For information on the parameter types listed below, see Request URL Data Types.
Parameter | Type | Required | Description |
---|---|---|---|
name | String | yes | Specifies the name of the named map for which you are converting coordinates. |
level | Integer | yes |
Specifies the map zoom level. This parameter must be set to a value greater than or equal to the minLevel value and less than or equal to the maxLevel value for the named map. You can determine these values by calling the getDescription method and examining the returned MapDescription object. For more information, see getDescription and MapDescription. |
screenX | Integer | yes | Specifies the x coordinate value of the point in the view to be converted. This point is specified from the upper left corner of the view in pixels. |
screenY | Integer | yes | Specifies the y coordinate value of the point in the view to be converted. This point is specified from the upper left corner of the view in pixels. |
view | Bounds | yes | Specifies the geographic bounds of the view that displays the map, expressed in terms of the map's coordinate system. |
output | String | yes | Specifies the response format. Must be json. |
Example
http://<server>:<port>/rest/Spatial/LegacyMapTilingService/convertScreenToMapCoord?
name=/NamedTiles/WorldTile
&level=4
&screenX=100
&screenY=100
&view=-20000000,20000000,20000000,-20000000
&output=json
The above example will return the following JSON response object:
{"EnvinsaResponse":{"mapCoord":{"coordSys":"epsg:41001","point":{"x":-1.8045920,"y":1.804592085}},"type":"MapTilingResponse"}}
Returns
A MapCoordinate object as seen in the above sample. See MapCoordinate.