convertMapToVirtualPixelCoord

Description

Converts a specified set of map coordinates to coordinates in the virtual pixel space of the entire map image, and returns them.

Note: Do not confuse coordinates in the virtual pixel space of the entire map image with normal screen pixel coordinates. Normal screen pixel coordinates always start with (0, 0) at the top left corner of the screen, regardless of what section of the entire map image is currently displayed in the screen. In contrast, the virtual pixel space of the map image is constant at any particular zoom level, regardless of what part of the map is currently displayed in the screen. So, for example, if a map image is set to zoom level 3, the map image is composed of 4 tiles across and 4 tiles down. If each tile has dimensions of 512 by 256 pixels, then the dimensions of the entire map image are 2048 by 1024 pixels. This is referred to as the virtual pixel space of the map image, because only a subsection of the entire image may be displayed in the screen at any one time.

Parameters

For information on the parameter types listed below, see Request URL Data Types.

Parameter Type Required Description
worldX Float yes

Specifies the x coordinate of the map's point location.

The map location is specified in terms of the units of the map coordinate system (for example, degrees or meters). You can determine the coordinate system of the map by calling the convertScreenToMapCoord method and examining the returned MapCoordinate object. For more information, see convertScreenToMapCoord and MapCoordinate.

worldY Float yes

Specifies the y coordinate of the map's point location.

The map location is specified in terms of the units of the map coordinate system (for example, degrees or meters). You can determine the coordinate system of the map by calling the convertScreenToMapCoord method and examining the returned MapCoordinate object. For more information, see convertScreenToMapCoord and MapCoordinate.

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.

name String yes Specifies the name of the named map from which the map tiles are generated.
output String yes Specifies the response format. Must be json.

Example


http://<server>:<port>/rest/Spatial/LegacyMapTilingService/convertMapToVirtualPixelCoord?
  name=/NamedTiles/WorldTile
  &level=4
  &worldX=-79.377366
  &worldY=43.64713
  &output=json
			

The above example will return the following JSON response object:


{"EnvinsaResponse":{"type":"MapTilingResponse","virtualPixelCoord":{"virtualX":1023,"virtualY":1023}}}
			

Returns

A VirtualPixelCoordinate object as seen in the above example. See VirtualPixelCoordinate.