Uses d3-force
to disperse overlapping markers on a mapbox-gl
map.
Markers are tethered to their actual location, but have a collision force based on the radius of the icon. An additional force pulls icons towards their previous location (locations are calculated each time you move the map) to avoid markers jumping around excessively as they settle into different local minima on each re-draw.
https://api.tiles.mapbox.com/mapbox-gl-js/v0.36.0/mapbox-gl.js
https://cdn.jsdelivr.net/lodash/4.17.4/lodash.min.js
https://d3js.org/d3.v4.min.js