Skip to content

Commit

Permalink
fix(map): observe cluster_radius map configuration from API
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxpiper committed Jun 18, 2022
1 parent bbc06ec commit b596dc3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion legacy/app/common/services/maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ function Maps(ConfigEndpoint, L, _, CONST) {
layers: [L.tileLayer(defaultLayer.url, defaultLayer.layerOptions)],
center: [config.default_view.lat, config.default_view.lon],
zoom: config.default_view.zoom,
clustering: config.clustering
clustering: config.clustering,
cluster_radius: Number(config.cluster_radius || 50)
});
});
}
Expand Down
4 changes: 3 additions & 1 deletion legacy/app/map/post-view-map.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ function PostViewMap(PostEndpoint, Maps, _, PostFilters, L, $q, $rootScope, $com

if (map.options.clustering) {

markers = markers ? markers : L.markerClusterGroup();
markers = markers ? markers : L.markerClusterGroup({
maxClusterRadius: map.options.cluster_radius
});
// This has to be done individually.
// Using clusterLayer.addLayers() breaks the clustering.
// Need to investigate as this should have been fixing in v1.0.0
Expand Down

0 comments on commit b596dc3

Please sign in to comment.