I have using google map api v3 and i want to display custom cluster pin with number alignment like this:
I have tried this code:
var clusterOptions = {
zoomOnClick: false,
styles: [{height: 36, width: 36, url: location.href.substring(0, location.href.lastIndexOf("/")+1)+'images/pushpin_cluster.png' }]}
var markerCluster = new MarkerClusterer(map, markers, clusterOptions);
But it's showing like this:
how can i align the Cluster icon number into the blue box.
thanks in advance...
I have tried this code is working well:
var clusterOptions = {
zoomOnClick: false,
styles: [{ anchor:[2,22],textColor: "white",height: 36, width: 36, url: location.href.substring(0, location.href.lastIndexOf("/")+1)+'images/pushpin_cluster.png' }]}
var markerCluster = new MarkerClusterer(map, markers, clusterOptions);
anchor:[2,22] -The position (in pixels) from the center of the cluster icon to where the text label is to be centered and drawn. The format is [yoffset, xoffset] where yoffset increases as you go down from center and xoffset increases to the right of center. The default is [0, 0].
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments