Skip to content

Commit

Permalink
[DOC] Style cluster selected feature #1101
Browse files Browse the repository at this point in the history
  • Loading branch information
Viglino committed Sep 16, 2024
1 parent 36ca52a commit 230a369
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion examples/map/map.clustering.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ <h2>Select options:</h2>
source: clusterSource,
animationDuration: $("#animatecluster").prop('checked') ? 700:0,
// Cluster style
style: getStyle
style: getStyle,
});
map.addLayer(clusterLayer);
// add 2000 features
Expand All @@ -205,6 +205,14 @@ <h2>Select options:</h2>
// Feature style when it springs apart
featureStyle: featureStyle,
selectCluster: false, // disable cluster selection
// Style the selection
style: function(f) {
var s = getStyle(f);
s[0] = s[0].clone();
s[0].getImage().setScale(2)
s[0].setZIndex(1)
return s;
}
});
map.addInteraction(selectCluster);

Expand Down

0 comments on commit 230a369

Please sign in to comment.