From f4b08c488456369bf0b4fdc7392b6143a050a6b4 Mon Sep 17 00:00:00 2001 From: stefano bovio Date: Thu, 26 Nov 2020 09:14:37 +0100 Subject: [PATCH] #4675: Add dynamic import of map libraries in base map component (#6245) --- web/client/components/geostory/media/Map.jsx | 4 +- .../geostory/media/__tests__/Map-test.jsx | 55 +++++++++------- web/client/components/map/BaseMap.jsx | 3 +- .../map/__tests__/BaseMap-test-chrome.jsx | 22 ++++--- .../components/map/__tests__/BaseMap-test.jsx | 60 ++++++++++++----- .../components/map/enhancers/mapType.js | 66 +++++++++++++++++-- .../components/widgets/widget/MapView.jsx | 5 +- 7 files changed, 157 insertions(+), 58 deletions(-) diff --git a/web/client/components/geostory/media/Map.jsx b/web/client/components/geostory/media/Map.jsx index 37715370fd..84962caad8 100644 --- a/web/client/components/geostory/media/Map.jsx +++ b/web/client/components/geostory/media/Map.jsx @@ -36,7 +36,8 @@ export default compose( size, showCaption, caption: contentCaption, - mapType = "leaflet" // default for when map MediaViewer is not connected to redux + mapType = "leaflet", // default for when map MediaViewer is not connected to redux + onMapTypeLoaded }) => { const { layers = [], mapOptions = {}, description, ...m} = (map.data ? map.data : map); @@ -107,6 +108,7 @@ export default compose( tools={isMapInfoControlActive ? ["popup"] : []} options={applyDefaults(updatedMapOptions)} mapType={mapType} + onMapTypeLoaded={onMapTypeLoaded} /> {expandable && !editMap &&