Last active
June 10, 2016 06:54
-
-
Save s2ar/bf765f111e80b8d48592524481fd6186 to your computer and use it in GitHub Desktop.
Оформление иконки кластера (markerclustererplus library)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Adding the cluster icon to the dom. | |
* @ignore | |
*/ | |
ClusterIcon.prototype.onAdd = function() { | |
this.div_ = document.createElement('DIV'); | |
if (this.visible_) { | |
var pos = this.getPosFromLatLng_(this.center_); | |
this.div_.style.cssText = this.createCss(pos); | |
var innerHtml; | |
if (this.cluster_.markers_.length > 0) { | |
innerHtml = "<div><p class='clusterIconText'>" + this.sums_.text + "</p></div>"; | |
} | |
this.div_.innerHTML = innerHtml; | |
} | |
var panes = this.getPanes(); | |
panes.overlayMouseTarget.appendChild(this.div_); | |
var that = this; | |
google.maps.event.addDomListener(this.div_, 'click', function() { | |
that.triggerClusterClick(); | |
}); | |
}; | |
.clusterIconText | |
{ | |
margin-top:-70px; | |
margin-left:-70px; | |
color:#f2f2f2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment