New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clustering GeoJson Points #415
Comments
Hi, I've made a little hack in the index.html and it seems to do the tricks. EDIT: Now, need to add a listener to remove cluster on geojson layer remove <script src="lib/js/leaflet/dist/leaflet.js" type="text/javascript"></script>
<script src="lib/js/leaflet.markercluster/dist/leaflet.markercluster.js" type="text/javascript"></script>
<script>
L.GeoJSON = L.GeoJSON.extend({
addTo: function(map) {
var markers = new L.MarkerClusterGroup({
spiderfyOnMaxZoom: false,
showCoverageOnHover: false,
zoomToBoundsOnClick: false,
disableClusteringAtZoom: 19
});
map.addLayer(markers);
markers.addLayer(this);
return this;
}
});
L.geoJson = function (geojson, options) {
return new L.GeoJSON(geojson, options);
};
</script> |
Complete hack with remove listener.
|
Nice workaround! |
this saved me some time! thanks |
👍 |
Someone want to work on flushing this out into the geojson directive? |
I'm still learning, but I'll take a crack at it this weekend. |
Very useful, thanks! |
This issue was moved to angular-ui/ui-leaflet#30 |
I'm going to rework&redesign angular-leaflet-directive to be compatible with Leaflet v1.0. It will mantain almost all its functionality, and will be compatible with the current features of the directive, but I must start from a fresh point, so I'm going to close this issue. If you think it must be worked with the new version, please reopen it. |
Is there an easy way to use the clustering plugin when using geojson points instead of markers?
The text was updated successfully, but these errors were encountered: