Render Named Map
Rendering a named map is used when you want to obtain a view of a named map as an image, by specifying the named map, the representation (for example, gif), the dimensions of the raster and a view represented as either a center and zoom, a center and scale or a bounding box. If a view is not defined in the REST request, the view defined in the named map will be used. Optionally, you may specify the locale, resolution (DPI), whether or not to ignore issues with rendering underlying layers, the background color and opacity, as well as provide authorization (security) information.
The URL is specified with a location and name for the named map to render, allowing the URL to be dynamic, based on the location of the named map in the repository. The name of the named map occurs between the /maps method portion of the URL and the /image.{rep} type portion of the URL. For example, to render a named map located at /earth/Europe in the repository, this URL would be used:
http://hostname:port/rest/Spatial/MappingService/maps/earth/Europe/image.png;...
Examples
Render the world countries with a translucent blue background:
http://hostname:port/rest/Spatial/MappingService/maps/Samples/NamedMaps/CountriesWithShapeTable/image.png;w=256;h=256;b=-180,-90,180,90,epsg:4326;bc=0048FF;bo=.5 HTTP/1.1
Content-type: application/json
Authorization: <Basic or Spectrum Token>
Render the world with high quality and fail on exceptions:
http://hostname:port/rest/Spatial/MappingService/maps/Samples/NamedMaps/WorldMap/image.png;w=256;h=256;b=-180,-90,180,90,epsg:4326;rd=q;
Content-type: application/json
Authorization: <Basic or Spectrum Token>
Render the world named map where the view is defined in the named map:
http://hostname:port/rest/Spatial/MappingService/maps/Samples/NamedMaps/WorldMap/image.png;w=256;h=256
Content-type: application/json
Authorization: <Basic or Spectrum Token>
The following rules in priority order determine how the rendering view is created:
- if the center and zoom is specified then all other parameters governing the view are ignored
- if the center and scale is specified then all other parameters governing the view are ignored
- if the bbox is specified then that is used
- if none of these requirements are satisfied then it will use the view defined in the named map
- if view is not defined in the request and is not defined in the named map, an HTTP code of 404 (Not Found) will be returned
Rendering named maps can be performed in the following ways: