2

How to write OpenLayers code to create clusters from MVT (using 100k points)?

Because MVT file format saves disk space (90 % less than GeoJSON) and requires only 50 % RAM of browser.

Class hierarchy of mbtiles as vectortile:

ol.Map / layers: ol.layer.VectorTile / source: ol.source.VectorTile / format: ol.format.MVT

Class hierarchy of GeoJSON as cluster:

ol.Map / layers: ol.layer.Vector / source: ol.source.Cluster / source: ol.source.Vector / format: ol.format.GeoJSON

1

MVT as ol.layer.VectorTile should work using Mapbox supercluster.

Depending on your file size you could also go directly with geojson as it is shown in this Openlayers example.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.