MapCampaigner icon indicating copy to clipboard operation
MapCampaigner copied to clipboard

Update all maps to MapboxGL

Open russbiggs opened this issue 5 years ago • 3 comments

It looks like the maps on / and /create still use leaflet. campaign/{uuid} uses mapboxGL. Is it worth updating all the maps for consistency?

russbiggs avatar Oct 31 '19 00:10 russbiggs

@JorgeMartinezG @localjo @Eleonore9

russbiggs avatar Oct 31 '19 00:10 russbiggs

It looks like mapbox-gl is used in map.html, and the contents of map.html are injected into campaign_detail.html.

I think as we touch each page in the app and update it to use the new design, we could switch it to use mapbox-gl too. For now, I'll comment out the leaflet scripts in the new base template, and see if I can easily switch the user overview page to mapbox-gl while working on #752 . If we run into some leaflet code that is difficult to switch, we can uncomment the leaflet scripts.

localjo avatar Nov 04 '19 10:11 localjo

@localjo yes! In fact, I'm working on that map.html rendering from the backend, since it is needed for #724 .

You can check the changes here: https://github.com/hotosm/MapCampaigner/commit/e2c25797529550a26a3f4cfb350fc2351ac05053. I'll finish this and send the PR this week.

I think this is a starting point for removing the lambda rendering functions. Since map.html needs only the campaign geometry and the first type, we can send this from context dictionary and let Jinja render it in each request.

Let me know your opinion

JorgeMartinezG avatar Nov 04 '19 11:11 JorgeMartinezG