Reputation: 51
I am trying to build a map-based web app using mapbox and leaflet.js.
I am loading around 300 markers into a featureLayer from a geoJSON file. This seems to work beautifully in every browser except internet explorer, which freezes for a good 10 seconds or so every time markers are loaded or filtered using featureLayer.setFilter. I have uploaded a demo of this here.
Locking at the IE performance analysis the culprit seems to be the 'addDoubleTapListener'. This seems to be a known issue (https://github.com/Leaflet/Leaflet/issues/4357), and the solutions suggest rolling back to leaflet 0.7.5, or using the 0.7.7.1 branch (which has a fix that reverts touch detection). I have tried both, and neither seem to have any effect on the issue. Upgrading to the leaflet 1.0.0-beta is also suggested, but this doesn't seem to be compatible with the current mapbox...
Any help with overcoming this issue would be much appreciated.
Upvotes: 3
Views: 1004
Reputation: 51
Ok the solution I found was to remove the following lines from leaflet-src.js 0.7.7.1:
if (L.Browser.touch && (type === 'dblclick') && this.addDoubleTapListener) {
this.addDoubleTapListener(obj, handler, id);
}
IE now loads the markers lightning fast and all of the functions appear to still be working in all the devices I tried. Not an ideal solution, but will serve as a stop-gap solution until Mapbox supports Leaflet 1.0.0.
Upvotes: 2