Skip to content

Commit 7b2dd24

Browse files
committed
Fix #2
1 parent 3356eab commit 7b2dd24

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

leaflet-google.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ L.Google = (L.Layer || L.Class).extend({
7070

7171
//20px instead of 1em to avoid a slight overlap with google's attribution
7272
//map._controlCorners['bottomright'].style.marginBottom = "20px";
73-
map._controlCorners["bottomright"].querySelector(".leaflet-control-attribution").style.display = "none";
73+
if (map.options.attributionControl && map.attributionControl) {
74+
map.attributionControl._container.style.display = "none";
75+
}
7476

7577
this._reset();
7678
this._update();
@@ -87,7 +89,10 @@ L.Google = (L.Layer || L.Class).extend({
8789
this._map.off('zoomanim', this._handleZoomAnim, this);
8890

8991
//map._controlCorners['bottomright'].style.marginBottom = "0em";
90-
map._controlCorners["bottomright"].querySelector(".leaflet-control-attribution").style.display = "";
92+
if (map.options.attributionControl && map.attributionControl) {
93+
map.attributionControl._container.style.display = "";
94+
}
95+
9196
//this._map.off('moveend', this._update, this);
9297
},
9398

0 commit comments

Comments
 (0)