3 ms·
If you want to create your own map tiles in advance and show them using JavaScript library - use TileMill [1] and Leaflet [2]. Both are excellent and very well
by azov 12y ago
If you want to create your own map tiles in advance and show them using JavaScript library - use TileMill [1] and Leaflet [2]. Both are excellent and very well documented.
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.json 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/ https://www.mapbox.com/tilemill/
[2] Leaflet - http://leafletjs.com/ http://leafletjs.com/
[3] MapboxGL - https://www.mapbox.com/mapbox-gl/ https://www.mapbox.com/mapbox-gl/
- jeroenvisser101 12y agoIf someone is going to use different domains for their tiles, they might want to do something with hashes of the tile id/name to get a subdomain, in order to preserve caching.