A containerized web version for staticmaps with express.
To get a static map from the endpoint /staticmaps
several prameters have to be provided.
center
- Center coordinates of the map in the formatlon, lat
zoom
- Set the zoom level for the map.width
- default300
- Width in pixels of the final imageheight
- default300
- Height in pixels of the final imageformat
- defaultpng
(e.g.png
,jpg
orwebp
)
For different basemaps docker-staticmaps is using exisiting tile-services from various providers. Be sure to check their Terms of Use for your use case or use a custom
tileserver with the tileUrl
parameter!
basemap
- default "osm" - Select the basemaposm
- default - Open Street Mapstreets
- Default Esri street basemapsatellite
- Esri's satellite basemaphybrid
- Satellite basemap with labelstopo
- Esri topographic mapgray
- Esri gray canvas with labelsgray-background
- Esri gray canvas without labelsoceans
- Esri ocean basemapnational-geographic
- National Geographic basemapotm
- OpenTopoMapstamen-toner
- Stamen Toner black and white map with labelsstamen-toner-background
- Stamen Toner map without labelsstamen-toner-lite
- Stamen Toner Light with labelsstamen-terrain
- Stamen Terrain with labelsstamen-terrain-background
- Stamen Terrain without labelsstamen-watercolor
- Stamen Watercolorcarto-light
- Carto Free usage for up to 75,000 mapviews per month, non-commercial services only.carto-dark
- Carto Free usage for up to 75,000 mapviews per month, non-commercial services only.carto-voyager
- Carto Free usage for up to 75,000 mapviews per month, non-commercial services only.custom
- Pass through the tile URL using parametertileurl
with Docker
docker run -d --name='static-maps-api' -p '3003:3000/tcp' 'mxdcodes/docker-staticmaps:latest'
with Node.js
git clone https://github.com/dietrichmax/docker-staticmaps
npm i
npm run start
http://localhost:3000/staticmaps?width=300&height=300¢er=-119.49280,37.81084&zoom=9&format=png
http://localhost:3000/staticmaps?width=500&height=500¢er=-73.99515,40.76761&zoom=10&format=webp&basemap=carto-voyager
http://localhost:3000/staticmaps?width=500&height=500¢er=-73.99515,40.76761&zoom=10&format=png&tileUrl=https://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}