From dbd57c0b7b9ac645fc64767c38a132928f7b996e Mon Sep 17 00:00:00 2001 From: snkashis Date: Wed, 13 Feb 2013 14:06:48 -0500 Subject: [PATCH 1/2] Allow popups that are bound to markers to have new content set --- src/layer/marker/Marker.Popup.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/layer/marker/Marker.Popup.js b/src/layer/marker/Marker.Popup.js index 2171bbff..1b285255 100644 --- a/src/layer/marker/Marker.Popup.js +++ b/src/layer/marker/Marker.Popup.js @@ -43,6 +43,11 @@ L.Marker.include({ return this; }, + setPopupContent: function (content) { + this._popup.setContent(content); + return this; + }, + unbindPopup: function () { if (this._popup) { this._popup = null; From 633e21d0430c229de342eae69155cfc83ed59e8a Mon Sep 17 00:00:00 2001 From: snkashis Date: Wed, 13 Feb 2013 14:08:45 -0500 Subject: [PATCH 2/2] include conditional before trying to set content of popup --- src/layer/marker/Marker.Popup.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/layer/marker/Marker.Popup.js b/src/layer/marker/Marker.Popup.js index 1b285255..a3646533 100644 --- a/src/layer/marker/Marker.Popup.js +++ b/src/layer/marker/Marker.Popup.js @@ -44,7 +44,9 @@ L.Marker.include({ }, setPopupContent: function (content) { - this._popup.setContent(content); + if (this._popup) { + this._popup.setContent(content); + } return this; },