move a circlemarker's popup with each new position.

This commit is contained in:
Steve Kashishian 2013-07-31 14:40:13 -04:00
parent b313165cca
commit e5bf57c4f7

View File

@ -22,6 +22,13 @@ L.CircleMarker = L.Circle.extend({
this.setRadius(this.options.radius);
},
setLatLng: function (latlng) {
L.Circle.prototype.setLatLng.call(this, latlng);
if (this._popup && this._popup._isOpen) {
this._popup.setLatLng(latlng);
}
},
setRadius: function (radius) {
this.options.radius = this._radius = radius;
return this.redraw();