From 849255d81def584f09090f1ddad22d882536e3fc Mon Sep 17 00:00:00 2001 From: Lorenzo Natali Date: Tue, 6 Dec 2016 13:00:20 +0100 Subject: [PATCH] Fix #1325. Get only main map svg (#1327) --- web/client/components/map/leaflet/snapshot/GrabMap.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/client/components/map/leaflet/snapshot/GrabMap.jsx b/web/client/components/map/leaflet/snapshot/GrabMap.jsx index 588058f565..47bcfbfc3e 100644 --- a/web/client/components/map/leaflet/snapshot/GrabMap.jsx +++ b/web/client/components/map/leaflet/snapshot/GrabMap.jsx @@ -135,7 +135,11 @@ let GrabLMap = React.createClass({ var leftString = window.getComputedStyle(this.mapDiv).getPropertyValue("left"); // get all the informations needed to snap svg before - let svgs = this.mapDiv.getElementsByTagName("svg"); + let mapPanes = this.mapDiv.getElementsByClassName("leaflet-map-pane"); + let mapPane = mapPanes && mapPanes[0]; + let objectPanes = mapPane && mapPane.getElementsByClassName("leaflet-objects-pane"); + let objectDiv = objectPanes && objectPanes[0]; + let svgs = objectDiv && objectDiv.getElementsByTagName("svg"); let svg = svgs && svgs[0]; let svgH; let svgW;