Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
quick map tile renderer for nodejs camp
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
naturalearthdata
public
.gitignore
README
package.json
server.js
utils.js

README

This is an extremely naive proof-of-concept. It will render polygons and lines
from GeoJSON files into 256x256px mercator tiles suitable for overlaying on
Google Maps (or Bing Maps, MapQuest, Yahoo Maps, OpenLayers or Tile5 or 
Polymaps or Modest Maps).

There is no spatial indexing so every feature is drawn for every tile.

Node.js is single-threaded so without workers or child processes this can
only render one tile at a time. Go ahead, laugh.

Data is loaded from GeoJSON files so large data sources aren't possible
(v8 doesn't like evaling or JSON.parsing 100MB files)

I'm experimenting with simple caching to disk which currently seems to
break (but not straight away). Contributions welcome!

It would probably tidy this up a lot to factor out the rendering into its 
own reusable file and handle URL matching, static files etc with Connect 
or Express.

For reasons that aren't entirely clear to me, I didn't use my existing
javascript canvas map rendering code [1]. It would be nice to integrate these
two projects and have some code that could work on client or server depending 
on your needs. My hacky JS shapefile project [2] might also be relevant, there
are a few more canvas rendering ideas in there.

1. https://github.com/RandomEtc/js-vector-maps
2. https://github.com/RandomEtc/shapefile-js 

This is the first time I've used npm to manage a project, it's not published 
yet though, I'm still digesting everything it can do:
http://blog.izs.me/post/1675072029/10-cool-things-you-probably-didnt-realize-npm-could-do

Something went wrong with that request. Please try again.