Hey all,
I'm working on a giant map collection and we have geojson polygons and multipolygons that we want to show instead of markers and marker cluster groups. The good thing is that this all currently works out of the box. The only problem is that the Zoom level logic is missing for polygons.
We're joining AllMaps so we expect to have lots of georeferenced content like this. Can we add a tiny bit of code so zoom level works:
geojsonLayer.on('data:loaded', function () {
if (!cluster_added) {
markers.addLayer(geojsonLayer);
map.addLayer(markers);
// Use geojsonLayer bounds so that Zoom level works for both points and polygons
if (geojsonLayer.getBounds().isValid()) {
map.fitBounds(geojsonLayer.getBounds());
}
cluster_added = true;
}
});
Hey all,
I'm working on a giant map collection and we have geojson polygons and multipolygons that we want to show instead of markers and marker cluster groups. The good thing is that this all currently works out of the box. The only problem is that the Zoom level logic is missing for polygons.
We're joining AllMaps so we expect to have lots of georeferenced content like this. Can we add a tiny bit of code so zoom level works: