Use URL parameters to generate a map with markers, using Leaflet and OpenStreetMap
Visit it here: https://map.simonwillison.net/
Read about the project's background in A tiny web app to create images from OpenStreetMap maps
To center the map on a specific location, add ?center=lat,lon
. To set the zoom, use ?zoom=8
.
As an alternative to a latitude and longitude you can use ?q=
to provide text which will be looked up against the OpenStreetMap Nominatim API. The map will then zoom to the best available bounding box for the first matching result:
If you add a &zoom=
to that the zoom you specify will be used instead of the automatic zoom calculated using the bounding box:
To add markers to the map, use ?marker=lat,lon
. You can pass this multiple times:
You can use this tool to create static map images using shot-scraper. For example:
shot-scraper 'https://map.simonwillison.net/?center=51.49,0&zoom=8&marker=51.49,0&marker=51.3,0.2' \
--retina --width 600 --height 400 --wait 3000
Produces this image: