@blaze-cms/plugin-google-maps-fe 0.138.0-core-styles.0 → 0.138.0-core-styles.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -129
- package/lib/GoogleMaps/GoogleMaps.js +6 -5
- package/lib/GoogleMaps/GoogleMaps.js.map +1 -1
- package/lib/GoogleMaps/GoogleMapsFactory.js +1 -2
- package/lib/GoogleMaps/GoogleMapsFactory.js.map +1 -1
- package/lib/GoogleMaps/GoogleMapsHtml.js +1 -2
- package/lib/GoogleMaps/GoogleMapsHtml.js.map +1 -1
- package/lib/GoogleMaps/GoogleMapsRender.js +1 -2
- package/lib/GoogleMaps/GoogleMapsRender.js.map +1 -1
- package/lib/GoogleMaps/helpers/add-zoom-listener.js +3 -4
- package/lib/GoogleMaps/helpers/add-zoom-listener.js.map +1 -1
- package/lib/GoogleMaps/helpers/build-map-shapes.js +1 -2
- package/lib/GoogleMaps/helpers/build-map-shapes.js.map +1 -1
- package/lib/GoogleMaps/helpers/build-map-type-ids.js +1 -2
- package/lib/GoogleMaps/helpers/build-map-type-ids.js.map +1 -1
- package/lib/GoogleMaps/helpers/build-query.js +1 -2
- package/lib/GoogleMaps/helpers/build-query.js.map +1 -1
- package/lib/GoogleMaps/helpers/build-shapes-configs.js +1 -2
- package/lib/GoogleMaps/helpers/build-shapes-configs.js.map +1 -1
- package/lib/GoogleMaps/helpers/get-center-coordinates.js +1 -2
- package/lib/GoogleMaps/helpers/get-center-coordinates.js.map +1 -1
- package/lib/GoogleMaps/helpers/get-image-ids.js +1 -2
- package/lib/GoogleMaps/helpers/get-image-ids.js.map +1 -1
- package/lib/GoogleMaps/helpers/get-path.js +1 -2
- package/lib/GoogleMaps/helpers/get-path.js.map +1 -1
- package/lib/GoogleMaps/helpers/set-map-options.js +1 -2
- package/lib/GoogleMaps/helpers/set-map-options.js.map +1 -1
- package/lib/GoogleMaps/helpers/set-shapes.js +15 -13
- package/lib/GoogleMaps/helpers/set-shapes.js.map +1 -1
- package/lib/GoogleMaps/hooks/use-get-entity-schemas.js +1 -2
- package/lib/GoogleMaps/hooks/use-get-entity-schemas.js.map +1 -1
- package/lib/GoogleMaps/hooks/use-get-images.js +1 -2
- package/lib/GoogleMaps/hooks/use-get-images.js.map +1 -1
- package/lib/GoogleMaps/index.js +1 -2
- package/lib/GoogleMaps/index.js.map +1 -1
- package/lib/GoogleMaps/queries.js +6 -12
- package/lib/GoogleMaps/queries.js.map +1 -1
- package/lib/constants.js +35 -70
- package/lib/constants.js.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib-es/GoogleMaps/GoogleMaps.js +3 -1
- package/lib-es/GoogleMaps/GoogleMaps.js.map +1 -1
- package/lib-es/GoogleMaps/GoogleMapsRender.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/add-zoom-listener.js +2 -2
- package/lib-es/GoogleMaps/helpers/add-zoom-listener.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/set-shapes.js +12 -9
- package/lib-es/GoogleMaps/helpers/set-shapes.js.map +1 -1
- package/package.json +3 -3
- package/src/GoogleMaps/GoogleMaps.js +3 -1
- package/src/GoogleMaps/GoogleMapsRender.js +1 -0
- package/src/GoogleMaps/helpers/add-zoom-listener.js +2 -2
- package/src/GoogleMaps/helpers/set-shapes.js +16 -13
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ZOOM_CHANGED } from '../../constants';
|
|
2
2
|
import setShapes from './set-shapes';
|
|
3
3
|
|
|
4
|
-
const addZoomListener = (map, router, shapes, imageData) => {
|
|
4
|
+
const addZoomListener = (map, router, shapes, imageData, client) => {
|
|
5
5
|
if (!map) return;
|
|
6
6
|
setShapes(map, router, shapes, imageData);
|
|
7
|
-
map.addListener(ZOOM_CHANGED, () => setShapes(map, router, shapes, imageData));
|
|
7
|
+
map.addListener(ZOOM_CHANGED, () => setShapes(map, router, shapes, imageData, client));
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export default addZoomListener;
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import isNumber from 'lodash.isnumber';
|
|
3
3
|
import ReactDOMServer from 'react-dom/server';
|
|
4
4
|
import { Link } from '@blaze-cms/nextjs-components';
|
|
5
|
+
import { ApolloProvider } from '@apollo/client';
|
|
5
6
|
import {
|
|
6
7
|
buildPropsToDisplayWithContent,
|
|
7
8
|
summaryComponents,
|
|
@@ -38,7 +39,7 @@ const closeInfoWindows = () => {
|
|
|
38
39
|
}
|
|
39
40
|
};
|
|
40
41
|
|
|
41
|
-
const addShapeListeners = (map, router, shape, imageData, shapeInstance) => {
|
|
42
|
+
const addShapeListeners = (map, router, shape, imageData, shapeInstance, client) => {
|
|
42
43
|
const { enableInfoPane = false, dataSummaries = [], url, shapeData } = shape;
|
|
43
44
|
|
|
44
45
|
if (enableInfoPane) {
|
|
@@ -49,7 +50,7 @@ const addShapeListeners = (map, router, shape, imageData, shapeInstance) => {
|
|
|
49
50
|
shapeInstance.addListener(CLICK, async event => {
|
|
50
51
|
closeInfoWindows();
|
|
51
52
|
const content = ReactDOMServer.renderToString(
|
|
52
|
-
await infoWindowContent(imageData, dataSummaries, url, shapeData)
|
|
53
|
+
await infoWindowContent(imageData, dataSummaries, url, shapeData, client)
|
|
53
54
|
);
|
|
54
55
|
infoWindow.setContent(content);
|
|
55
56
|
infoWindow.setPosition(event.latLng);
|
|
@@ -90,7 +91,7 @@ const getIconUrl = (imageId, imageData) => {
|
|
|
90
91
|
return image.url;
|
|
91
92
|
};
|
|
92
93
|
|
|
93
|
-
const infoWindowContent = async (imageData, dataSummaries, url, shapeData) => {
|
|
94
|
+
const infoWindowContent = async (imageData, dataSummaries, url, shapeData, client) => {
|
|
94
95
|
const summariesWithContent = await Promise.all(
|
|
95
96
|
dataSummaries.map(async dataSummary => {
|
|
96
97
|
const { elementTitle, type, propsToDisplay, ...otherProps } = dataSummary;
|
|
@@ -104,12 +105,14 @@ const infoWindowContent = async (imageData, dataSummaries, url, shapeData) => {
|
|
|
104
105
|
|
|
105
106
|
const getDataSummaryComponent = () => {
|
|
106
107
|
const component = (
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
108
|
+
<ApolloProvider client={client}>
|
|
109
|
+
<SummaryComponent
|
|
110
|
+
key={type}
|
|
111
|
+
modifier={modifier}
|
|
112
|
+
elementTitle={elementTitle}
|
|
113
|
+
summaryPropsWithContent={summaryPropsWithContent}
|
|
114
|
+
/>
|
|
115
|
+
</ApolloProvider>
|
|
113
116
|
);
|
|
114
117
|
|
|
115
118
|
if (isTypeHeading && url) return <Link href={url}>{component}</Link>;
|
|
@@ -181,7 +184,7 @@ function getIcon(imageData, shape) {
|
|
|
181
184
|
return svgMarker;
|
|
182
185
|
}
|
|
183
186
|
|
|
184
|
-
const setMarker = (map, router, shape, imageData) => {
|
|
187
|
+
const setMarker = (map, router, shape, imageData, client) => {
|
|
185
188
|
const { label = '', latitude, longitude } = shape;
|
|
186
189
|
|
|
187
190
|
if (isPositionCorrect(latitude, longitude)) {
|
|
@@ -194,7 +197,7 @@ const setMarker = (map, router, shape, imageData) => {
|
|
|
194
197
|
title: label || ''
|
|
195
198
|
});
|
|
196
199
|
|
|
197
|
-
addShapeListeners(map, router, shape, imageData, marker);
|
|
200
|
+
addShapeListeners(map, router, shape, imageData, marker, client);
|
|
198
201
|
|
|
199
202
|
shapesArray.push(marker);
|
|
200
203
|
|
|
@@ -279,7 +282,7 @@ const setCircle = (map, router, shape, imageData) => {
|
|
|
279
282
|
}
|
|
280
283
|
};
|
|
281
284
|
|
|
282
|
-
const setShapes = (map, router, shapes, imageData) => {
|
|
285
|
+
const setShapes = (map, router, shapes, imageData, client) => {
|
|
283
286
|
const mapZoom = map.getZoom();
|
|
284
287
|
clearShapes();
|
|
285
288
|
|
|
@@ -289,7 +292,7 @@ const setShapes = (map, router, shapes, imageData) => {
|
|
|
289
292
|
if (mapZoom >= minZoom && mapZoom <= maxZoom) {
|
|
290
293
|
switch (type) {
|
|
291
294
|
case MARKER: {
|
|
292
|
-
setMarker(map, router, shape, imageData);
|
|
295
|
+
setMarker(map, router, shape, imageData, client);
|
|
293
296
|
break;
|
|
294
297
|
}
|
|
295
298
|
case POLYLINE: {
|