https://github.com/mapnik/node-mapnik-sample-code
Sample code demonstrating usage of node-mapnik
https://github.com/mapnik/node-mapnik-sample-code
Last synced: 11 months ago
JSON representation
Sample code demonstrating usage of node-mapnik
- Host: GitHub
- URL: https://github.com/mapnik/node-mapnik-sample-code
- Owner: mapnik
- Created: 2013-04-22T21:36:35.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2016-02-11T00:21:25.000Z (about 10 years ago)
- Last Synced: 2025-04-09T04:11:17.448Z (12 months ago)
- Language: JavaScript
- Homepage:
- Size: 799 KB
- Stars: 69
- Watchers: 8
- Forks: 33
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# node-mapnik examples
## Depends
- Node.js v0.10.x
- Mapnik node.js bindings (`node-mapnik`)
Install `node-mapnik` like:
npm install mapnik@latest
A few examples have other dependencies. Install all possible like:
npm install express generic-pool get
Examples are designed to be run from the root like:
node ./render/app.js ./stylesheet.xml map.png
Examples are arranged into topic directories:
* **render** - Simple map to image renderer example. Start here.
* **image** - Server that just responds with a single image.
* **tile** - Example tileservers. Also includes PostGIS example. (see for a fuller example with PostGIS)
* **wms** - Example WMS servers (see for a real WMS server)
* **memory_datasource** - rendering of native javascript objects using in memory features created up front
## Other files
* **utils** - helper methods
* **data** - world map shapefile used in examples
* **stylesheet.xml** - sample mapnik xml stylesheet
## Using examples
To run most examples, read the code then execute their app.js file.
In tile examples you can view the output in polymaps via tile/index.html