Represents /map resource represents the mapping capabilities of Weave.
Note |
---|
For Weave to be able to provide mapping functions one or more map engines must be configured. A map engine abstracts an application or service which is capable of generating map images. |
Top-level resource: services/v1/map
...
Provides a list of all map engines configured and available on Weave
Noteinfo | ||
---|---|---|
| ||
...
Parameters
3.1 GET query parameters
mapengine.id - string - map engine identifier as per configuration
layers - comma separated list of strings - map layers as per configuration
styles - comma separated list of strings - styles as per map layer configuration
crs - string - Coordinate reference system used to specify the map envelope coordinates (minx, miny, maxx, maxy)
minx - decimal - Left margin x axis value of the map image
miny - decimal - Bottom margin y axis value of the map image
maxx - decimal - Right margin x axis value of the map image
maxy - decimal - Top margin y axis value of the map image
scale - Map scale - ratio of a unit of distance on the map image to actual distance on land - if different from the scale derived by comparing the map envelope to width and height, envelope will be readjusted
dpi - integer - Logical (CSS) dots-per-inch value on the client display
width - integer - image width in pixels
height - integer - image height in pixels
opacity - decimal - image transparency as a decimal <= 1.0
3.2 Sample POST body parameter
example:
Code Block | ||||
---|---|---|---|---|
| ||||
{ "map.descriptions": [ { "opacity": 1, "layers": "0", "map.engine": "google.streets" }, { "opacity": 1, "layers": "addresspoi", "map.engine": "nswdpe" }, { "opacity": 1, "layers": "_selection.all", "map.engine": "selection.main" } ], "selections": [ { "entityid": "property", "featureids": [ "2035960_Unit_1_1_Market_Street__11_Sydney_DP777449" ] } ] } |
Return values
Accept header | Return value example | Description |
---|---|---|
image/* | <image binary data |
stream, default format is PNG> | image data |
image/png | <image binary data |
stream, PNG format> | image data |
image/jpeg | <image binary data |
stream, JPEG format> | image data | ||||||||
application/json |
| JSON object containing a 'path' property which points to a generated image on the server |
Example 3 - Draw a map image using a map engine backed by a WMS server (HTTP GET)
...
Example 3 - Draw a map image by specifying pre-configured layers and a feature selection (HTTP POST)
Code Block | ||||
---|---|---|---|---|
| ||||
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --data '{"map.descriptions":[{"opacity":1,"layers":"0","map.engine":"google.streets"}, {"opacity":1,"layers":"addresspoi","map.engine":"nswdpe"},{"opacity":1,"layers":"_selection.all","map.engine":"selection.main"}],"selections":[{"entityid":"property","featureids":["2035960_Unit_1_1_Market_Street__11_Sydney_DP777449"]}]}' 'http://localhost:8080/weave/services/v1/map/show?crs=EPSG%3A3857&minx=16831751.916958902&miny=-4011871.179336485&maxx=16832450.599170577&maxy=-4011360.603874112&scale=288895.277144&dpi=96&width=960&height=540&opacity=1&imagetype=image%2Fpng' > map_1_layer.png |
Output:
Note |
---|
Producing a single map image by combining a number of map images sourced from multiple map engines is a resource-intensive process. Where Weave application's resources are constrained, this approach is not recommended for implementing live map clients. Instead it is recommended that images (with an opacity less than 1) are superimposed as separate layers at the client end. |
Output:
...