mozilla/ichnaea

Convert from mapbox.js to mapbox GL JS

Closed this issue · 2 comments

mapbox.js is a tile-based implementation of Mapbox, based on Leaflet. It is deprecated for Mapbox GL JS, which supports vector and raster tiles. There is a transition guide.

The mapbox.js build has these warnings:

npm WARN deprecated phantomjs-prebuilt@2.1.16: this package is now deprecated
npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported

This may require a change to contribution tile generation (see issue #840), to instead return GeoJSON representing the contributions.

I've switched to mapbox-gl, with the same functions as mapbox.js. If I try to build mapbox-gl, I get lots of deprecation warnings, but it is not necessary to do that, so I can ignore the mapbox build process for now.

There's a 2.0.0 release that drops IE 11 support and uses modern JavaScript and has a new license. I was unable to minify the code with uglifyjs, which isn't a deal breaker, but the 1.3.0 installed more smoothly, so why jump to upgrade?

I looked at some of the options, such as heat maps, for rendering contributions. However, we have so many points of data, I think the raster tiles may actually be less data than the GeoJSON version. They also work just fine with mapbox-gl. For issue #840, we should continue generating tiles.

Mapbox-GL deployed, working in production at https://location.services.mozilla.com/map