@blaze-cms/plugin-google-maps-fe 0.125.0-alpha.1 → 0.125.0-alpha.13
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 +24 -0
- package/lib/GoogleMaps/GoogleMaps.js +24 -71
- package/lib/GoogleMaps/GoogleMaps.js.map +1 -1
- package/lib/GoogleMaps/GoogleMapsFactory.js +8 -24
- package/lib/GoogleMaps/GoogleMapsFactory.js.map +1 -1
- package/lib/GoogleMaps/GoogleMapsHtml.js +0 -6
- package/lib/GoogleMaps/GoogleMapsHtml.js.map +1 -1
- package/lib/GoogleMaps/GoogleMapsRender.js +12 -33
- package/lib/GoogleMaps/GoogleMapsRender.js.map +1 -1
- package/lib/GoogleMaps/helpers/add-zoom-listener.js +0 -6
- package/lib/GoogleMaps/helpers/add-zoom-listener.js.map +1 -1
- package/lib/GoogleMaps/helpers/build-map-shapes.js +7 -33
- package/lib/GoogleMaps/helpers/build-map-shapes.js.map +1 -1
- package/lib/GoogleMaps/helpers/build-map-type-ids.js +0 -4
- package/lib/GoogleMaps/helpers/build-map-type-ids.js.map +1 -1
- package/lib/GoogleMaps/helpers/build-query.js +5 -17
- package/lib/GoogleMaps/helpers/build-query.js.map +1 -1
- package/lib/GoogleMaps/helpers/build-shapes-configs.js +25 -70
- package/lib/GoogleMaps/helpers/build-shapes-configs.js.map +1 -1
- package/lib/GoogleMaps/helpers/get-center-coordinates.js +2 -11
- package/lib/GoogleMaps/helpers/get-center-coordinates.js.map +1 -1
- package/lib/GoogleMaps/helpers/get-image-ids.js +1 -13
- package/lib/GoogleMaps/helpers/get-image-ids.js.map +1 -1
- package/lib/GoogleMaps/helpers/get-path.js +1 -6
- package/lib/GoogleMaps/helpers/get-path.js.map +1 -1
- package/lib/GoogleMaps/helpers/index.js +0 -9
- package/lib/GoogleMaps/helpers/index.js.map +1 -1
- package/lib/GoogleMaps/helpers/set-map-options.js +21 -33
- package/lib/GoogleMaps/helpers/set-map-options.js.map +1 -1
- package/lib/GoogleMaps/helpers/set-shapes.js +30 -112
- package/lib/GoogleMaps/helpers/set-shapes.js.map +1 -1
- package/lib/GoogleMaps/hooks/index.js +0 -4
- package/lib/GoogleMaps/hooks/index.js.map +1 -1
- package/lib/GoogleMaps/hooks/use-get-entity-schemas.js +8 -19
- package/lib/GoogleMaps/hooks/use-get-entity-schemas.js.map +1 -1
- package/lib/GoogleMaps/hooks/use-get-images.js +12 -19
- package/lib/GoogleMaps/hooks/use-get-images.js.map +1 -1
- package/lib/GoogleMaps/index.js +0 -4
- package/lib/GoogleMaps/index.js.map +1 -1
- package/lib/GoogleMaps/queries.js +0 -17
- package/lib/GoogleMaps/queries.js.map +1 -1
- package/lib/constants.js +0 -1
- package/lib/constants.js.map +1 -1
- package/lib/index.js +0 -21
- package/lib/index.js.map +1 -1
- package/lib-es/GoogleMaps/GoogleMaps.js +14 -25
- package/lib-es/GoogleMaps/GoogleMaps.js.map +1 -1
- package/lib-es/GoogleMaps/GoogleMapsFactory.js +4 -7
- package/lib-es/GoogleMaps/GoogleMapsFactory.js.map +1 -1
- package/lib-es/GoogleMaps/GoogleMapsHtml.js +0 -2
- package/lib-es/GoogleMaps/GoogleMapsHtml.js.map +1 -1
- package/lib-es/GoogleMaps/GoogleMapsRender.js +5 -8
- package/lib-es/GoogleMaps/GoogleMapsRender.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/add-zoom-listener.js +0 -2
- package/lib-es/GoogleMaps/helpers/add-zoom-listener.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/build-map-shapes.js +0 -8
- package/lib-es/GoogleMaps/helpers/build-map-shapes.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/build-map-type-ids.js +0 -2
- package/lib-es/GoogleMaps/helpers/build-map-type-ids.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/build-query.js +0 -2
- package/lib-es/GoogleMaps/helpers/build-query.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/build-shapes-configs.js +0 -14
- package/lib-es/GoogleMaps/helpers/build-shapes-configs.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/get-center-coordinates.js +0 -2
- package/lib-es/GoogleMaps/helpers/get-center-coordinates.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/get-image-ids.js +0 -1
- package/lib-es/GoogleMaps/helpers/get-image-ids.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/get-path.js +0 -1
- package/lib-es/GoogleMaps/helpers/get-path.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/index.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/set-map-options.js +2 -8
- package/lib-es/GoogleMaps/helpers/set-map-options.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/set-shapes.js +5 -41
- package/lib-es/GoogleMaps/helpers/set-shapes.js.map +1 -1
- package/lib-es/GoogleMaps/hooks/index.js.map +1 -1
- package/lib-es/GoogleMaps/hooks/use-get-entity-schemas.js +0 -2
- package/lib-es/GoogleMaps/hooks/use-get-entity-schemas.js.map +1 -1
- package/lib-es/GoogleMaps/hooks/use-get-images.js +0 -2
- package/lib-es/GoogleMaps/hooks/use-get-images.js.map +1 -1
- package/lib-es/GoogleMaps/index.js.map +1 -1
- package/lib-es/GoogleMaps/queries.js +0 -6
- package/lib-es/GoogleMaps/queries.js.map +1 -1
- package/lib-es/constants.js.map +1 -1
- package/lib-es/index.js +1 -3
- package/lib-es/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-image-ids.js","names":["getImageIds","mapShapes","ids","forEach","shapeData","imageId","push","Set"],"sources":["../../../src/GoogleMaps/helpers/get-image-ids.js"],"sourcesContent":["const getImageIds = mapShapes => {\n const ids = [];\n mapShapes.forEach(({ shapeData, imageId }) => {\n if (imageId) ids.push(imageId);\n if (shapeData.imageId) ids.push(shapeData.imageId);\n });\n return [...new Set(ids)];\n};\n\nexport default getImageIds;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-image-ids.js","names":["getImageIds","mapShapes","ids","forEach","shapeData","imageId","push","Set"],"sources":["../../../src/GoogleMaps/helpers/get-image-ids.js"],"sourcesContent":["const getImageIds = mapShapes => {\n const ids = [];\n mapShapes.forEach(({ shapeData, imageId }) => {\n if (imageId) ids.push(imageId);\n if (shapeData.imageId) ids.push(shapeData.imageId);\n });\n return [...new Set(ids)];\n};\n\nexport default getImageIds;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAMA,WAAW,GAAG,SAAdA,WAAW,CAAGC,SAAS,EAAI;EAC/B,IAAMC,GAAG,GAAG,EAAE;EACdD,SAAS,CAACE,OAAO,CAAC,gBAA4B;IAAA,IAAzBC,SAAS,QAATA,SAAS;MAAEC,OAAO,QAAPA,OAAO;IACrC,IAAIA,OAAO,EAAEH,GAAG,CAACI,IAAI,CAACD,OAAO,CAAC;IAC9B,IAAID,SAAS,CAACC,OAAO,EAAEH,GAAG,CAACI,IAAI,CAACF,SAAS,CAACC,OAAO,CAAC;EACpD,CAAC,CAAC;EACF,2CAAW,IAAIE,GAAG,CAACL,GAAG,CAAC;AACzB,CAAC;AAAC,eAEaF,WAAW;AAAA"}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
require("core-js/modules/es.array.reduce.js");
|
|
11
|
-
|
|
12
9
|
require("core-js/modules/es.object.to-string.js");
|
|
13
|
-
|
|
14
10
|
var getPath = function getPath(paths) {
|
|
15
11
|
return paths.reduce(function (acc, path) {
|
|
16
12
|
var lat = path.latitude,
|
|
17
|
-
|
|
13
|
+
lng = path.longitude;
|
|
18
14
|
acc.push({
|
|
19
15
|
lat: lat,
|
|
20
16
|
lng: lng
|
|
@@ -22,7 +18,6 @@ var getPath = function getPath(paths) {
|
|
|
22
18
|
return acc;
|
|
23
19
|
}, []);
|
|
24
20
|
};
|
|
25
|
-
|
|
26
21
|
var _default = getPath;
|
|
27
22
|
exports["default"] = _default;
|
|
28
23
|
//# sourceMappingURL=get-path.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-path.js","names":["getPath","paths","reduce","acc","path","lat","latitude","lng","longitude","push"],"sources":["../../../src/GoogleMaps/helpers/get-path.js"],"sourcesContent":["const getPath = paths =>\n paths.reduce((acc, path) => {\n const { latitude: lat, longitude: lng } = path;\n acc.push({ lat, lng });\n return acc;\n }, []);\n\nexport default getPath;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-path.js","names":["getPath","paths","reduce","acc","path","lat","latitude","lng","longitude","push"],"sources":["../../../src/GoogleMaps/helpers/get-path.js"],"sourcesContent":["const getPath = paths =>\n paths.reduce((acc, path) => {\n const { latitude: lat, longitude: lng } = path;\n acc.push({ lat, lng });\n return acc;\n }, []);\n\nexport default getPath;\n"],"mappings":";;;;;;;;;AAAA,IAAMA,OAAO,GAAG,SAAVA,OAAO,CAAGC,KAAK;EAAA,OACnBA,KAAK,CAACC,MAAM,CAAC,UAACC,GAAG,EAAEC,IAAI,EAAK;IAC1B,IAAkBC,GAAG,GAAqBD,IAAI,CAAtCE,QAAQ;MAAkBC,GAAG,GAAKH,IAAI,CAAvBI,SAAS;IAChCL,GAAG,CAACM,IAAI,CAAC;MAAEJ,GAAG,EAAHA,GAAG;MAAEE,GAAG,EAAHA;IAAI,CAAC,CAAC;IACtB,OAAOJ,GAAG;EACZ,CAAC,EAAE,EAAE,CAAC;AAAA;AAAC,eAEMH,OAAO;AAAA"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -49,18 +47,11 @@ Object.defineProperty(exports, "setMapOptions", {
|
|
|
49
47
|
return _setMapOptions["default"];
|
|
50
48
|
}
|
|
51
49
|
});
|
|
52
|
-
|
|
53
50
|
var _addZoomListener = _interopRequireDefault(require("./add-zoom-listener"));
|
|
54
|
-
|
|
55
51
|
var _buildQuery = _interopRequireDefault(require("./build-query"));
|
|
56
|
-
|
|
57
52
|
var _getImageIds = _interopRequireDefault(require("./get-image-ids"));
|
|
58
|
-
|
|
59
53
|
var _buildShapesConfigs = _interopRequireDefault(require("./build-shapes-configs"));
|
|
60
|
-
|
|
61
54
|
var _setMapOptions = _interopRequireDefault(require("./set-map-options"));
|
|
62
|
-
|
|
63
55
|
var _getCenterCoordinates = _interopRequireDefault(require("./get-center-coordinates"));
|
|
64
|
-
|
|
65
56
|
var _buildMapShapes = _interopRequireDefault(require("./build-map-shapes"));
|
|
66
57
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/GoogleMaps/helpers/index.js"],"sourcesContent":["import addZoomListener from './add-zoom-listener';\nimport buildQuery from './build-query';\nimport getImageIds from './get-image-ids';\nimport buildShapesConfig from './build-shapes-configs';\nimport setMapOptions from './set-map-options';\nimport getCenterCoordinates from './get-center-coordinates';\nimport buildMapShapes from './build-map-shapes';\n\nexport {\n addZoomListener,\n buildQuery,\n getImageIds,\n buildShapesConfig,\n setMapOptions,\n getCenterCoordinates,\n buildMapShapes\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/GoogleMaps/helpers/index.js"],"sourcesContent":["import addZoomListener from './add-zoom-listener';\nimport buildQuery from './build-query';\nimport getImageIds from './get-image-ids';\nimport buildShapesConfig from './build-shapes-configs';\nimport setMapOptions from './set-map-options';\nimport getCenterCoordinates from './get-center-coordinates';\nimport buildMapShapes from './build-map-shapes';\n\nexport {\n addZoomListener,\n buildQuery,\n getImageIds,\n buildShapesConfig,\n setMapOptions,\n getCenterCoordinates,\n buildMapShapes\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.object.define-property.js");
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports["default"] = void 0;
|
|
11
|
-
|
|
12
9
|
require("core-js/modules/es.array.concat.js");
|
|
13
|
-
|
|
14
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
|
-
|
|
16
11
|
var _buildMapTypeIds = _interopRequireDefault(require("./build-map-type-ids"));
|
|
17
|
-
|
|
18
12
|
var _constants = require("../../constants");
|
|
19
|
-
|
|
20
13
|
var setCustomColor = function setCustomColor(featureType, color, elementType) {
|
|
21
14
|
return color ? [{
|
|
22
15
|
featureType: featureType,
|
|
@@ -26,43 +19,39 @@ var setCustomColor = function setCustomColor(featureType, color, elementType) {
|
|
|
26
19
|
}]
|
|
27
20
|
}] : [];
|
|
28
21
|
};
|
|
29
|
-
|
|
30
22
|
var getFeatureStyles = function getFeatureStyles(_ref) {
|
|
31
23
|
var _ref$enableRoads = _ref.enableRoads,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var customColors = [];
|
|
38
|
-
|
|
24
|
+
enableRoads = _ref$enableRoads === void 0 ? true : _ref$enableRoads,
|
|
25
|
+
enableFeatureTransportation = _ref.enableFeatureTransportation,
|
|
26
|
+
enableFeatureLabels = _ref.enableFeatureLabels,
|
|
27
|
+
enableFeaturePoi = _ref.enableFeaturePoi,
|
|
28
|
+
enableFeatureBoundaries = _ref.enableFeatureBoundaries;
|
|
29
|
+
var customColors = [];
|
|
30
|
+
// todo: enableRoads is a legacy option can be removed in later updates
|
|
39
31
|
if (!enableFeatureLabels || !enableRoads) customColors.push.apply(customColors, (0, _toConsumableArray2["default"])(_constants.DISABLE_LABELS_STYLES));
|
|
40
32
|
if (!enableFeatureBoundaries || !enableRoads) customColors.push.apply(customColors, (0, _toConsumableArray2["default"])(_constants.DISABLE_BOUNDARIES_STYLES));
|
|
41
33
|
if (!enableFeaturePoi || !enableRoads) customColors.push.apply(customColors, (0, _toConsumableArray2["default"])(_constants.DISABLE_POI_STYLES));
|
|
42
|
-
|
|
43
34
|
if (!enableFeatureTransportation || !enableRoads) {
|
|
44
35
|
customColors.push.apply(customColors, (0, _toConsumableArray2["default"])(_constants.DISABLE_TRANSPORTATION_STYLES));
|
|
45
36
|
}
|
|
46
|
-
|
|
47
37
|
return customColors;
|
|
48
38
|
};
|
|
49
|
-
|
|
50
39
|
var setMapOptions = function setMapOptions(otherProps) {
|
|
51
40
|
var centerLatitude = otherProps.centerLatitude,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
41
|
+
centerLongitude = otherProps.centerLongitude,
|
|
42
|
+
defaultZoom = otherProps.defaultZoom,
|
|
43
|
+
enableZoom = otherProps.enableZoom,
|
|
44
|
+
maxZoom = otherProps.maxZoom,
|
|
45
|
+
minZoom = otherProps.minZoom,
|
|
46
|
+
enablePan = otherProps.enablePan,
|
|
47
|
+
enableStreetView = otherProps.enableStreetView,
|
|
48
|
+
enableFullScreen = otherProps.enableFullScreen,
|
|
49
|
+
enableSatelliteView = otherProps.enableSatelliteView,
|
|
50
|
+
enableTerrainScreen = otherProps.enableTerrainScreen,
|
|
51
|
+
waterColor = otherProps.waterColor,
|
|
52
|
+
landscapeColor = otherProps.landscapeColor,
|
|
53
|
+
landscapeColorAll = otherProps.landscapeColorAll,
|
|
54
|
+
mapType = otherProps.mapType;
|
|
66
55
|
var customColors = [].concat((0, _toConsumableArray2["default"])(getFeatureStyles(otherProps)), (0, _toConsumableArray2["default"])(setCustomColor(_constants.FEATURE_TYPE_MAP.waterColor, waterColor)), (0, _toConsumableArray2["default"])(setCustomColor(_constants.FEATURE_TYPE_MAP.landscapeColor, landscapeColor)), (0, _toConsumableArray2["default"])(setCustomColor(_constants.FEATURE_TYPE_MAP.landscapeColor, landscapeColorAll, _constants.ALL)));
|
|
67
56
|
return {
|
|
68
57
|
center: {
|
|
@@ -86,7 +75,6 @@ var setMapOptions = function setMapOptions(otherProps) {
|
|
|
86
75
|
styles: customColors
|
|
87
76
|
};
|
|
88
77
|
};
|
|
89
|
-
|
|
90
78
|
var _default = setMapOptions;
|
|
91
79
|
exports["default"] = _default;
|
|
92
80
|
//# sourceMappingURL=set-map-options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-map-options.js","names":["setCustomColor","featureType","color","elementType","ELEMENT_GEOMETRY","stylers","getFeatureStyles","enableRoads","enableFeatureTransportation","enableFeatureLabels","enableFeaturePoi","enableFeatureBoundaries","customColors","push","DISABLE_LABELS_STYLES","DISABLE_BOUNDARIES_STYLES","DISABLE_POI_STYLES","DISABLE_TRANSPORTATION_STYLES","setMapOptions","otherProps","centerLatitude","centerLongitude","defaultZoom","enableZoom","maxZoom","minZoom","enablePan","enableStreetView","enableFullScreen","enableSatelliteView","enableTerrainScreen","waterColor","landscapeColor","landscapeColorAll","mapType","FEATURE_TYPE_MAP","ALL","center","lat","lng","zoom","gestureHandling","COOPERATIVE","NONE","panControl","zoomControl","disableDoubleClickZoom","streetViewControl","fullscreenControl","mapTypeControl","mapTypeControlOptions","mapTypeIds","buildMapTypeIds","mapTypeId","DEFAULT_SELECT_VALUE","undefined","styles"],"sources":["../../../src/GoogleMaps/helpers/set-map-options.js"],"sourcesContent":["import buildMapTypeIds from './build-map-type-ids';\nimport {\n COOPERATIVE,\n NONE,\n ELEMENT_GEOMETRY,\n FEATURE_TYPE_MAP,\n ALL,\n DISABLE_TRANSPORTATION_STYLES,\n DISABLE_POI_STYLES,\n DISABLE_BOUNDARIES_STYLES,\n DISABLE_LABELS_STYLES,\n DEFAULT_SELECT_VALUE\n} from '../../constants';\n\nconst setCustomColor = (featureType, color, elementType) =>\n color\n ? [\n {\n featureType,\n elementType: elementType || ELEMENT_GEOMETRY,\n stylers: [\n {\n color\n }\n ]\n }\n ]\n : [];\n\nconst getFeatureStyles = ({\n enableRoads = true,\n enableFeatureTransportation,\n enableFeatureLabels,\n enableFeaturePoi,\n enableFeatureBoundaries\n}) => {\n const customColors = [];\n // todo: enableRoads is a legacy option can be removed in later updates\n if (!enableFeatureLabels || !enableRoads) customColors.push(...DISABLE_LABELS_STYLES);\n if (!enableFeatureBoundaries || !enableRoads) customColors.push(...DISABLE_BOUNDARIES_STYLES);\n if (!enableFeaturePoi || !enableRoads) customColors.push(...DISABLE_POI_STYLES);\n if (!enableFeatureTransportation || !enableRoads) {\n customColors.push(...DISABLE_TRANSPORTATION_STYLES);\n }\n\n return customColors;\n};\n\nconst setMapOptions = otherProps => {\n const {\n centerLatitude,\n centerLongitude,\n defaultZoom,\n enableZoom,\n maxZoom,\n minZoom,\n enablePan,\n enableStreetView,\n enableFullScreen,\n enableSatelliteView,\n enableTerrainScreen,\n waterColor,\n landscapeColor,\n landscapeColorAll,\n mapType\n } = otherProps;\n\n const customColors = [\n ...getFeatureStyles(otherProps),\n ...setCustomColor(FEATURE_TYPE_MAP.waterColor, waterColor),\n ...setCustomColor(FEATURE_TYPE_MAP.landscapeColor, landscapeColor),\n ...setCustomColor(FEATURE_TYPE_MAP.landscapeColor, landscapeColorAll, ALL)\n ];\n\n return {\n center: { lat: centerLatitude, lng: centerLongitude },\n zoom: defaultZoom,\n maxZoom: enableZoom ? maxZoom : defaultZoom,\n minZoom: enableZoom ? minZoom : defaultZoom,\n gestureHandling: enablePan || enableZoom ? COOPERATIVE : NONE,\n panControl: enablePan,\n zoomControl: enableZoom && minZoom !== maxZoom,\n disableDoubleClickZoom: !enableZoom,\n streetViewControl: enableStreetView,\n fullscreenControl: enableFullScreen,\n mapTypeControl: enableSatelliteView || enableTerrainScreen,\n mapTypeControlOptions: {\n mapTypeIds: buildMapTypeIds(enableSatelliteView, enableTerrainScreen)\n },\n mapTypeId: !mapType || mapType === DEFAULT_SELECT_VALUE ? undefined : mapType,\n styles: customColors\n };\n};\n\nexport default setMapOptions;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"set-map-options.js","names":["setCustomColor","featureType","color","elementType","ELEMENT_GEOMETRY","stylers","getFeatureStyles","enableRoads","enableFeatureTransportation","enableFeatureLabels","enableFeaturePoi","enableFeatureBoundaries","customColors","push","DISABLE_LABELS_STYLES","DISABLE_BOUNDARIES_STYLES","DISABLE_POI_STYLES","DISABLE_TRANSPORTATION_STYLES","setMapOptions","otherProps","centerLatitude","centerLongitude","defaultZoom","enableZoom","maxZoom","minZoom","enablePan","enableStreetView","enableFullScreen","enableSatelliteView","enableTerrainScreen","waterColor","landscapeColor","landscapeColorAll","mapType","FEATURE_TYPE_MAP","ALL","center","lat","lng","zoom","gestureHandling","COOPERATIVE","NONE","panControl","zoomControl","disableDoubleClickZoom","streetViewControl","fullscreenControl","mapTypeControl","mapTypeControlOptions","mapTypeIds","buildMapTypeIds","mapTypeId","DEFAULT_SELECT_VALUE","undefined","styles"],"sources":["../../../src/GoogleMaps/helpers/set-map-options.js"],"sourcesContent":["import buildMapTypeIds from './build-map-type-ids';\nimport {\n COOPERATIVE,\n NONE,\n ELEMENT_GEOMETRY,\n FEATURE_TYPE_MAP,\n ALL,\n DISABLE_TRANSPORTATION_STYLES,\n DISABLE_POI_STYLES,\n DISABLE_BOUNDARIES_STYLES,\n DISABLE_LABELS_STYLES,\n DEFAULT_SELECT_VALUE\n} from '../../constants';\n\nconst setCustomColor = (featureType, color, elementType) =>\n color\n ? [\n {\n featureType,\n elementType: elementType || ELEMENT_GEOMETRY,\n stylers: [\n {\n color\n }\n ]\n }\n ]\n : [];\n\nconst getFeatureStyles = ({\n enableRoads = true,\n enableFeatureTransportation,\n enableFeatureLabels,\n enableFeaturePoi,\n enableFeatureBoundaries\n}) => {\n const customColors = [];\n // todo: enableRoads is a legacy option can be removed in later updates\n if (!enableFeatureLabels || !enableRoads) customColors.push(...DISABLE_LABELS_STYLES);\n if (!enableFeatureBoundaries || !enableRoads) customColors.push(...DISABLE_BOUNDARIES_STYLES);\n if (!enableFeaturePoi || !enableRoads) customColors.push(...DISABLE_POI_STYLES);\n if (!enableFeatureTransportation || !enableRoads) {\n customColors.push(...DISABLE_TRANSPORTATION_STYLES);\n }\n\n return customColors;\n};\n\nconst setMapOptions = otherProps => {\n const {\n centerLatitude,\n centerLongitude,\n defaultZoom,\n enableZoom,\n maxZoom,\n minZoom,\n enablePan,\n enableStreetView,\n enableFullScreen,\n enableSatelliteView,\n enableTerrainScreen,\n waterColor,\n landscapeColor,\n landscapeColorAll,\n mapType\n } = otherProps;\n\n const customColors = [\n ...getFeatureStyles(otherProps),\n ...setCustomColor(FEATURE_TYPE_MAP.waterColor, waterColor),\n ...setCustomColor(FEATURE_TYPE_MAP.landscapeColor, landscapeColor),\n ...setCustomColor(FEATURE_TYPE_MAP.landscapeColor, landscapeColorAll, ALL)\n ];\n\n return {\n center: { lat: centerLatitude, lng: centerLongitude },\n zoom: defaultZoom,\n maxZoom: enableZoom ? maxZoom : defaultZoom,\n minZoom: enableZoom ? minZoom : defaultZoom,\n gestureHandling: enablePan || enableZoom ? COOPERATIVE : NONE,\n panControl: enablePan,\n zoomControl: enableZoom && minZoom !== maxZoom,\n disableDoubleClickZoom: !enableZoom,\n streetViewControl: enableStreetView,\n fullscreenControl: enableFullScreen,\n mapTypeControl: enableSatelliteView || enableTerrainScreen,\n mapTypeControlOptions: {\n mapTypeIds: buildMapTypeIds(enableSatelliteView, enableTerrainScreen)\n },\n mapTypeId: !mapType || mapType === DEFAULT_SELECT_VALUE ? undefined : mapType,\n styles: customColors\n };\n};\n\nexport default setMapOptions;\n"],"mappings":"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"}
|
|
@@ -1,83 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.symbol.js");
|
|
4
|
-
|
|
5
4
|
require("core-js/modules/es.array.filter.js");
|
|
6
|
-
|
|
7
5
|
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
8
|
-
|
|
9
6
|
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
10
|
-
|
|
11
7
|
require("core-js/modules/es.object.define-properties.js");
|
|
12
|
-
|
|
13
8
|
require("core-js/modules/es.object.define-property.js");
|
|
14
|
-
|
|
15
9
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
16
|
-
|
|
17
10
|
Object.defineProperty(exports, "__esModule", {
|
|
18
11
|
value: true
|
|
19
12
|
});
|
|
20
13
|
exports["default"] = void 0;
|
|
21
|
-
|
|
22
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
23
|
-
|
|
24
15
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
25
|
-
|
|
26
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
27
|
-
|
|
28
17
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
29
|
-
|
|
30
18
|
require("core-js/modules/es.array.for-each.js");
|
|
31
|
-
|
|
32
19
|
require("core-js/modules/es.object.to-string.js");
|
|
33
|
-
|
|
34
20
|
require("core-js/modules/es.array.reduce.js");
|
|
35
|
-
|
|
36
21
|
require("core-js/modules/es.object.keys.js");
|
|
37
|
-
|
|
38
22
|
require("core-js/modules/es.array.includes.js");
|
|
39
|
-
|
|
40
23
|
require("core-js/modules/es.string.includes.js");
|
|
41
|
-
|
|
42
24
|
require("core-js/modules/es.array.every.js");
|
|
43
|
-
|
|
44
25
|
require("core-js/modules/es.array.find.js");
|
|
45
|
-
|
|
46
26
|
require("core-js/modules/es.array.iterator.js");
|
|
47
|
-
|
|
48
27
|
require("core-js/modules/es.promise.js");
|
|
49
|
-
|
|
50
28
|
require("core-js/modules/es.string.iterator.js");
|
|
51
|
-
|
|
52
29
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
53
|
-
|
|
54
30
|
require("core-js/modules/es.array.map.js");
|
|
55
|
-
|
|
56
31
|
require("core-js/modules/web.dom-collections.for-each.js");
|
|
57
|
-
|
|
58
32
|
var _react = _interopRequireDefault(require("react"));
|
|
59
|
-
|
|
60
33
|
var _lodash = _interopRequireDefault(require("lodash.isnumber"));
|
|
61
|
-
|
|
62
34
|
var _server = _interopRequireDefault(require("react-dom/server"));
|
|
63
|
-
|
|
64
35
|
var _nextjsComponents = require("@blaze-cms/nextjs-components");
|
|
65
|
-
|
|
66
36
|
var _reactPageBuilder = require("@blaze-cms/react-page-builder");
|
|
67
|
-
|
|
68
37
|
var _getPath = _interopRequireDefault(require("./get-path"));
|
|
69
|
-
|
|
70
38
|
var _constants = require("../../constants");
|
|
71
|
-
|
|
72
39
|
var _excluded = ["elementTitle", "type", "propsToDisplay"];
|
|
73
|
-
|
|
74
40
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
75
|
-
|
|
76
41
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
77
|
-
|
|
78
42
|
var shapesArray = [];
|
|
79
43
|
var infoWindowArray = [];
|
|
80
|
-
|
|
81
44
|
var clearShapes = function clearShapes() {
|
|
82
45
|
if (shapesArray.length) {
|
|
83
46
|
shapesArray.forEach(function (shape) {
|
|
@@ -86,7 +49,6 @@ var clearShapes = function clearShapes() {
|
|
|
86
49
|
shapesArray.length = 0;
|
|
87
50
|
}
|
|
88
51
|
};
|
|
89
|
-
|
|
90
52
|
var closeInfoWindows = function closeInfoWindows() {
|
|
91
53
|
if (infoWindowArray.length) {
|
|
92
54
|
infoWindowArray.forEach(function (infoWindow) {
|
|
@@ -95,15 +57,13 @@ var closeInfoWindows = function closeInfoWindows() {
|
|
|
95
57
|
infoWindowArray.length = 0;
|
|
96
58
|
}
|
|
97
59
|
};
|
|
98
|
-
|
|
99
60
|
var addShapeListeners = function addShapeListeners(map, router, shape, imageData, shapeInstance) {
|
|
100
61
|
var _shape$enableInfoPane = shape.enableInfoPane,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
62
|
+
enableInfoPane = _shape$enableInfoPane === void 0 ? false : _shape$enableInfoPane,
|
|
63
|
+
_shape$dataSummaries = shape.dataSummaries,
|
|
64
|
+
dataSummaries = _shape$dataSummaries === void 0 ? [] : _shape$dataSummaries,
|
|
65
|
+
url = shape.url,
|
|
66
|
+
shapeData = shape.shapeData;
|
|
107
67
|
if (enableInfoPane) {
|
|
108
68
|
var infoWindow = new window.google.maps.InfoWindow({
|
|
109
69
|
content: ''
|
|
@@ -119,7 +79,6 @@ var addShapeListeners = function addShapeListeners(map, router, shape, imageData
|
|
|
119
79
|
_context.t0 = _server["default"];
|
|
120
80
|
_context.next = 4;
|
|
121
81
|
return infoWindowContent(imageData, dataSummaries, url, shapeData);
|
|
122
|
-
|
|
123
82
|
case 4:
|
|
124
83
|
_context.t1 = _context.sent;
|
|
125
84
|
content = _context.t0.renderToString.call(_context.t0, _context.t1);
|
|
@@ -127,7 +86,6 @@ var addShapeListeners = function addShapeListeners(map, router, shape, imageData
|
|
|
127
86
|
infoWindow.setPosition(event.latLng);
|
|
128
87
|
infoWindow.open(map, shapeInstance);
|
|
129
88
|
infoWindowArray.push(infoWindow);
|
|
130
|
-
|
|
131
89
|
case 10:
|
|
132
90
|
case "end":
|
|
133
91
|
return _context.stop();
|
|
@@ -135,7 +93,6 @@ var addShapeListeners = function addShapeListeners(map, router, shape, imageData
|
|
|
135
93
|
}
|
|
136
94
|
}, _callee);
|
|
137
95
|
}));
|
|
138
|
-
|
|
139
96
|
return function (_x) {
|
|
140
97
|
return _ref.apply(this, arguments);
|
|
141
98
|
};
|
|
@@ -146,13 +103,12 @@ var addShapeListeners = function addShapeListeners(map, router, shape, imageData
|
|
|
146
103
|
});
|
|
147
104
|
}
|
|
148
105
|
};
|
|
149
|
-
|
|
150
106
|
var setStyleOptions = function setStyleOptions(shape) {
|
|
151
107
|
var strokeColor = shape.strokeColor,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
108
|
+
strokeOpacity = shape.strokeOpacity,
|
|
109
|
+
strokeWeight = shape.strokeWeight,
|
|
110
|
+
fillColor = shape.fillColor,
|
|
111
|
+
fillOpacity = shape.fillOpacity;
|
|
156
112
|
var styleSettings = {
|
|
157
113
|
strokeColor: strokeColor,
|
|
158
114
|
fillColor: fillColor,
|
|
@@ -168,17 +124,14 @@ var setStyleOptions = function setStyleOptions(shape) {
|
|
|
168
124
|
return acc;
|
|
169
125
|
}, {}));
|
|
170
126
|
};
|
|
171
|
-
|
|
172
127
|
var areRectangleBoundsNumbers = function areRectangleBoundsNumbers(bounds) {
|
|
173
128
|
return bounds.every(function (bound) {
|
|
174
129
|
return (0, _lodash["default"])(bound);
|
|
175
130
|
});
|
|
176
131
|
};
|
|
177
|
-
|
|
178
132
|
var isPositionCorrect = function isPositionCorrect(lat, lng) {
|
|
179
133
|
return (0, _lodash["default"])(lat) && (0, _lodash["default"])(lng);
|
|
180
134
|
};
|
|
181
|
-
|
|
182
135
|
var getIconUrl = function getIconUrl(imageId, imageData) {
|
|
183
136
|
if (!imageId) return '';
|
|
184
137
|
var image = imageData.find(function (_ref2) {
|
|
@@ -188,11 +141,9 @@ var getIconUrl = function getIconUrl(imageId, imageData) {
|
|
|
188
141
|
if (!image || !image.url) return '';
|
|
189
142
|
return image.url;
|
|
190
143
|
};
|
|
191
|
-
|
|
192
144
|
var infoWindowContent = /*#__PURE__*/function () {
|
|
193
145
|
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(imageData, dataSummaries, url, shapeData) {
|
|
194
146
|
var summariesWithContent, _ref5, imageId, image, shouldShowImage, getImageElement;
|
|
195
|
-
|
|
196
147
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
197
148
|
while (1) {
|
|
198
149
|
switch (_context3.prev = _context3.next) {
|
|
@@ -212,15 +163,12 @@ var infoWindowContent = /*#__PURE__*/function () {
|
|
|
212
163
|
SummaryComponent = _reactPageBuilder.summaryComponents[type];
|
|
213
164
|
_context2.next = 7;
|
|
214
165
|
return SummaryComponent.render.preload();
|
|
215
|
-
|
|
216
166
|
case 7:
|
|
217
167
|
if (summaryPropsWithContent.length) {
|
|
218
168
|
_context2.next = 9;
|
|
219
169
|
break;
|
|
220
170
|
}
|
|
221
|
-
|
|
222
171
|
return _context2.abrupt("return", null);
|
|
223
|
-
|
|
224
172
|
case 9:
|
|
225
173
|
getDataSummaryComponent = function getDataSummaryComponent() {
|
|
226
174
|
var component = /*#__PURE__*/_react["default"].createElement(SummaryComponent, {
|
|
@@ -229,15 +177,12 @@ var infoWindowContent = /*#__PURE__*/function () {
|
|
|
229
177
|
elementTitle: elementTitle,
|
|
230
178
|
summaryPropsWithContent: summaryPropsWithContent
|
|
231
179
|
});
|
|
232
|
-
|
|
233
180
|
if (isTypeHeading && url) return /*#__PURE__*/_react["default"].createElement(_nextjsComponents.Link, {
|
|
234
181
|
href: url
|
|
235
182
|
}, component);
|
|
236
183
|
return component;
|
|
237
184
|
};
|
|
238
|
-
|
|
239
185
|
return _context2.abrupt("return", getDataSummaryComponent());
|
|
240
|
-
|
|
241
186
|
case 11:
|
|
242
187
|
case "end":
|
|
243
188
|
return _context2.stop();
|
|
@@ -245,12 +190,10 @@ var infoWindowContent = /*#__PURE__*/function () {
|
|
|
245
190
|
}
|
|
246
191
|
}, _callee2);
|
|
247
192
|
}));
|
|
248
|
-
|
|
249
193
|
return function (_x6) {
|
|
250
194
|
return _ref4.apply(this, arguments);
|
|
251
195
|
};
|
|
252
196
|
}()));
|
|
253
|
-
|
|
254
197
|
case 2:
|
|
255
198
|
summariesWithContent = _context3.sent;
|
|
256
199
|
_ref5 = shapeData || {}, imageId = _ref5.imageId;
|
|
@@ -259,25 +202,20 @@ var infoWindowContent = /*#__PURE__*/function () {
|
|
|
259
202
|
return id === imageId;
|
|
260
203
|
});
|
|
261
204
|
shouldShowImage = image && image.url;
|
|
262
|
-
|
|
263
205
|
getImageElement = function getImageElement() {
|
|
264
206
|
var imageUrl = image.url,
|
|
265
|
-
|
|
266
|
-
|
|
207
|
+
data = image.data;
|
|
267
208
|
var imageElement = /*#__PURE__*/_react["default"].createElement("img", {
|
|
268
209
|
className: "info__window",
|
|
269
210
|
src: imageUrl,
|
|
270
211
|
alt: data && data.altText ? data.altText : ''
|
|
271
212
|
});
|
|
272
|
-
|
|
273
213
|
if (url) return /*#__PURE__*/_react["default"].createElement(_nextjsComponents.Link, {
|
|
274
214
|
href: url
|
|
275
215
|
}, imageElement);
|
|
276
216
|
return imageElement;
|
|
277
217
|
};
|
|
278
|
-
|
|
279
218
|
return _context3.abrupt("return", /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, shouldShowImage && getImageElement(), summariesWithContent));
|
|
280
|
-
|
|
281
219
|
case 8:
|
|
282
220
|
case "end":
|
|
283
221
|
return _context3.stop();
|
|
@@ -285,24 +223,22 @@ var infoWindowContent = /*#__PURE__*/function () {
|
|
|
285
223
|
}
|
|
286
224
|
}, _callee3);
|
|
287
225
|
}));
|
|
288
|
-
|
|
289
226
|
return function infoWindowContent(_x2, _x3, _x4, _x5) {
|
|
290
227
|
return _ref3.apply(this, arguments);
|
|
291
228
|
};
|
|
292
229
|
}();
|
|
293
|
-
|
|
294
230
|
function getIcon(imageData, shape) {
|
|
295
231
|
var imageId = shape.imageId,
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
232
|
+
_shape$markerWidth = shape.markerWidth,
|
|
233
|
+
markerWidth = _shape$markerWidth === void 0 ? 50 : _shape$markerWidth,
|
|
234
|
+
_shape$markerHeight = shape.markerHeight,
|
|
235
|
+
markerHeight = _shape$markerHeight === void 0 ? 50 : _shape$markerHeight,
|
|
236
|
+
strokeColor = shape.strokeColor,
|
|
237
|
+
strokeOpacity = shape.strokeOpacity,
|
|
238
|
+
strokeWeight = shape.strokeWeight,
|
|
239
|
+
fillColor = shape.fillColor,
|
|
240
|
+
fillOpacity = shape.fillOpacity,
|
|
241
|
+
svgPath = shape.svgPath;
|
|
306
242
|
var iconUrl = getIconUrl(imageId, imageData);
|
|
307
243
|
var icon = iconUrl ? {
|
|
308
244
|
url: iconUrl,
|
|
@@ -323,13 +259,11 @@ function getIcon(imageData, shape) {
|
|
|
323
259
|
};
|
|
324
260
|
return svgMarker;
|
|
325
261
|
}
|
|
326
|
-
|
|
327
262
|
var setMarker = function setMarker(map, router, shape, imageData) {
|
|
328
263
|
var _shape$label = shape.label,
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
264
|
+
label = _shape$label === void 0 ? '' : _shape$label,
|
|
265
|
+
latitude = shape.latitude,
|
|
266
|
+
longitude = shape.longitude;
|
|
333
267
|
if (isPositionCorrect(latitude, longitude)) {
|
|
334
268
|
var svgMarker = getIcon(imageData, shape);
|
|
335
269
|
var marker = new window.google.maps.Marker({
|
|
@@ -346,11 +280,9 @@ var setMarker = function setMarker(map, router, shape, imageData) {
|
|
|
346
280
|
marker.setMap(map);
|
|
347
281
|
}
|
|
348
282
|
};
|
|
349
|
-
|
|
350
283
|
var setPolyline = function setPolyline(map, router, shape, imageData) {
|
|
351
284
|
var paths = shape.paths;
|
|
352
285
|
var path = (0, _getPath["default"])(paths);
|
|
353
|
-
|
|
354
286
|
if (path.length) {
|
|
355
287
|
var polyline = new window.google.maps.Polyline(_objectSpread({
|
|
356
288
|
path: path,
|
|
@@ -361,11 +293,9 @@ var setPolyline = function setPolyline(map, router, shape, imageData) {
|
|
|
361
293
|
polyline.setMap(map);
|
|
362
294
|
}
|
|
363
295
|
};
|
|
364
|
-
|
|
365
296
|
var setPolygon = function setPolygon(map, router, shape, imageData) {
|
|
366
297
|
var unParsedPaths = shape.paths;
|
|
367
298
|
var paths = (0, _getPath["default"])(unParsedPaths);
|
|
368
|
-
|
|
369
299
|
if (paths.length) {
|
|
370
300
|
var polygon = new window.google.maps.Polygon(_objectSpread({
|
|
371
301
|
paths: paths
|
|
@@ -375,13 +305,11 @@ var setPolygon = function setPolygon(map, router, shape, imageData) {
|
|
|
375
305
|
polygon.setMap(map);
|
|
376
306
|
}
|
|
377
307
|
};
|
|
378
|
-
|
|
379
308
|
var setRectangle = function setRectangle(map, router, shape, imageData) {
|
|
380
309
|
var northBound = shape.northBound,
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
310
|
+
southBound = shape.southBound,
|
|
311
|
+
eastBound = shape.eastBound,
|
|
312
|
+
westBound = shape.westBound;
|
|
385
313
|
if (areRectangleBoundsNumbers([northBound, southBound, eastBound, westBound])) {
|
|
386
314
|
var rectangle = new window.google.maps.Rectangle(_objectSpread(_objectSpread({}, setStyleOptions(shape)), {}, {
|
|
387
315
|
map: map,
|
|
@@ -397,12 +325,10 @@ var setRectangle = function setRectangle(map, router, shape, imageData) {
|
|
|
397
325
|
rectangle.setMap(map);
|
|
398
326
|
}
|
|
399
327
|
};
|
|
400
|
-
|
|
401
328
|
var setCircle = function setCircle(map, router, shape, imageData) {
|
|
402
329
|
var latitude = shape.latitude,
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
330
|
+
longitude = shape.longitude,
|
|
331
|
+
radius = shape.radius;
|
|
406
332
|
if (isPositionCorrect(latitude, longitude) && (0, _lodash["default"])(radius)) {
|
|
407
333
|
var circle = new window.google.maps.Circle(_objectSpread(_objectSpread({}, setStyleOptions(shape)), {}, {
|
|
408
334
|
map: map,
|
|
@@ -417,15 +343,13 @@ var setCircle = function setCircle(map, router, shape, imageData) {
|
|
|
417
343
|
circle.setMap(map);
|
|
418
344
|
}
|
|
419
345
|
};
|
|
420
|
-
|
|
421
346
|
var setShapes = function setShapes(map, router, shapes, imageData) {
|
|
422
347
|
var mapZoom = map.getZoom();
|
|
423
348
|
clearShapes();
|
|
424
349
|
shapes.forEach(function (shape) {
|
|
425
350
|
var type = shape.type,
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
351
|
+
minZoom = shape.minZoom,
|
|
352
|
+
maxZoom = shape.maxZoom;
|
|
429
353
|
if (mapZoom >= minZoom && mapZoom <= maxZoom) {
|
|
430
354
|
switch (type) {
|
|
431
355
|
case _constants.MARKER:
|
|
@@ -433,38 +357,32 @@ var setShapes = function setShapes(map, router, shapes, imageData) {
|
|
|
433
357
|
setMarker(map, router, shape, imageData);
|
|
434
358
|
break;
|
|
435
359
|
}
|
|
436
|
-
|
|
437
360
|
case _constants.POLYLINE:
|
|
438
361
|
{
|
|
439
362
|
setPolyline(map, router, shape, imageData);
|
|
440
363
|
break;
|
|
441
364
|
}
|
|
442
|
-
|
|
443
365
|
case _constants.POLYGON:
|
|
444
366
|
{
|
|
445
367
|
setPolygon(map, router, shape, imageData);
|
|
446
368
|
break;
|
|
447
369
|
}
|
|
448
|
-
|
|
449
370
|
case _constants.RECTANGLE:
|
|
450
371
|
{
|
|
451
372
|
setRectangle(map, router, shape, imageData);
|
|
452
373
|
break;
|
|
453
374
|
}
|
|
454
|
-
|
|
455
375
|
case _constants.CIRCLE:
|
|
456
376
|
{
|
|
457
377
|
setCircle(map, router, shape, imageData);
|
|
458
378
|
break;
|
|
459
379
|
}
|
|
460
|
-
|
|
461
380
|
default:
|
|
462
381
|
break;
|
|
463
382
|
}
|
|
464
383
|
}
|
|
465
384
|
});
|
|
466
385
|
};
|
|
467
|
-
|
|
468
386
|
var _default = setShapes;
|
|
469
387
|
exports["default"] = _default;
|
|
470
388
|
//# sourceMappingURL=set-shapes.js.map
|