Ask HN: Are there any JavaScript libraries for generating maps?
Specifically, I'd love to be able to pass in geocoded location boundaries and color styles to generate a map of the chosen color over the chosen area. Google maps is obviously great for showing navigational data or directions, but I'm thinking along the lines of something more graphic.
Does anyone have any thoughts along these lines?
22 comments
[ 342 ms ] story [ 364 ms ] threadhttp://cartodb.com/
Regards.
https://www.mapbox.com/developers/
http://leafletjs.com/
http://openlayers.org
If you just want to produce choropleths, you can try Leaflet. Other options include d3.js and kartograph.
http://kartograph.org/
http://d3js.org/
If you want to go a bit further, stamen mapstack does some cool stuff: http://mapstack.stamen.com/
http://bost.ocks.org/mike/map/
And here’s a subsequent tutorial for visualizing geographic data:
http://bost.ocks.org/mike/bubble-map/
Thanks for your hard work Mike!!!
http://www.tnoda.com/blog/2013-12-07
Mapbox is a great alternative for stylish maps. Their JS library is built off of Leaflet which allows you to change the tileset at a later date.
http://gmt.soest.hawaii.edu/
http://jvectormap.com/
I'm a fan of datamaps, https://datamaps.github.io/, for doing some quick and getting decent output.
To create the whole map on the fly using JavaScript - try mapbox-gl.js [3]. You should be able to pass your location boundaries via mapboxgl.GeoJSONSource (and then you probably don't even need MapBox API key - haven't tried it, though) and style it like this: https://www.mapbox.com/mapbox-gl-styles/styles/bright-v4.jso...
PS. If you decide to host your own tiles - remember that browsers limit the number of connections to each domain. Your map will load much faster if you serve tiles from several different domains, e.g. tiles1.example.com, tiles2.example.com, etc.
[1] TileMill - https://www.mapbox.com/tilemill/
[2] Leaflet - http://leafletjs.com/
[3] MapboxGL - https://www.mapbox.com/mapbox-gl/
https://github.com/mathisonian/lightning
For those wanting an example:
http://kut.org/term/google-fiber
Basically just a grey/white map showing important navigational details like roads and rivers, with different color sections overlaying it.
How did you do it?
Did we help?
http://www.hackertoolbox.com/tags/map