allow Path.bindPopup to take existing popups as well.
This commit is contained in:
parent
b94a4ea27b
commit
11195f4849
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user