13 REST for Tiles
In some circumstances you may wish to return a static image of a portion of a map rather than a slippy map that can be zoomed and dragged (such as those built in the preceding sections). The process of specifying a tile is similar to that of building a regular map, but instead of ending the path with an optional query string (for zoom, size, centerpoint, etc.) you specify (non-optionally) the type, zoom, and coordinates as a continuation of the path.
The coordinate and zoom specification for tiles is completely different than for maps. A full explanation is beyond the scope of this document (see http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames) but the basic concepts are as follows:
Note: An alternative approach to generating a static (non-slippy) map tile, using a query string with zoom, latitude, and longitude, is the Mapfluence static Map (see /static at http://developer.urbanmapping.com/docs/mapfluence/rest/2.0/reference/tile/static-map).
The following steps illustrate how to specify a tile using a named layer (the base map is not specified so the default Mapfluence base map will be used):
1. Start with the host, version, API key, and endpoint. Since we are making a tile rather than a map, the endpoint will be tile:
2. Add a layer definition (separating each property value pair with a pipe) for a named layer, in this case the layer that shows all features of a Mapfluence map (essentially the base map, but used as a layer):
3. Add a definition of the desired zoom:
4. Add a definition of the desired coordinates:
5. Put it all together and you have the complete REST path for the tile:
To experiment with different tiles, open a browser window, paste the URL into the address field, and change the layer, zoom, and/or coordinates values. Here's the tile that is returned from the above URL:
Note: For complete details on the purpose and valid values of tile properties, both required and optional, refer to the /tile page of the Mapfluence REST API Reference at http://developer.urbanmapping.com/docs/mapfluence/rest/2.0/reference/tile/Tile.