Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update map to use mapbox-gl-js instead of mapbox.js #229

Open
mapsam opened this issue Jan 16, 2019 · 0 comments
Open

Update map to use mapbox-gl-js instead of mapbox.js #229

mapsam opened this issue Jan 16, 2019 · 0 comments

Comments

@mapsam
Copy link
Member

mapsam commented Jan 16, 2019

The maps are using an old mapbox.js library and raster tiles. Let's move over to using mapbox-gl-js instead. This would be a good little hack project for anyone interested in learning about the website!

How are the maps made now?

Each layout includes a div with a special map id. Here's the example of a meeting page map element:

<div id="map"
  class="meeting-map map-marker"
  data-latitude="{{ page.lat }}"
  data-longitude="{{ page.lng }}"
  data-popup="{{ page.address }}"></div>

When the page is rendered, the following javascript is executed which searches for any instance of a map-marker class and builds it with the subsequent functions.

How to do this with mapbox-gl-js

Using GL JS should be relatively similar, with the key differences being how markers are created and added to the map context. Here's the marker documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant