Render Named Map Given a Center and Zoom
Description
Returns an image of a map in the format specified at a specified location and zoom.
ACL Authorization Flow
To return an image in the specified format at a specified location and zoom, the user (or the role they belong to) needs EXECUTE permission on the Named table.
HTTP GET URL Format
The following format is used for HTTP GET requests:
HTTP GET /maps/map name/image.image type;w=width;h=height;c=x,y,srs;
z=zoom;[r=resolution]/
Parameters
For information on the parameter types listed below, see Request URL Data Types.
Parameter | Type | Required | Description |
---|---|---|---|
map name | String | yes | The name of the map to render. The map is specified by a regex for the named map to render based on the location of the named map in the repository. The name of the named map is defined between the /maps portion of the URL and the /image.image type portion of the URL. For example, to render a named map located at /earth/Europe in the repository, the following URL would be used: http://.../maps/earth/Europe/image.png;... |
image type | String | yes | The type of image to return (gif, png, jpg, bmp, jpeg, or tiff) |
w=width | Integer | yes | Width of the image in pixels |
h=height | Integer | yes | Height of the image in pixels |
c=x, y, srs | Double, Double, String | yes | The center of the view in geographic coordinates consisting of a x, y position and the srs name (spatial reference system). |
z=zoom | Integer, String | yes | The Zoom, or distance across the view in linear units. The zoom is represented by a string with a number followed by one or more spaces followed by an linear unit abbreviation (e.g., mi, km, m, etc). |
r=resolution | Integer | no | The DPI resolution of the map as an integer. DPI measures the resolution of map images in dots per inch (the number of individual dots that can be placed within the span of one linear inch). If not specified then assumes server default. |
bc=background color | String | no | The background color to use for the map image, as expressed in RRGGBB format. If not supplied, the background color will be transparent. Note: Unlike with the SOAP API, a leading # should not precede the hexadecimal web color. |
bo=background opacity | Double | no |
The opacity of the background color. If the background and backgroundOpacity attributes are specified, these values will be used to draw the background. If the background is not used, then the background will be totally transparent regardless of the backgroundOpacity attribute. If the background is used but no opacity is specified, then the background will be totally opaque. |
Returns
Returns an image in the specified format.
Example
Render a named map as a PNG that is 640 x 480 pixels in dimension, the map is centered at (-2.5, 38.5) in WGS 84, the view is 500 miles across, the DPI is 96.
GET http://<server>:<port>/rest/Spatial/MappingService/maps/Samples/NamedMaps/WorldMap/image.png;w=640;h=480;c=-2.5,38.5,epsg:4326;z=500%20mi;r=96
Content-type: application/json
Authorization: <Basic or Spectrum Token>