D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
jczaplew
Full window
Github gist
Supercluser + tilestrata + Mapbox GL JS
<!DOCTYPE html> <html> <head> <meta charset='utf-8' /> <title></title> <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> <script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.js'></script> <link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.css' rel='stylesheet' /> <style> body { margin:0; padding:0; } #map { position:absolute; top:0; bottom:0; width:100%; } </style> </head> <body> <div id='map'></div> <script> mapboxgl.accessToken = 'pk.eyJ1IjoiamN6YXBsZXdza2kiLCJhIjoiWnQxSC01USJ9.oleZzfREJUKAK1TMeCD0bg'; var map = new mapboxgl.Map({ container: 'map', style: 'mapbox://styles/mapbox/streets-v9', center: [-106, 51], zoom: 3 }) map.on('load', () => { this.map.addSource('clusters', { "type": "vector", "tiles": ["https://localhost:7171/points/{z}/{x}/{y}/tile.mvt"], "tileSize": 512 }) this.map.addLayer({ "id": "cluster-layer", "type": "circle", "source": "clusters", "source-layer": "clusters", "paint": { 'circle-color': '#08519c', 'circle-radius': 2 } }) }) </script> </body> </html>
https://api.tiles.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.js