fit both google and leaflet map to bounds if map already exists
default-pipeline default-pipeline #154
default-pipeline default-pipeline #154
This commit is contained in:
1 file changed
+8
-1
@@ -376,6 +376,8 @@
|
||||
if (!LMapWrapper.map) {
|
||||
LMapWrapper.divId = divId;
|
||||
LMapWrapper.map = L.map(LMapWrapper.divId, {
|
||||
center: { lat: 0., lng: 0. },
|
||||
zoom: 2,
|
||||
zoomControl: false
|
||||
});
|
||||
|
||||
@@ -395,7 +397,9 @@
|
||||
maxZoom: highResData.maxZoom
|
||||
}).addTo(LMapWrapper.map);
|
||||
|
||||
LMapWrapper.map.fitBounds(L.latLngBounds({ lat: mapBounds.south, lng: mapBounds.west }, { lat: mapBounds.north, lng: mapBounds.east }));
|
||||
if (mapId) {
|
||||
LMapWrapper.map.fitBounds(L.latLngBounds({ lat: mapBounds.south, lng: mapBounds.west }, { lat: mapBounds.north, lng: mapBounds.east }));
|
||||
}
|
||||
}
|
||||
|
||||
LMapWrapper.loadMarkers(places);
|
||||
@@ -525,6 +529,9 @@
|
||||
});
|
||||
});
|
||||
|
||||
if (mapId) {
|
||||
GMapWrapper.map.fitBounds({ south: mapBounds.south, west: mapBounds.west, north: mapBounds.north, east: mapBounds.east });
|
||||
}
|
||||
}
|
||||
|
||||
GMapWrapper.loadMarkers(places);
|
||||
|
||||
Reference in new issue
Block a user