From 4a86f3c73ba4186d41867f940e0731b7e3abcd7e Mon Sep 17 00:00:00 2001 From: Tyler Cubell Date: Wed, 30 Mar 2016 04:21:47 -0400 Subject: [PATCH] Give popups an id Useful for selecting individual popups after creation. Especially in the case where having a class is too general and finer-grain control is necessary. --- src/layer/Popup.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/layer/Popup.js b/src/layer/Popup.js index d94e900217d..deaf00d382c 100644 --- a/src/layer/Popup.js +++ b/src/layer/Popup.js @@ -18,6 +18,7 @@ L.Popup = L.Class.extend({ offset: new L.Point(0, 6), autoPanPadding: new L.Point(5, 5), className: '', + id: '', zoomAnimation: true }, @@ -119,6 +120,10 @@ L.Popup = L.Class.extend({ container = this._container = L.DomUtil.create('div', containerClass), closeButton; + if (this.options.id !== '') { + container.id = this.options.id; + } + if (this.options.closeButton) { closeButton = this._closeButton = L.DomUtil.create('a', prefix + '-close-button', container);