gorshkovaea
gorshkovaea

Reputation: 1

Create multiple groups of clusters of different colors

It is necessary that several clusters of groups of markers have different colors. For example, the gray markers are combined in grey circle - cluster, yellow - in yellow, and so on. Here

.marker-cluster-small {
background-color: rgba(181, 226, 140, 0.6);
}
.marker-cluster-small div {
background-color: rgba(110, 204, 57, 0.6);
}

.marker-cluster-medium {
background-color: rgba(241, 211, 87, 0.6);
}
.marker-cluster-medium div {
background-color: rgba(240, 194, 12, 0.6);
}

.marker-cluster-large {
background-color: rgba(253, 156, 115, 0.6);
}
.marker-cluster-large div {
background-color: rgba(241, 128, 23, 0.6);
}

Specifies the colors for all the clusters. But how to make different colors for different clusters? For example,

var groupGrey = new L.MarkerClusterGroup();
var groupRed = new L.MarkerClusterGroup();
var groupYellow = new L.MarkerClusterGroup();
var groupBlue = new L.MarkerClusterGroup();

Upvotes: 0

Views: 158

Answers (1)

ghybs
ghybs

Reputation: 53185

See the iconCreateFunction option and its default implementation.

Upvotes: 1

Related Questions