MarkerLabel interface
December 14, 2018 · View on GitHub
let labelOptions: MarkerLabel = {
bold: true,
fontSize: 15,
color: "white",
italic: true
};
let clusterIcons: MarkerClusterIcon[] = [
{min: 2, max: 100, url: "./assets/blue.png", anchor: {x: 16, y: 16}, label: labelOptions},
{min: 100, max: 1000, url: "./assets/yellow.png", anchor: {x: 16, y: 16}, label: labelOptions},
{min: 1000, max: 2000, url: "./assets/purple.png", anchor: {x: 24, y: 24}, label: labelOptions},
{min: 2000, url: "./assets/red.png",anchor: {x: 32,y: 32}, label: labelOptions}
];
let options: MarkerClusterOptions = {
markers: dummyData(),
icons: clusterIcons,
boundsDraw: true,
maxZoomLevel: 15
};
this.map.addMarkerCluster(options).then((markerCluster: MarkerCluster) => {
...
});
Interface members
| Params | Type | Details |
|---|---|---|
| markers | MarkerOptions[] | Position list [ {title: "store A", position: {lat: ..., lng: ...}}, {title: "store B", position: {lat: ..., lng: ...}}, {title: "store C", position: {lat: ..., lng: ...}} ] |
| icons | MarkerClusterIcon[] | Conditions of clustering [ {icon: "assets/small.png", min: 2, max: 10}, {icon: "assets/middle.png", min: 11, max: 30}, {icon: "assets/large.png", min: 31} ] |
| boundsDraw | boolean | (optional)Draw a rectangle that contains all locations of clustered when you tap on a cluster marker.(default: true) |
| maxZoomLevel | boolean | (optional)Maximum zoom level of clustering(default: 15, max: 18) |