|
| 1 | +## Base URL |
| 2 | + |
| 3 | +The base URL of the static maps API is: |
| 4 | + |
| 5 | +``` |
| 6 | +https://atlas.p3k.io/map/img |
| 7 | +``` |
| 8 | + |
| 9 | +You can run your own instance of this for better performance. |
| 10 | + |
| 11 | + |
| 12 | +## Parameters |
| 13 | + |
| 14 | +Parameters can be included in either the query string or in the POST body. |
| 15 | + |
| 16 | +* `zoom` - optional - Set the zoom level for the map. If not specified, a zoom level will be chosen that contains all markers on the map. |
| 17 | +* `maxzoom` - optional - When a zoom level is chosen automatically, this sets an upper limit on the zoom level that will be chosen. Useful if you know your basemaps don't have imagery past a certain zoom level. |
| 18 | +* `width` - default 300 - Width in pixels of the final image |
| 19 | +* `height` - default 300 - Height in pixels of the final image |
| 20 | +* `basemap` - default "streets" - Select the basemap |
| 21 | + * `streets` - Default [Esri street basemap](http://www.arcgis.com/home/webmap/viewer.html?webmap=7990d7ea55204450b8110d57e20c99ab) |
| 22 | + * `satellite` - Esri's [satellite basemap](http://www.arcgis.com/home/webmap/viewer.html?webmap=d802f08316e84c6592ef681c50178f17¢er=-71.055499,42.364247&level=15) |
| 23 | + * `hybrid` - Satellite basemap with labels |
| 24 | + * `topo` - Esri [topographic map](http://www.arcgis.com/home/webmap/viewer.html?webmap=a72b0766aea04b48bf7a0e8c27ccc007) |
| 25 | + * `gray` - Esri gray canvas with labels |
| 26 | + * `gray-background` - Esri [gray canvas](http://www.arcgis.com/home/webmap/viewer.html?webmap=8b3d38c0819547faa83f7b7aca80bd76) without labels |
| 27 | + * `oceans` - Esri [ocean basemap](http://www.arcgis.com/home/webmap/viewer.html?webmap=5ae9e138a17842688b0b79283a4353f6¢er=-122.255816,36.573652&level=8) |
| 28 | + * `national-geographic` - [National Geographic basemap](http://www.arcgis.com/home/webmap/viewer.html?webmap=d94dcdbe78e141c2b2d3a91d5ca8b9c9) |
| 29 | + * `osm` - [Open Street Map](http://www.openstreetmap.org/) |
| 30 | + * `stamen-toner` - [Stamen Toner](http://maps.stamen.com/toner/) black and white map with labels |
| 31 | + * `stamen-toner-background` - [Stamen Toner](http://maps.stamen.com/toner-background/) map without labels |
| 32 | + * `stamen-toner-lite` - [Stamen Toner Light](http://maps.stamen.com/toner-lite/) with labels |
| 33 | + * `stamen-terrain` - [Stamen Terrain](http://maps.stamen.com/terrain/) with labels |
| 34 | + * `stamen-terrain-background` - [Stamen Terrain](http://maps.stamen.com/terrain-background/) without labels |
| 35 | + * `stamen-watercolor` - [Stamen Watercolor](http://maps.stamen.com/watercolor/) |
| 36 | +* `tileurl` - To use other map tiles, you can provide the tile URL pattern. Make sure to include the literal strings `{x}` `{y}` `{z}` in the URL which will be replaced with the appropriate tile number when generating the map |
| 37 | +* `attribution` - default `none` - `none | esri | mapbox` - If you add attribution on the image in some other way, you can set this to "none", otherwise you can include the default esri or mapbox attributions |
| 38 | +* `latitude` - optional - Latitude to center the map at. Not needed if using the location parameter, or if specifying one or more markers. |
| 39 | +* `longitude` - optional - Longitude to center the map at. |
| 40 | +* `location` - optional - Free-form text that will be geocoded to center the map. Not needed if specifying a location with the latitude and longitude parameters, or if a marker is specified. |
| 41 | +* `marker[]` - Specify one or more markers to overlay on the map. Parameters are specified as: `key:value;`. See below for the full list of parameters. |
| 42 | +* `path[]` - Specify one or more paths to draw on the map. See below for the full list of parameters to draw a path. |
| 43 | + |
| 44 | +## Markers |
| 45 | + |
| 46 | +* `location` - Free-form text that will be geocoded to place the pin |
| 47 | +* `lat` - If a `location` is not provided, you can specify the location with the `lat` and `lng` parameters. |
| 48 | +* `lng` - See above |
| 49 | +* `icon` - Icon to use for the marker. Must choose one of the icons provided in this library, or specify a full URL to a png image. If an invalid icon is specified, the marker will not be rendered. |
| 50 | + |
| 51 | + |
| 52 | +### Built-In Marker Images |
| 53 | + |
| 54 | +*  `dot-large-blue` |
| 55 | +*  `dot-large-gray` |
| 56 | +*  `dot-large-green` |
| 57 | +*  `dot-large-orange` |
| 58 | +*  `dot-large-pink` |
| 59 | +*  `dot-large-purple` |
| 60 | +*  `dot-large-red` |
| 61 | +*  `dot-large-yellow` |
| 62 | +*  `dot-small-blue` |
| 63 | +*  `dot-small-gray` |
| 64 | +*  `dot-small-green` |
| 65 | +*  `dot-small-orange` |
| 66 | +*  `dot-small-pink` |
| 67 | +*  `dot-small-purple` |
| 68 | +*  `dot-small-red` |
| 69 | +*  `dot-small-yellow` |
| 70 | +*  `fb` |
| 71 | +*  `google` |
| 72 | +*  `large-blue-blank` |
| 73 | +*  `large-blue-cutout` |
| 74 | +*  `large-gray-blank` |
| 75 | +*  `large-gray-cutout` |
| 76 | +*  `large-gray-user` |
| 77 | +*  `large-green-blank` |
| 78 | +*  `large-green-cutout` |
| 79 | +*  `large-orange-blank` |
| 80 | +*  `large-orange-cutout` |
| 81 | +*  `large-pink-blank` |
| 82 | +*  `large-pink-cutout` |
| 83 | +*  `large-purple-blank` |
| 84 | +*  `large-purple-cutout` |
| 85 | +*  `large-red-blank` |
| 86 | +*  `large-red-cutout` |
| 87 | +*  `large-yellow-blank` |
| 88 | +*  `large-yellow-cutout` |
| 89 | +*  `large-yellow-message` |
| 90 | +*  `large-yellow-user` |
| 91 | +*  `small-blue-blank` |
| 92 | +*  `small-blue-cutout` |
| 93 | +*  `small-gray-blank` |
| 94 | +*  `small-gray-cutout` |
| 95 | +*  `small-gray-message` |
| 96 | +*  `small-gray-user` |
| 97 | +*  `small-green-blank` |
| 98 | +*  `small-green-cutout` |
| 99 | +*  `small-green-user` |
| 100 | +*  `small-orange-blank` |
| 101 | +*  `small-orange-cutout` |
| 102 | +*  `small-pink-blank` |
| 103 | +*  `small-pink-cutout` |
| 104 | +*  `small-pink-user` |
| 105 | +*  `small-purple-blank` |
| 106 | +*  `small-purple-cutout` |
| 107 | +*  `small-red-blank` |
| 108 | +*  `small-red-cutout` |
| 109 | +*  `small-yellow-blank` |
| 110 | +*  `small-yellow-cutout` |
| 111 | +*  `small-yellow-user` |
| 112 | + |
| 113 | +## Paths |
| 114 | + |
| 115 | +A path is specified as a list of longitude and latitudes, as well as optional properties to specify the weight and color of the path. |
| 116 | + |
| 117 | +The coordinates of the path are the first value of the property, specified as a list of coordinates similar to GeoJSON. |
| 118 | + |
| 119 | +### Examples |
| 120 | + |
| 121 | +Simple path with default color and weight. |
| 122 | + |
| 123 | +``` |
| 124 | +path[]=[-122.651082,45.508543],[-122.653617,45.506468],[-122.654183,45.506756] |
| 125 | +``` |
| 126 | + |
| 127 | +Specifying the color and weight of the path. |
| 128 | + |
| 129 | +``` |
| 130 | +path[]=[-122.651082,45.508543],[-122.653617,45.506468],[-122.654183,45.506756];weight:6;color:0033ff |
| 131 | +``` |
| 132 | + |
| 133 | + |
| 134 | +## Examples |
| 135 | + |
| 136 | +### Simple map centered at a location |
| 137 | + |
| 138 | +``` |
| 139 | +https://atlas.p3k.io/map/img?basemap=gray&width=400&height=240&zoom=14&latitude=45.5165&longitude=-122.6764 |
| 140 | +``` |
| 141 | + |
| 142 | +<img src="/map/img?basemap=gray&width=400&height=240&zoom=14&latitude=45.5165&longitude=-122.6764"> |
| 143 | + |
| 144 | +### Map with a marker centered at an address |
| 145 | + |
| 146 | +``` |
| 147 | +https://atlas.p3k.io/map/img?marker[]=location:920%20SW%203rd%20Ave,%20Portland,%20OR;icon:small-blue-cutout&basemap=gray&width=400&height=240&zoom=14 |
| 148 | +``` |
| 149 | + |
| 150 | +<img src="/map/img?marker[]=location:920%20SW%203rd%20Ave,%20Portland,%20OR;icon:small-blue-cutout&basemap=gray&width=400&height=240&zoom=14"> |
0 commit comments