print-map
v0.2.1
Published
Send map data and get back an image/pdf
Downloads
5
Readme
print-map
Send map data and get back an image/pdf
Usage
npm install
npm start
Send a POST request to localhost:3000
with a 'Content-Type' of application/json
with the following body:
{
"view": {
"bounds": [
[40.712, -74.227],
[40.774, -74.125]
],
"latlng": [40.712, -74.227],
"zoom": 16
},
"attribution": "Hello :)"
}
Using via a GET request
If you want basic features, you can use a GET request instead, e.g. localhost:3000/?latlng=40.712,-74.227&zoom=16
Available Options
- latlng
- zoom
- size
Options
output
size
- string of the following format 'widthxheight', defaults to '800x600'.quality
- number from 0 - 100, defaults to 100.
view
bounds
- is an array of two arrays that hold lat, lng values, e.g.[[40.712, -74.227], [40.774, -74.125]]
, supersedeslatlng
+zoom
.latlng
- an array of lat, lng values, e.g.[40.712, -74.227]
, usually goes with thezoom
option.zoom
- an integer zoom value, defaults to10
.
baseMap
Currently a text value that defaults to http://{s}.tile.osm.org/{z}/{x}/{y}.png
.
geoJson
Accepts valid GeoJSON and draws it on the basemap.
attribution
Currently a text value that can contain HTML, and replaces the attribution on the map.
Passing false
will disable attribution.