jekyll-maps
jekyll-maps copied to clipboard
WIP: Add Mapbox
This PR is linked to issue #27 . The engine Mapbox GL JS to display vector maps allows to use OSM data from various sources (cloud or selfhosted).
The current development effort is to make mapbox working as good as Google. The next step is to make it also compatible/configure with https://openmaptiles.com/ or https://cloud.maptiler.com/
Some design decisions are required:
- Should the switch between Google and Mapbox be a different Jekyll Tag or should it rather be a (global) configuration option?
- How could the code be restructured to achive less duplication? Mapbox examples all use GeoJSON for data. I think it could be interesting to also make the Google Maps part use internally the structure of GeoJSON for lists of markers.
hi @rriemann thanks for this!
Should the switch between Google and Mapbox be a different Jekyll Tag or should it rather be a (global) configuration option? I think it should be a new tag, it's a bit more flexible
How could the code be restructured to achive less duplication? Mapbox examples all use GeoJSON for data. I think it could be interesting to also make the Google Maps part use internally the structure of GeoJSON for lists of markers.
I'm not familiar with GeoJSON. Would it require users to change their data? or only changes in the internals of the library?
This is the current state of art:

The code is quite messy. I have not yet attempted to change Google Maps code to allow for more code sharing.
I also feel that it would be nice if GeoJSON (https://geojson.org/) would be accepted in data files and could be piped to Mapbox without alteration.
GeoJSON is an industry standard and has many tools, such as http://geojson.io/ .
We could consider to only reformat coordinate elements if their hash does not contain a type attribute, that is required by GeoJSON.
In the last commits, I changed the design of clustered markers to resemble the Google Maps version.

The code is quite messy. I have not yet attempted to change Google Maps code to allow for more code sharing.
I also feel that it would be nice if GeoJSON (https://geojson.org/) would be accepted in data files and could be piped to Mapbox without alteration.
GeoJSON is an industry standard and has many tools, such as http://geojson.io/ .
We could consider to only reformat coordinate elements if their hash does not contain a type attribute, that is required by GeoJSON.
Dear @ayastreb , can we please agree on a strategy how mapbox can become part of jekyll-maps?
I found that Google Maps has also support to load GeoJSON.
@ayastreb Any chance this could get merged and supported? This reduces the cost to host by a lot. The Google Maps API costs $7 per 1000 uses of the javascript API
Dear @ajsnyde ,
I fear my code is not well maintained and I have 2 branches with no clear view on which one should be merged. I tried to come up with a solution that could consume and display on the map arbitrary GEOJSON.
Furthermore, we are now more advanced than in 2019. Mapbox got forked and we have now MapLibre as well. mbtiles are difficult to host and the one-file-fits-all format pmtiles was introduced.
So my personal priority would be to support first MapLibre with pmtiles and add later Mapbox and mbtiles again. However, not sure if I have time to work on it.
Dear all,
I have published a pre-release of jekyll-maplibre that is somewhat a fork with many parts rewritten/cleaned.
https://github.com/rriemann/jekyll-maplibre