[GIS] Libraries to render vector-based maps in the browser

openstreetmapvectorvector-tilesweb serviceweb-mapping

Is there a open source JavaScript library like Leaflet or OpenLayers which can be used in a web or mobile application and loads vector-based maps instead of images? I only need the road information and some POIs.

The only library I found was polymaps – but still I would need a server or service which serves the vector SVG data (preferable from OpenStreetMap). Also there is the nice Android project called Mapsforge but I would need it for a web application or other mobile devices.

Best Answer

For just drawing vectors, Leaflet or OpenLayers will do just fine. Nothing new there.

For vector tiled maps (i.e different resolutions/levels of detail at different zoom levels), TileStache is a simple and good server. I have been using with lots of experiments with Polymaps (AFAIK, the only general-purpose working js tiled vector viewer). Some people have used OpenLayers for adding tiled vector support, but AFAIK, it has not been integrated to trunk in a year, so it probably won't in the near future for lack of interest.

TileStache (the server) itself is working very well. Nevertheless, I have found several bugs with Polymaps and since it is not being updated anymore (abandoned project), I cannot convince myself to use it in production (I'd have to maintain it myself... I can't justify it to myself just yet.)

My solution for me has been to write a custom OpenGL native vector renderer which is used in AmigoCloud. In fact, that is how all maps are rendered in our service. For that purpose, TileStache has delivered quite well.

You want to look at the TileStache Vector Provider. For examples on how to use it, you can look at a very basic vector test suite I wrote.

Sadly, I don't think Leaflet has support for tiled vectors.