This pretends to be inspired in Google(c) static map service. But made using open source technologies.
You can find osm-static-maps running in heroku
Here you have a demo
And a dynamic version of the demo, for testing purposes.
As a first approach, the service can render a geoJSON in a map, returning a PNG and you can determine also an optional height and width in pixels.
Parameters that can be used (some can be passed to the app server as GET query params)
| Parameter | Description |
|---|---|
| geojson | geojson object to be rendered in the map |
| height | height in pixels of the returned img |
| width | height in pixels of the returned img |
| tileserverUrl | url of a tileserver (default is official osm: 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png') |
| more things | to be added soon! |
-shell-
npm install osm-static-maps
-index.js-
osmsm = require('osm-static-maps');
osmsm({geojson: geojson})
.then(function(imageStream) { ... })
.catch(function(error) { ... })
alternatively you can download the code, run the sample server and use it standalone (see How to run)
lastly you can use the heroku-hosted alternative directly here
nodejs is a prerequisite, please install it before this from here https://nodejs.org/
git clone [email protected]:jperelli/osm-static-maps.git
cd osm-static-maps
npm install
npm start
Note that you can use yarn if you like it more than npm
To develop use
npm run dev # or just 'yarn dev'
Credits go to the outstanding, everlasting, fascinating opensource. Specially to
Content type
Image
Digest
Size
388.1 MB
Last updated
over 7 years ago
docker pull cosme/osm-static-maps