1. List Maps
  2. Get Map
  3. Create Map
  4. Update Map
  5. Delete Map
  6. Render Map
  7. Tiles
  8. List Map Layers
  9. Delete Map Cache

/maps

List Maps

URL:  /maps 

Method: GET

Protocol: HTTP, HTTPS

Parameters:

  • type – private, public or shared (default: all accessible maps)

Returns one of:

  • 200 (OK) + collection of maps
  • 404 (Not Found)

Example:

$ curl -X GET http://api.giscloud.com/1/maps

<maps>
  <map>
    <id>2</id>
    <name>test_map_2</name>
    <description/>
    <owner>1</owner>
    <active>1</active>
    <copyright/>
    <proj4>+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs</proj4>
    <units>meter</units>
    <maxzoom>1000</maxzoom>
    <share>t</share>
    <mobileacess>f</mobileacess>
    <bgcolor/>
    <wmsaccess/>
    <modified>1312718747</modified>
    <accessed>1307483018</accessed>
    <created>1304248698</created>
  </map>
</maps>

Get Map

URL:  /maps/{id} 

Method: GET

Protocol: HTTP, HTTPS

Parameters: id – map to be retrieved

Example:

$ curl -X GET http://api.giscloud.com/1/maps/1

<map>
  <id>2</id>
  <name>test_map_2</name>
  <owner>1</owner>
  ...
 </map>

Create Map

URL:  /maps 

Method: POST

Protocol: HTTPS

Returns:

  • 201 + a URL to the newly created resource in the Location header of the response

Example:

curl -X POST https://api.giscloud.com/1/maps

curl -H "Content-Type: application/json" -X POST -d '{"name": "<MAP_NAME>"}' "https://api.giscloud.com/1/maps.json?perpage=10&api_key=<API_KEY>"

Below you can see how to add a basemap.

curl -H "Content-Type: application/json" -X POST -d '{"mid": <MAP_ID>,"name":"<BASEMAP_NAME>","type":"tile","source":"{\"type\":\"tile\",\"src\":\"mapquest-osm\"}"}' "https://api.giscloud.com/1/layers.json?api_key=<API_KEY>" -v

Update Map

URL:  /maps/{id} 

Method: PUT

Protocol: HTTPS

Returns one of:

  • 204 if successful
  • 404 if the resource wasn’t found

Delete Map

URL:  /maps/{id} 

Method: DELETE

Protocol: HTTPS

Parameters:

  • id – map to be deleted

Returns one of:

  • 204 if successful
  • 404 if the resource wasn’t found

Render Map

Produces map rendered as image (png,jpg) or as interactive map in an iframe.

URL:  /maps/{id}/render.{format} 

Method: GET

Protocol: HTTP, HTTPS

Parameters: 

  • id – map to be rendered

Query string parameters – render an image of a map:

parameter default value possible value description
format png or jpg Using this parameter you can choose image format, it can be in JPG or PNG.
phender phender (true) Using this parameter you can set rendering engine.
timestamp number, example: 1446645385 Date/time of creation or modification.
width 256 number, example: 150 Image width in pixels.
height 256 number, example: 250 Image height in pixels.
layerlist false layerlist (true) Set layerlist to visible.
bounds null example: bounds=1674429.541,5684163.171,
1876223.296,5816093.482
Set bounds of rendered map.

Query string parameters – create an interactive map:

parameter default value possible value description
format iframe Using this parameter you are creating an interactive map.
toolbar false toolbar (true) Set toolbar to visible.
layerlist false layerlist (true) Set layerlist to visible.
popups false popups (true) Enable info popups in iframe when feature is selected.

Returns:

  • 200 – binary image or html

Example:

$curl -X GET http://api.giscloud.com/1/maps/4/render.png?width=64&height=64&invalidate=1

...binary...

$ curl -X GET http://api.giscloud.com/1/maps/4/render.iframe?height=300

<iframe src="http://beta.giscloud.com/embed/?map=4" width="100%" height="300" frameborder="0"></iframe>

List Map Layers

URL:  /maps/{id}/layers 

List layers in a map, also alternative entry point to /layers.

Take a look at layers below.

Delete Map Cache

URL:  /map_cache/{id}/{init}?layers=layer1,layer2... 

Protocol: HTTP, HTTPS

Method: DELETE

Returns:

  • 204 if successful
  • 404 if the resource wasn’t found

This operation is required in order for the GIS Cloud application to see modifications to the map made through the API. Currently, the init parameter must have the value of 2.

You can choose to delete cache for select layers by adding the layers parameter and setting layer ids.