Marker#openPopup

This commit is contained in:
Mourner 2011-01-11 17:51:02 +02:00
parent 0cd810bbb1
commit 663620efed

View File

@ -1,12 +1,15 @@
L.Marker.include({ L.Marker.include({
openPopup: function(content) {
this._map.openPopup(this._latlng, content, this.options.icon.popupAnchor);
},
bindPopup: function(content) { bindPopup: function(content) {
this._popupContent = content; this._popupContent = content;
this.on('click', this._onMouseDown, this); this.on('click', this._onMouseDown, this);
}, },
_onMouseDown: function() { _onMouseDown: function() {
this._map.closePopup(); this.openPopup(this._popupContent);
this._map.openPopup(this._latlng, this._popupContent, this.options.icon.popupAnchor);
} }
}); });