-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathember-leaflet@5.1.3.patch
More file actions
44 lines (42 loc) · 1.54 KB
/
ember-leaflet@5.1.3.patch
File metadata and controls
44 lines (42 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
diff --git a/addon/components/marker-layer.js b/addon/components/marker-layer.js
index 132bc4876f0c2847e732fd66e79b06dedf0ea470..93a4a446e0ebecc4eebe6e9d3b7831f2b986d036 100644
--- a/addon/components/marker-layer.js
+++ b/addon/components/marker-layer.js
@@ -264,13 +264,15 @@ export default class MarkerLayer extends InteractiveLayer {
arg: 'icon',
// there was an old leaflet bug where draggability is lost on icon change
updateFn(layer, value) {
- let enabled = layer.dragging.enabled();
layer.setIcon(value);
- if (enabled) {
- layer.dragging.enable();
- } else {
- layer.dragging.disable();
+ if (layer.dragging) {
+ let enabled = layer.dragging.enabled();
+ if (enabled) {
+ layer.dragging.enable();
+ } else {
+ layer.dragging.disable();
+ }
}
}
}
diff --git a/addon/components/popup-layer.js b/addon/components/popup-layer.js
index 960ca419a96bed894a420c629f43501265adc4dd..122a3cd9f0e0ac6e17595514513ee097ebff38c2 100644
--- a/addon/components/popup-layer.js
+++ b/addon/components/popup-layer.js
@@ -134,7 +134,13 @@ export default class PopupLayer extends DivOverlayLayer {
*/
@action
closePopup() {
- this._layer._close ? this._layer._close() : this._layer.close();
+ if (this._layer) {
+ if (typeof this._layer._close === 'function') {
+ this._layer._close()
+ } else if (typeof this._layer.close === 'function') {
+ this._layer.close()
+ }
+ }
}
@action