allow Path.bindPopup to take existing popups as well.

This commit is contained in:
snkashis 2013-02-17 13:31:27 -05:00
parent b94a4ea27b
commit 11195f4849

View File

@ -6,12 +6,15 @@ L.Path.include({
bindPopup: function (content, options) {
if (!this._popup || options) {
this._popup = new L.Popup(options, this);
if (content instanceof L.Popup) {
this._popup = content;
} else {
if (!this._popup || options) {
this._popup = new L.Popup(options, this);
}
this._popup.setContent(content);
}
this._popup.setContent(content);
if (!this._popupHandlersAdded) {
this
.on('click', this._openPopup, this)