@abcagency/hc-ui-components 1.3.1 → 1.3.2
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/.eslintrc
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"rules": {
|
|
45
45
|
"strict": 0,
|
|
46
46
|
"semi": ["error", "always"],
|
|
47
|
-
"indent": ["error", "tab"],
|
|
47
|
+
"indent": ["error", "tab", { "SwitchCase": 1 }],
|
|
48
48
|
"comma-dangle": ["error", "never"],
|
|
49
49
|
"arrow-parens": ["error", "as-needed"],
|
|
50
50
|
"object-curly-spacing": ["error", "always"],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useRef, useEffect } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { GoogleMap, MarkerClustererF } from '@react-google-maps/api';
|
|
3
3
|
import MapMarker from './map-marker.js';
|
|
4
4
|
import PlaceMarker from './place-marker.js';
|
|
5
5
|
import ShowAllButton from '../buttons/show-all-button.js';
|
|
@@ -9,6 +9,7 @@ import { useMapList } from '../../../contexts/mapListContext.js';
|
|
|
9
9
|
import { pinIcon, markerIcon, markerIconSelected } from '../../../util/mapIconUtil.js';
|
|
10
10
|
import { clusterOptions } from '../../../util/mapUtil.js';
|
|
11
11
|
|
|
12
|
+
/* eslint-disable no-undef */
|
|
12
13
|
var Map = function Map(_ref) {
|
|
13
14
|
var markerConfigs = _ref.markerConfigs,
|
|
14
15
|
infoWindowClasses = _ref.infoWindowClasses,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.js","sources":["../../../../src/components/modules/maps/map.js"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport { GoogleMap, MarkerClustererF, google } from \"@react-google-maps/api\";\n\nimport MapMarker from \"~/components/modules/maps/map-marker\";\nimport PlaceMarker from \"~/components/modules/maps/place-marker\";\nimport ShowAllButton from \"~/components/modules/buttons/show-all-button\";\n\nimport { usePlaces } from \"~/contexts/placesContext\";\nimport { useMap } from \"~/contexts/mapContext\";\nimport { useMapList } from \"~/contexts/mapListContext\";\n\nimport { markerIconSelected, markerIcon, pinIcon } from \"~/util/mapIconUtil\";\nimport { clusterOptions } from \"~/util/mapUtil\";\n\nconst Map = ({\n\tmarkerConfigs,\n\tinfoWindowClasses,\n\tclusterGridSize = 60\n}) => {\n\tconst {\n\t\tlocation,\n\t\tzoom,\n\t\tcenter,\n\t\tselectLocationEntity,\n\t\tsetLocation,\n\t\tmapInteracted,\n\t\tsetMapInteracted\n\t} = useMap();\n\n\tconst {\n\t\tmapItems, filteredListings, setSelectedFilters,\n\t\tsetQuery\n\t} = useMapList();\n\n\tconst mapRef = useRef();\n\tconst markerRefs = useRef({});\n\tconst mapContainerRef = useRef(null);\n\tconst {\n\t\tpoiMarkers,\n\t\tsetCurrentCenter,\n\t\tcurrentCenter,\n\t\tsetCurrentZoom,\n\t\tcurrentZoom,\n\t\tselectedPlaceMarker,\n\t\tsetSelectedPlaceMarker,\n\t\tplacesWindow,\n\t\tsetPlacesWindow } = usePlaces();\n\n\tconst onIdle = () => {\n\t\tif (!currentCenter || !mapRef.current) return;\n\t\tconst newCenter = mapRef.current.getCenter().toJSON();\n\t\tconst newZoom = mapRef.current.zoom;\n\n\t\tsetCurrentCenter(newCenter);\n\n\t\tif (newZoom != currentZoom) {\n\t\t\tsetCurrentZoom(newZoom);\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tif (mapContainerRef.current) {\n\t\t\tconst handleScroll = () => {\n\t\t\t\tsetMapInteracted(true);\n\t\t\t};\n\t\t\tvar mapContainerRefCurrent = mapContainerRef.current;\n\t\t\tmapContainerRef.current.addEventListener('wheel', handleScroll);\n\t\t\treturn () => mapContainerRefCurrent.removeEventListener('wheel', handleScroll);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [mapContainerRef.current]);\n\n\tuseEffect(() => {\n\t\tif (mapRef.current) {\n\t\t\tconst mapInstance = mapRef.current;\n\t\t\tconst dragStartListener = mapInstance.addListener('dragstart', () => setMapInteracted(true));\n\t\t\tconst mouseDownListener = mapInstance.addListener('mousedown', () => setMapInteracted(true));\n\t\t\treturn () => {\n\t\t\t\tgoogle.maps.event.removeListener(dragStartListener);\n\t\t\t\tgoogle.maps.event.removeListener(mouseDownListener);\n\t\t\t};\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [mapRef.current, mapContainerRef.current]);\n\n\tuseEffect(() => {\n\t\tif ((mapItems && mapItems.length > 0 || poiMarkers.length > 0) && mapRef.current) {\n\t\t\tfitBounds(mapRef.current);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [mapItems, mapRef.current, location]);\n\n\tuseEffect(() => {\n\t\tif (mapItems && mapItems.length > 0 || poiMarkers.length > 0 && mapRef.current && mapInteracted) {\n\t\t\tfitBounds(mapRef.current, true);\n\t\t}\n\t\tif (mapRef.current) {\n\t\t\tlet currZoom = mapRef.current.zoom;\n\t\t\tlet setZoomVal = currZoom < 13 ? currZoom : 12;\n\t\t\tmapRef.current.setZoom(setZoomVal);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [filteredListings]);\n\n\tuseEffect(() => {\n\t\tif (!mapRef.current || !location || mapInteracted) return;\n\t\tmapRef.current.panTo(\n\t\t\tnew google.maps.LatLng(location.latitude, location.longitude)\n\t\t);\n\t\tif (mapRef.current) {\n\t\t\tlet setZoomVal = zoom < 13 ? zoom : 12;\n\t\t\tmapRef.current.setZoom(setZoomVal);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [location, zoom, mapRef.current]);\n\n\tconst fitBounds = (map, overload = false) => {\n\t\tif ((mapInteracted === false || overload) && mapItems != null) {\n\t\t\tconst bounds = new window.google.maps.LatLngBounds();\n\t\t\tmapItems.forEach(item => {\n\t\t\t\tbounds.extend(new google.maps.LatLng(item.latitude, item.longitude));\n\t\t\t});\n\t\t\tif (!map) return;\n\t\t\tmap.fitBounds(bounds);\n\t\t}\n\t\tif (mapRef.current.zoom > 17) {\n\t\t\tmapRef.current.setZoom(16);\n\t\t}\n\t};\n\n\tconst markerClickHandler = mapLocation => {\n\t\tsetMapInteracted(true);\n\t\tselectLocationEntity(mapLocation);\n\t};\n\n\tconst onLoad = map => {\n\t\tif (!location || location === null) {\n\t\t\tmapRef.current = map;\n\t\t\tfitBounds(map, true);\n\t\t\treturn;\n\t\t}\n\t\tmapRef.current = map;\n\n\t\tif (mapInteracted === false) {\n\t\t\tmapRef.current.panTo(\n\t\t\t\tnew google.maps.LatLng(location.latitude, location.longitude)\n\t\t\t);\n\n\t\t\tmapRef.current.setZoom(zoom);\n\t\t}\n\t};\n\n\tconst pinIconUrl = pinIcon({\n\t\tfillColor: markerConfigs.fillColor,\n\t\tstrokeColor: markerConfigs.strokeColor\n\t});\n\n\treturn (\n\t\t<>{zoom && center && <div ref={mapContainerRef} className=\"hc-h-full hc-relative\">\n\t\t\t<GoogleMap\n\t\t\t\tzoom={zoom}\n\t\t\t\tonLoad={onLoad}\n\t\t\t\tonIdle={onIdle}\n\t\t\t\tcenter={center}\n\t\t\t\tmapContainerStyle={{\n\t\t\t\t\twidth: \"100%\",\n\t\t\t\t\theight: \"100%\"\n\t\t\t\t}}\n\t\t\t\toptions={{\n\t\t\t\t\tstyles: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfeatureType: \"poi\",\n\t\t\t\t\t\t\telementType: \"labels\",\n\t\t\t\t\t\t\tstylers: [{ visibility: \"off\" }]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<MarkerClustererF options={clusterOptions(clusterGridSize, markerConfigs.fillColor)}>\n\t\t\t\t\t{clusterer => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{mapItems.map(item => (\n\t\t\t\t\t\t\t\t<MapMarker\n\t\t\t\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t\t\t\titem={item}\n\t\t\t\t\t\t\t\t\tselectedLocation={location}\n\t\t\t\t\t\t\t\t\tmarkerRefs={markerRefs}\n\t\t\t\t\t\t\t\t\tinfoWindowClasses={infoWindowClasses}\n\t\t\t\t\t\t\t\t\tsetSelectedLocation={setLocation}\n\t\t\t\t\t\t\t\t\tmarkerClickHandler={markerClickHandler}\n\t\t\t\t\t\t\t\t\tclusterer={clusterer}\n\t\t\t\t\t\t\t\t\tmarkerIcon={markerIcon(markerConfigs)}\n\t\t\t\t\t\t\t\t\tmarkerIconSelected={markerIconSelected(markerConfigs)}\n\t\t\t\t\t\t\t\t\tsetMapInteracted={setMapInteracted}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t{poiMarkers && poiMarkers.markers.map((marker, index) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<PlaceMarker\n\t\t\t\t\t\t\t\t\t\tkey={`marker-${marker.title}-${index}`}\n\t\t\t\t\t\t\t\t\t\tmarker={marker}\n\t\t\t\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\t\t\t\tselectedPlaceMarker={selectedPlaceMarker}\n\t\t\t\t\t\t\t\t\t\tplacesWindow={placesWindow}\n\t\t\t\t\t\t\t\t\t\tsetPlacesWindow={setPlacesWindow}\n\t\t\t\t\t\t\t\t\t\tsetSelectedPlaceMarker={setSelectedPlaceMarker}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t</>\n\t\t\t\t\t)}\n\t\t\t\t</MarkerClustererF>\n\t\t\t</GoogleMap>\n\t\t\t{mapInteracted && markerConfigs && (\n\t\t\t\t<ShowAllButton\n\t\t\t\t\tmapInteracted={mapInteracted}\n\t\t\t\t\tmarkerConfigs={markerConfigs}\n\t\t\t\t\tsetMapInteracted={setMapInteracted}\n\t\t\t\t\tfitBounds={fitBounds}\n\t\t\t\t\tmapRef={mapRef}\n\t\t\t\t\tpinIconUrl={pinIconUrl}\n\t\t\t\t\tsetQuery={setQuery}\n\t\t\t\t\tlistingCount={filteredListings.length}\n\t\t\t\t\tsetSelectedFilters={setSelectedFilters}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t\t}\n\t\t</>\n\t);\n};\n\nexport default Map;\n"],"names":["Map","_ref","markerConfigs","infoWindowClasses","_ref$clusterGridSize","clusterGridSize","_useMap","useMap","location","zoom","center","selectLocationEntity","setLocation","mapInteracted","setMapInteracted","_useMapList","useMapList","mapItems","filteredListings","setSelectedFilters","setQuery","mapRef","useRef","markerRefs","mapContainerRef","_usePlaces","usePlaces","poiMarkers","setCurrentCenter","currentCenter","setCurrentZoom","currentZoom","selectedPlaceMarker","setSelectedPlaceMarker","placesWindow","setPlacesWindow","onIdle","current","newCenter","getCenter","toJSON","newZoom","useEffect","handleScroll","mapContainerRefCurrent","addEventListener","removeEventListener","mapInstance","dragStartListener","addListener","mouseDownListener","google","maps","event","removeListener","length","fitBounds","currZoom","setZoomVal","setZoom","panTo","LatLng","latitude","longitude","map","overload","arguments","undefined","bounds","window","LatLngBounds","forEach","item","extend","markerClickHandler","mapLocation","onLoad","pinIconUrl","pinIcon","fillColor","strokeColor","React","createElement","Fragment","ref","className","GoogleMap","mapContainerStyle","width","height","options","styles","featureType","elementType","stylers","visibility","MarkerClustererF","clusterOptions","clusterer","MapMarker","key","id","selectedLocation","setSelectedLocation","markerIcon","markerIconSelected","markers","marker","index","PlaceMarker","concat","title","ShowAllButton","listingCount"],"mappings":";;;;;;;;;;;AAcA,IAAMA,GAAG,GAAG,SAANA,GAAGA,CAAAC,IAAA,EAIH;AAAA,EAAA,IAHLC,aAAa,GAAAD,IAAA,CAAbC,aAAa;IACbC,iBAAiB,GAAAF,IAAA,CAAjBE,iBAAiB;IAAAC,oBAAA,GAAAH,IAAA,CACjBI,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAAG,KA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AA,UAAU,EAAEA,UAAW;AACvBzD,IAAAA,QAAQ,EAAEA,QAAS;IACnB6F,YAAY,EAAE/F,gBAAgB,CAACqC,MAAO;AACtCpC,IAAAA,kBAAkB,EAAEA,kBAAAA;GACpB,CAEE,CAEH,CAAC,CAAA;AAEL;;;;"}
|
|
1
|
+
{"version":3,"file":"map.js","sources":["../../../../src/components/modules/maps/map.js"],"sourcesContent":["/* eslint-disable no-undef */\nimport React, { useEffect, useRef } from 'react';\nimport { GoogleMap, MarkerClustererF } from \"@react-google-maps/api\";\n\nimport MapMarker from \"~/components/modules/maps/map-marker\";\nimport PlaceMarker from \"~/components/modules/maps/place-marker\";\nimport ShowAllButton from \"~/components/modules/buttons/show-all-button\";\n\nimport { usePlaces } from \"~/contexts/placesContext\";\nimport { useMap } from \"~/contexts/mapContext\";\nimport { useMapList } from \"~/contexts/mapListContext\";\n\nimport { markerIconSelected, markerIcon, pinIcon } from \"~/util/mapIconUtil\";\nimport { clusterOptions } from \"~/util/mapUtil\";\n\nconst Map = ({\n\tmarkerConfigs,\n\tinfoWindowClasses,\n\tclusterGridSize = 60\n}) => {\n\tconst {\n\t\tlocation,\n\t\tzoom,\n\t\tcenter,\n\t\tselectLocationEntity,\n\t\tsetLocation,\n\t\tmapInteracted,\n\t\tsetMapInteracted\n\t} = useMap();\n\n\tconst {\n\t\tmapItems, filteredListings, setSelectedFilters,\n\t\tsetQuery\n\t} = useMapList();\n\n\tconst mapRef = useRef();\n\tconst markerRefs = useRef({});\n\tconst mapContainerRef = useRef(null);\n\tconst {\n\t\tpoiMarkers,\n\t\tsetCurrentCenter,\n\t\tcurrentCenter,\n\t\tsetCurrentZoom,\n\t\tcurrentZoom,\n\t\tselectedPlaceMarker,\n\t\tsetSelectedPlaceMarker,\n\t\tplacesWindow,\n\t\tsetPlacesWindow } = usePlaces();\n\n\tconst onIdle = () => {\n\t\tif (!currentCenter || !mapRef.current) return;\n\t\tconst newCenter = mapRef.current.getCenter().toJSON();\n\t\tconst newZoom = mapRef.current.zoom;\n\n\t\tsetCurrentCenter(newCenter);\n\n\t\tif (newZoom != currentZoom) {\n\t\t\tsetCurrentZoom(newZoom);\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tif (mapContainerRef.current) {\n\t\t\tconst handleScroll = () => {\n\t\t\t\tsetMapInteracted(true);\n\t\t\t};\n\t\t\tvar mapContainerRefCurrent = mapContainerRef.current;\n\t\t\tmapContainerRef.current.addEventListener('wheel', handleScroll);\n\t\t\treturn () => mapContainerRefCurrent.removeEventListener('wheel', handleScroll);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [mapContainerRef.current]);\n\n\tuseEffect(() => {\n\t\tif (mapRef.current) {\n\t\t\tconst mapInstance = mapRef.current;\n\t\t\tconst dragStartListener = mapInstance.addListener('dragstart', () => setMapInteracted(true));\n\t\t\tconst mouseDownListener = mapInstance.addListener('mousedown', () => setMapInteracted(true));\n\t\t\treturn () => {\n\t\t\t\tgoogle.maps.event.removeListener(dragStartListener);\n\t\t\t\tgoogle.maps.event.removeListener(mouseDownListener);\n\t\t\t};\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [mapRef.current, mapContainerRef.current]);\n\n\tuseEffect(() => {\n\t\tif ((mapItems && mapItems.length > 0 || poiMarkers.length > 0) && mapRef.current) {\n\t\t\tfitBounds(mapRef.current);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [mapItems, mapRef.current, location]);\n\n\tuseEffect(() => {\n\t\tif (mapItems && mapItems.length > 0 || poiMarkers.length > 0 && mapRef.current && mapInteracted) {\n\t\t\tfitBounds(mapRef.current, true);\n\t\t}\n\t\tif (mapRef.current) {\n\t\t\tlet currZoom = mapRef.current.zoom;\n\t\t\tlet setZoomVal = currZoom < 13 ? currZoom : 12;\n\t\t\tmapRef.current.setZoom(setZoomVal);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [filteredListings]);\n\n\tuseEffect(() => {\n\t\tif (!mapRef.current || !location || mapInteracted) return;\n\t\tmapRef.current.panTo(\n\t\t\tnew google.maps.LatLng(location.latitude, location.longitude)\n\t\t);\n\t\tif (mapRef.current) {\n\t\t\tlet setZoomVal = zoom < 13 ? zoom : 12;\n\t\t\tmapRef.current.setZoom(setZoomVal);\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [location, zoom, mapRef.current]);\n\n\tconst fitBounds = (map, overload = false) => {\n\t\tif ((mapInteracted === false || overload) && mapItems != null) {\n\t\t\tconst bounds = new window.google.maps.LatLngBounds();\n\t\t\tmapItems.forEach(item => {\n\t\t\t\tbounds.extend(new google.maps.LatLng(item.latitude, item.longitude));\n\t\t\t});\n\t\t\tif (!map) return;\n\t\t\tmap.fitBounds(bounds);\n\t\t}\n\t\tif (mapRef.current.zoom > 17) {\n\t\t\tmapRef.current.setZoom(16);\n\t\t}\n\t};\n\n\tconst markerClickHandler = mapLocation => {\n\t\tsetMapInteracted(true);\n\t\tselectLocationEntity(mapLocation);\n\t};\n\n\tconst onLoad = map => {\n\t\tif (!location || location === null) {\n\t\t\tmapRef.current = map;\n\t\t\tfitBounds(map, true);\n\t\t\treturn;\n\t\t}\n\t\tmapRef.current = map;\n\n\t\tif (mapInteracted === false) {\n\t\t\tmapRef.current.panTo(\n\t\t\t\tnew google.maps.LatLng(location.latitude, location.longitude)\n\t\t\t);\n\n\t\t\tmapRef.current.setZoom(zoom);\n\t\t}\n\t};\n\n\tconst pinIconUrl = pinIcon({\n\t\tfillColor: markerConfigs.fillColor,\n\t\tstrokeColor: markerConfigs.strokeColor\n\t});\n\n\treturn (\n\t\t<>{zoom && center && <div ref={mapContainerRef} className=\"hc-h-full hc-relative\">\n\t\t\t<GoogleMap\n\t\t\t\tzoom={zoom}\n\t\t\t\tonLoad={onLoad}\n\t\t\t\tonIdle={onIdle}\n\t\t\t\tcenter={center}\n\t\t\t\tmapContainerStyle={{\n\t\t\t\t\twidth: \"100%\",\n\t\t\t\t\theight: \"100%\"\n\t\t\t\t}}\n\t\t\t\toptions={{\n\t\t\t\t\tstyles: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfeatureType: \"poi\",\n\t\t\t\t\t\t\telementType: \"labels\",\n\t\t\t\t\t\t\tstylers: [{ visibility: \"off\" }]\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<MarkerClustererF options={clusterOptions(clusterGridSize, markerConfigs.fillColor)}>\n\t\t\t\t\t{clusterer => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{mapItems.map(item => (\n\t\t\t\t\t\t\t\t<MapMarker\n\t\t\t\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t\t\t\titem={item}\n\t\t\t\t\t\t\t\t\tselectedLocation={location}\n\t\t\t\t\t\t\t\t\tmarkerRefs={markerRefs}\n\t\t\t\t\t\t\t\t\tinfoWindowClasses={infoWindowClasses}\n\t\t\t\t\t\t\t\t\tsetSelectedLocation={setLocation}\n\t\t\t\t\t\t\t\t\tmarkerClickHandler={markerClickHandler}\n\t\t\t\t\t\t\t\t\tclusterer={clusterer}\n\t\t\t\t\t\t\t\t\tmarkerIcon={markerIcon(markerConfigs)}\n\t\t\t\t\t\t\t\t\tmarkerIconSelected={markerIconSelected(markerConfigs)}\n\t\t\t\t\t\t\t\t\tsetMapInteracted={setMapInteracted}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t{poiMarkers && poiMarkers.markers.map((marker, index) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<PlaceMarker\n\t\t\t\t\t\t\t\t\t\tkey={`marker-${marker.title}-${index}`}\n\t\t\t\t\t\t\t\t\t\tmarker={marker}\n\t\t\t\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\t\t\t\tselectedPlaceMarker={selectedPlaceMarker}\n\t\t\t\t\t\t\t\t\t\tplacesWindow={placesWindow}\n\t\t\t\t\t\t\t\t\t\tsetPlacesWindow={setPlacesWindow}\n\t\t\t\t\t\t\t\t\t\tsetSelectedPlaceMarker={setSelectedPlaceMarker}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t</>\n\t\t\t\t\t)}\n\t\t\t\t</MarkerClustererF>\n\t\t\t</GoogleMap>\n\t\t\t{mapInteracted && markerConfigs && (\n\t\t\t\t<ShowAllButton\n\t\t\t\t\tmapInteracted={mapInteracted}\n\t\t\t\t\tmarkerConfigs={markerConfigs}\n\t\t\t\t\tsetMapInteracted={setMapInteracted}\n\t\t\t\t\tfitBounds={fitBounds}\n\t\t\t\t\tmapRef={mapRef}\n\t\t\t\t\tpinIconUrl={pinIconUrl}\n\t\t\t\t\tsetQuery={setQuery}\n\t\t\t\t\tlistingCount={filteredListings.length}\n\t\t\t\t\tsetSelectedFilters={setSelectedFilters}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t\t}\n\t\t</>\n\t);\n};\n\nexport default Map;\n"],"names":["Map","_ref","markerConfigs","infoWindowClasses","_ref$clusterGridSize","clusterGridSize","_useMap","useMap","location","zoom","center","selectLocationEntity","setLocation","mapInteracted","setMapInteracted","_useMapList","useMapList","mapItems","filteredListings","setSelectedFilters","setQuery","mapRef","useRef","markerRefs","mapContainerRef","_usePlaces","usePlaces","poiMarkers","setCurrentCenter","currentCenter","setCurrentZoom","currentZoom","selectedPlaceMarker","setSelectedPlaceMarker","placesWindow","setPlacesWindow","onIdle","current","newCenter","getCenter","toJSON","newZoom","useEffect","handleScroll","mapContainerRefCurrent","addEventListener","removeEventListener","mapInstance","dragStartListener","addListener","mouseDownListener","google","maps","event","removeListener","length","fitBounds","currZoom","setZoomVal","setZoom","panTo","LatLng","latitude","longitude","map","overload","arguments","undefined","bounds","window","LatLngBounds","forEach","item","extend","markerClickHandler","mapLocation","onLoad","pinIconUrl","pinIcon","fillColor","strokeColor","React","createElement","Fragment","ref","className","GoogleMap","mapContainerStyle","width","height","options","styles","featureType","elementType","stylers","visibility","MarkerClustererF","clusterOptions","clusterer","MapMarker","key","id","selectedLocation","setSelectedLocation","markerIcon","markerIconSelected","markers","marker","index","PlaceMarker","concat","title","ShowAllButton","listingCount"],"mappings":";;;;;;;;;;;AAAA;AAeA,IAAMA,GAAG,GAAG,SAANA,GAAGA,CAAAC,IAAA,EAIH;AAAA,EAAA,IAHLC,aAAa,GAAAD,IAAA,CAAbC,aAAa;IACbC,iBAAiB,GAAAF,IAAA,CAAjBE,iBAAiB;IAAAC,oBAAA,GAAAH,IAAA,CACjBI,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,oBAAA,CAAA;AAEpB,EAAA,IAAAE,OAAA,GAQIC,MAAM,EAAE;IAPXC,QAAQ,GAAAF,OAAA,CAARE,QAAQ;IACRC,IAAI,GAAAH,OAAA,CAAJG,IAAI;IACJC,MAAM,GAAAJ,OAAA,CAANI,MAAM;IACNC,oBAAoB,GAAAL,OAAA,CAApBK,oBAAoB;IACpBC,WAAW,GAAAN,OAAA,CAAXM,WAAW;IACXC,aAAa,GAAAP,OAAA,CAAbO,aAAa;IACbC,gBAAgB,GAAAR,OAAA,CAAhBQ,gBAAgB,CAAA;AAGjB,EAAA,IAAAC,WAAA,GAGIC,UAAU,EAAE;IAFfC,QAAQ,GAAAF,WAAA,CAARE,QAAQ;IAAEC,gBAAgB,GAAAH,WAAA,CAAhBG,gBAAgB;IAAEC,kBAAkB,GAAAJ,WAAA,CAAlBI,kBAAkB;IAC9CC,QAAQ,GAAAL,WAAA,CAARK,QAAQ,CAAA;AAGT,EAAA,IAAMC,MAAM,GAAGC,MAAM,EAAE,CAAA;AACvB,EAAA,IAAMC,UAAU,GAAGD,MAAM,CAAC,EAAE,CAAC,CAAA;AAC7B,EAAA,IAAME,eAAe,GAAGF,M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QAAAA,mBAAmB,EAAEA,mBAAoB;AACzCE,QAAAA,YAAY,EAAEA,YAAa;AAC3BC,QAAAA,eAAe,EAAEA,eAAgB;AACjCF,QAAAA,sBAAsB,EAAEA,sBAAAA;AAAuB,OAC/C,CAAC,CAAA;AAEJ,KAAC,CACA,CAAC,CAAA;GAEa,CACR,CAAC,EACXpB,aAAa,IAAIX,aAAa,iBAC9B+E,KAAA,CAAAC,aAAA,CAAC8B,aAAa,EAAA;AACbnG,IAAAA,aAAa,EAAEA,aAAc;AAC7BX,IAAAA,aAAa,EAAEA,aAAc;AAC7BY,IAAAA,gBAAgB,EAAEA,gBAAiB;AACnC0C,IAAAA,SAAS,EAAEA,SAAU;AACrBnC,IAAAA,MAAM,EAAEA,MAAO;AACfwD,IAAAA,UAAU,EAAEA,UAAW;AACvBzD,IAAAA,QAAQ,EAAEA,QAAS;IACnB6F,YAAY,EAAE/F,gBAAgB,CAACqC,MAAO;AACtCpC,IAAAA,kBAAkB,EAAEA,kBAAAA;GACpB,CAEE,CAEH,CAAC,CAAA;AAEL;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapIconUtil.js","sources":["../../src/util/mapIconUtil.js"],"sourcesContent":["import { placeTypes } from '~/constants/placeTypes';\n\nconst customSVGIcon = (\n\ttype,\n\tfillColor = \"#FFFFFF\",\n\tstrokeColor = \"#000000\",\n\tbackgroundFill = \"#000000\",\n\tbackgroundStroke = \"#000000\"\n) => {\n\tlet svg = \"\";\n\tswitch (type) {\n\tcase placeTypes.FOOD:\n\t\tsvg = `\n\t\t\t\t\t<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M25.7,36.6l0.6,15.8c0.1,2.4-2.3,2.4-2.3,2.4s-2.4,0-2.3-2.4l0.6-15.8c0.1-2-4.3-2.9-4-4.9l2.3-13.3h1.1\n\t\t\t\t\t\tl-0.6,9.7l1.7,1.2l0.6-10.9h1.1l0.6,10.9l1.7-1.2l-0.6-9.7h1.1l2.3,13.3C29.7,33.7,25.6,34.6,25.7,36.6z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M40,52.4c0,2.4-2.3,2.4-2.3,2.4s-2.5,0-2.3-2.4L36.6,39c-0.9,0-3.4-0.4-3.4-2.4v-6.1c0-2.4,0.3-6.4,1.2-8.2\n\t\t\t\t\t\tc1.1-2.4,3.9-4,5.6-4C40,18.3,40,52.4,40,52.4z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\tbreak;\n\tcase placeTypes.TOURIST_ATTRACTION:\n\t\tsvg = `<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M27,18.5c-1.2,0-1.7,1.1-2.2,2.2L23.7,23h-4.5c-1.9,0-3.4,1.5-3.4,3.4v11.2c0,1.9,1.5,3.4,3.4,3.4h22.5\n\t\t\t\t\t\tc1.9,0,3.4-1.5,3.4-3.4V26.4c0-1.9-1.5-3.4-3.4-3.4h-4.5L36,20.8c-0.6-1.1-1-2.2-2.2-2.2H27z M19.2,25.3c0.6,0,1.1,0.5,1.1,1.1\n\t\t\t\t\t\tc0,0.6-0.5,1.1-1.1,1.1c-0.6,0-1.1-0.5-1.1-1.1C18,25.8,18.5,25.3,19.2,25.3z M30.4,25.3c3.7,0,6.7,3,6.7,6.7s-3,6.7-6.7,6.7\n\t\t\t\t\t\ts-6.7-3-6.7-6.7S26.7,25.3,30.4,25.3z M30.4,28.7c-1.9,0-3.4,1.5-3.4,3.4s1.5,3.4,3.4,3.4c1.9,0,3.4-1.5,3.4-3.4\n\t\t\t\t\t\tS32.3,28.7,30.4,28.7z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\tbreak;\n\tcase placeTypes.SCHOOL:\n\t\tsvg = `\n\t\t\t\t\t<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M39.2,40.6c0,0-4.1,4.6-9.1,4.6S21,40.6,21,40.6v-5.2l9.1,5l9.1-5V40.6z\"/>\n\t\t\t\t\t<polygon class=\"st0\" points=\"44.4,40.4 41.8,40.4 41.8,31.4 30.1,37.8 15.8,30 30.1,22.2 44.4,30 \"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\tbreak;\n\tcase placeTypes.STORE:\n\t\tsvg = `<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<g>\n\t\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t</g>\n\t\t\t\t\t<path class=\"st0\" d=\"M45.4,27.7L42,41.1c-0.1,0.6-0.7,1-1.3,1c1.8,0,3.3,1.5,3.3,3.3s-1.5,3.3-3.3,3.3s-3.3-1.5-3.3-3.3\n\t\t\t\t\t\ts1.5-3.3,3.3-3.3H23.3c1.8,0,3.3,1.5,3.3,3.3s-1.5,3.3-3.3,3.3S20,47.2,20,45.4s1.5-3.3,3.3-3.3c-0.6,0-1.2-0.4-1.3-1l-4.1-16.4\n\t\t\t\t\t\th-1.3c-0.7,0-1.3-0.6-1.3-1.3s0.6-1.3,1.3-1.3h2.3c0.6,0,1.2,0.4,1.3,1l0.8,3h23.1c0.4,0,0.8,0.2,1.1,0.5\n\t\t\t\t\t\tC45.4,26.9,45.5,27.3,45.4,27.7z\"/>\n\t\t\t\t\t<path d=\"M41.4,45.5c0-0.4-0.3-0.7-0.7-0.7S40,45.1,40,45.5C40.1,46.2,41.4,46.2,41.4,45.5z\"/>\n\t\t\t\t\t<path d=\"M24,45.5c0-0.4-0.3-0.7-0.7-0.7s-0.7,0.3-0.7,0.7C22.6,46.2,24,46.2,24,45.5z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\tbreak;\n\tcase placeTypes.TRANSIT_STATION:\n\t\tsvg = `<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<g>\n\t\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t</g>\n\t\t\t\t\t<path class=\"st0\" d=\"M26.3,41.3h-2.8L20.7,44h-1.4v-1.4l1.4-1.4c-2.3,0-4.2-1.9-4.2-4.2V26c0-2.3,1.9-4.2,4.2-4.2h9.7\n\t\t\t\t\t\tc2.3,0,4.2,1.9,4.2,4.2v1.4h-2.8v-2.8H19.3v9.7h6.9v7H26.3z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M44.3,43c0,0.5-0.4,1-1,1h-0.8c-0.5,0-1-0.5-1-1.1v-1.7H30.4V43c0,0.5-0.4,1.1-0.9,1.1h-0.9c-0.5,0-1-0.5-1-1\n\t\t\t\t\t\tv-7.6l2-5.7c0.2-0.6,0.7-0.9,1.4-0.9h10c0.6,0,1.1,0.4,1.3,0.9l2,5.7V43z\"/>\n\t\t\t\t\t<circle cx=\"20.7\" cy=\"37.1\" r=\"1.4\"/>\n\t\t\t\t\t<circle cx=\"41.5\" cy=\"37.1\" r=\"1.4\"/>\n\t\t\t\t\t<circle cx=\"30.4\" cy=\"37.1\" r=\"1.4\"/>\n\t\t\t\t\t<polygon points=\"31,30.2 29.6,34.4 42.4,34.4 40.9,30.2 \"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\tbreak;\n\tcase placeTypes.PLACE_OF_WORSHIP:\n\t\tsvg = `<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M21.3,40.8h-3.8c-1.3,0-2.3-1-2.3-2.3v-4.3c0-0.8,0.5-1.6,1.2-2l4.9-2.7V40.8z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M38,40.8h-4.6v-4.6c0-1.7-1.4-3-3-3c-1.7,0-3,1.4-3,3v4.6h-4.6V30c0-0.8,0.4-1.5,1.1-2l1.9-1.2v-5.1l0,0\n\t\t\t\t\t\tc0-0.4,0.2-0.8,0.4-1.1l3.6-3.6c0.3-0.3,0.8-0.3,1.1,0l3.6,3.6c0.3,0.3,0.4,0.7,0.4,1.1v5.1l1.9,1.2c0.7,0.4,1.1,1.2,1.1,2L38,40.8\n\t\t\t\t\t\tL38,40.8z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M45.6,38.5c0,1.3-1,2.3-2.3,2.3h-3.8V29.5l4.9,2.7c0.7,0.4,1.2,1.2,1.2,2C45.6,34.2,45.6,38.5,45.6,38.5z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\tbreak;\n\t}\n\n\tconst iconUrl = `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;\n\treturn iconUrl;\n};\n\nexport const iconPath = \"M5.5 0A5.27 5.27 0 0 0 0 5.01v.49c0 1.73 1.38 3.43 2.07 4.12s3.43 4.12 3.43 4.12 2.75-3.43 3.43-4.12 2.06-2.39 2.06-4.12c.14-2.9-2.1-5.36-5-5.5H5.5Zm-.04 5.71c-.32 0-.57-.27-.56-.58 0-.32.27-.57.58-.56.32 0 .57.27.56.58 0 .31-.25.55-.56.56h-.02Z\";\n\nexport const markerIconProps = (placeMarkerConfigs, type) => {\n\n\tconst scaledWidth = placeMarkerConfigs.size;\n\tconst scaledHeight = (scaledWidth * 3) / 2;\n\tconst iconUrl = customSVGIcon(\n\t\ttype,\n\t\tplaceMarkerConfigs.colors.innerFillColor,\n\t\tplaceMarkerConfigs.colors.innerStrokeColor,\n\t\tplaceMarkerConfigs.colors.outerFillColor,\n\t\tplaceMarkerConfigs.colors.outerStrokeColor\n\t);\n\treturn {\n\t\turl: iconUrl,\n\t\tscaledSize: new google.maps.Size(scaledWidth, scaledHeight),\n\t\tanchor: new google.maps.Point(scaledWidth / 2, scaledHeight)\n\t};\n};\n\nexport const iconProps = () => {\n\treturn {\n\t\tpath: iconPath,\n\t\tfillOpacity: 1,\n\t\tstrokeWeight: 1.75,\n\t\tscale: 1.6,\n\t\tanchor: new google.maps.Point(12, 17)\n\t};\n};\n\nexport const markerIcon = markerConfigs => {\n\treturn {\n\t\t...iconProps(),\n\t\tfillColor: markerConfigs.fillColor,\n\t\tstrokeColor: markerConfigs.strokeColor\n\t};\n};\n\nexport const markerIconSelected = markerConfigs => {\n\treturn {\n\t\t...iconProps(),\n\t\tfillColor: markerConfigs.selectedFillColor,\n\t\tstrokeColor: markerConfigs.selectedStrokeColor\n\t};\n};\n\nexport const pinIcon = markerConfigs => {\n\tconst { fillColor, strokeColor } = markerConfigs;\n\n\tconst svg = `\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"30\" viewBox=\"-6 -4 24 24\">\n\t\t<path d=\"${iconPath}\" fill=\"${fillColor}\" stroke=\"${strokeColor}\" stroke-width=\"2\"/>\n\t </svg>\n\t`;\n\n\treturn `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;\n};\n\n"],"names":["customSVGIcon","type","fillColor","arguments","length","undefined","strokeColor","backgroundFill","backgroundStroke","svg","placeTypes","FOOD","concat","TOURIST_ATTRACTION","SCHOOL","STORE","TRANSIT_STATION","PLACE_OF_WORSHIP","iconUrl","encodeURIComponent","iconPath","markerIconProps","placeMarkerConfigs","scaledWidth","size","scaledHeight","colors","innerFillColor","innerStrokeColor","outerFillColor","outerStrokeColor","url","scaledSize","google","maps","Size","anchor","Point","iconProps","path","fillOpacity","strokeWeight","scale","markerIcon","markerConfigs","_objectSpread","markerIconSelected","selectedFillColor","selectedStrokeColor","pinIcon"],"mappings":";;;AAEA,I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C1C,SAAS;IAClCI,WAAW,EAAEsC,aAAa,CAACtC,WAAAA;AAAW,GAAA,CAAA,CAAA;AAExC,EAAC;IAEYwC,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAGF,aAAa,EAAI;AAClD,EAAA,OAAAC,cAAA,CAAAA,cAAA,CACIP,EAAAA,EAAAA,SAAS,EAAE,CAAA,EAAA,EAAA,EAAA;IACdpC,SAAS,EAAE0C,aAAa,CAACG,iBAAiB;IAC1CzC,WAAW,EAAEsC,aAAa,CAACI,mBAAAA;AAAmB,GAAA,CAAA,CAAA;AAEhD,EAAC;IAEYC,OAAO,GAAG,SAAVA,OAAOA,CAAGL,aAAa,EAAI;AACvC,EAAA,IAAQ1C,SAAS,GAAkB0C,aAAa,CAAxC1C,SAAS;IAAEI,WAAW,GAAKsC,aAAa,CAA7BtC,WAAW,CAAA;AAE9B,EAAA,IAAMG,GAAG,GAAA,mHAAA,CAAAG,MAAA,CAEGQ,QAAQ,EAAA,YAAA,CAAA,CAAAR,MAAA,CAAWV,SAAS,EAAA,cAAA,CAAA,CAAAU,MAAA,CAAaN,WAAW,EAE/D,yCAAA,CAAA,CAAA;AAED,EAAA,OAAA,0BAAA,CAAAM,MAAA,CAAkCO,kBAAkB,CAACV,GAAG,CAAC,CAAA,CAAA;AAC1D;;;;"}
|
|
1
|
+
{"version":3,"file":"mapIconUtil.js","sources":["../../src/util/mapIconUtil.js"],"sourcesContent":["/* eslint-disable no-undef */\nimport { placeTypes } from '~/constants/placeTypes';\n\nconst customSVGIcon = (\n\ttype,\n\tfillColor = \"#FFFFFF\",\n\tstrokeColor = \"#000000\",\n\tbackgroundFill = \"#000000\",\n\tbackgroundStroke = \"#000000\"\n) => {\n\tlet svg = \"\";\n\tswitch (type) {\n\t\tcase placeTypes.FOOD:\n\t\t\tsvg = `\n\t\t\t\t\t<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M25.7,36.6l0.6,15.8c0.1,2.4-2.3,2.4-2.3,2.4s-2.4,0-2.3-2.4l0.6-15.8c0.1-2-4.3-2.9-4-4.9l2.3-13.3h1.1\n\t\t\t\t\t\tl-0.6,9.7l1.7,1.2l0.6-10.9h1.1l0.6,10.9l1.7-1.2l-0.6-9.7h1.1l2.3,13.3C29.7,33.7,25.6,34.6,25.7,36.6z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M40,52.4c0,2.4-2.3,2.4-2.3,2.4s-2.5,0-2.3-2.4L36.6,39c-0.9,0-3.4-0.4-3.4-2.4v-6.1c0-2.4,0.3-6.4,1.2-8.2\n\t\t\t\t\t\tc1.1-2.4,3.9-4,5.6-4C40,18.3,40,52.4,40,52.4z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\t\tbreak;\n\t\tcase placeTypes.TOURIST_ATTRACTION:\n\t\t\tsvg = `<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M27,18.5c-1.2,0-1.7,1.1-2.2,2.2L23.7,23h-4.5c-1.9,0-3.4,1.5-3.4,3.4v11.2c0,1.9,1.5,3.4,3.4,3.4h22.5\n\t\t\t\t\t\tc1.9,0,3.4-1.5,3.4-3.4V26.4c0-1.9-1.5-3.4-3.4-3.4h-4.5L36,20.8c-0.6-1.1-1-2.2-2.2-2.2H27z M19.2,25.3c0.6,0,1.1,0.5,1.1,1.1\n\t\t\t\t\t\tc0,0.6-0.5,1.1-1.1,1.1c-0.6,0-1.1-0.5-1.1-1.1C18,25.8,18.5,25.3,19.2,25.3z M30.4,25.3c3.7,0,6.7,3,6.7,6.7s-3,6.7-6.7,6.7\n\t\t\t\t\t\ts-6.7-3-6.7-6.7S26.7,25.3,30.4,25.3z M30.4,28.7c-1.9,0-3.4,1.5-3.4,3.4s1.5,3.4,3.4,3.4c1.9,0,3.4-1.5,3.4-3.4\n\t\t\t\t\t\tS32.3,28.7,30.4,28.7z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\t\tbreak;\n\t\tcase placeTypes.SCHOOL:\n\t\t\tsvg = `\n\t\t\t\t\t<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M39.2,40.6c0,0-4.1,4.6-9.1,4.6S21,40.6,21,40.6v-5.2l9.1,5l9.1-5V40.6z\"/>\n\t\t\t\t\t<polygon class=\"st0\" points=\"44.4,40.4 41.8,40.4 41.8,31.4 30.1,37.8 15.8,30 30.1,22.2 44.4,30 \"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\t\tbreak;\n\t\tcase placeTypes.STORE:\n\t\t\tsvg = `<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<g>\n\t\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t</g>\n\t\t\t\t\t<path class=\"st0\" d=\"M45.4,27.7L42,41.1c-0.1,0.6-0.7,1-1.3,1c1.8,0,3.3,1.5,3.3,3.3s-1.5,3.3-3.3,3.3s-3.3-1.5-3.3-3.3\n\t\t\t\t\t\ts1.5-3.3,3.3-3.3H23.3c1.8,0,3.3,1.5,3.3,3.3s-1.5,3.3-3.3,3.3S20,47.2,20,45.4s1.5-3.3,3.3-3.3c-0.6,0-1.2-0.4-1.3-1l-4.1-16.4\n\t\t\t\t\t\th-1.3c-0.7,0-1.3-0.6-1.3-1.3s0.6-1.3,1.3-1.3h2.3c0.6,0,1.2,0.4,1.3,1l0.8,3h23.1c0.4,0,0.8,0.2,1.1,0.5\n\t\t\t\t\t\tC45.4,26.9,45.5,27.3,45.4,27.7z\"/>\n\t\t\t\t\t<path d=\"M41.4,45.5c0-0.4-0.3-0.7-0.7-0.7S40,45.1,40,45.5C40.1,46.2,41.4,46.2,41.4,45.5z\"/>\n\t\t\t\t\t<path d=\"M24,45.5c0-0.4-0.3-0.7-0.7-0.7s-0.7,0.3-0.7,0.7C22.6,46.2,24,46.2,24,45.5z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\t\tbreak;\n\t\tcase placeTypes.TRANSIT_STATION:\n\t\t\tsvg = `<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<g>\n\t\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t</g>\n\t\t\t\t\t<path class=\"st0\" d=\"M26.3,41.3h-2.8L20.7,44h-1.4v-1.4l1.4-1.4c-2.3,0-4.2-1.9-4.2-4.2V26c0-2.3,1.9-4.2,4.2-4.2h9.7\n\t\t\t\t\t\tc2.3,0,4.2,1.9,4.2,4.2v1.4h-2.8v-2.8H19.3v9.7h6.9v7H26.3z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M44.3,43c0,0.5-0.4,1-1,1h-0.8c-0.5,0-1-0.5-1-1.1v-1.7H30.4V43c0,0.5-0.4,1.1-0.9,1.1h-0.9c-0.5,0-1-0.5-1-1\n\t\t\t\t\t\tv-7.6l2-5.7c0.2-0.6,0.7-0.9,1.4-0.9h10c0.6,0,1.1,0.4,1.3,0.9l2,5.7V43z\"/>\n\t\t\t\t\t<circle cx=\"20.7\" cy=\"37.1\" r=\"1.4\"/>\n\t\t\t\t\t<circle cx=\"41.5\" cy=\"37.1\" r=\"1.4\"/>\n\t\t\t\t\t<circle cx=\"30.4\" cy=\"37.1\" r=\"1.4\"/>\n\t\t\t\t\t<polygon points=\"31,30.2 29.6,34.4 42.4,34.4 40.9,30.2 \"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\t\tbreak;\n\t\tcase placeTypes.PLACE_OF_WORSHIP:\n\t\t\tsvg = `<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M21.3,40.8h-3.8c-1.3,0-2.3-1-2.3-2.3v-4.3c0-0.8,0.5-1.6,1.2-2l4.9-2.7V40.8z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M38,40.8h-4.6v-4.6c0-1.7-1.4-3-3-3c-1.7,0-3,1.4-3,3v4.6h-4.6V30c0-0.8,0.4-1.5,1.1-2l1.9-1.2v-5.1l0,0\n\t\t\t\t\t\tc0-0.4,0.2-0.8,0.4-1.1l3.6-3.6c0.3-0.3,0.8-0.3,1.1,0l3.6,3.6c0.3,0.3,0.4,0.7,0.4,1.1v5.1l1.9,1.2c0.7,0.4,1.1,1.2,1.1,2L38,40.8\n\t\t\t\t\t\tL38,40.8z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M45.6,38.5c0,1.3-1,2.3-2.3,2.3h-3.8V29.5l4.9,2.7c0.7,0.4,1.2,1.2,1.2,2C45.6,34.2,45.6,38.5,45.6,38.5z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\t\tbreak;\n\t}\n\n\tconst iconUrl = `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;\n\treturn iconUrl;\n};\n\nexport const iconPath = \"M5.5 0A5.27 5.27 0 0 0 0 5.01v.49c0 1.73 1.38 3.43 2.07 4.12s3.43 4.12 3.43 4.12 2.75-3.43 3.43-4.12 2.06-2.39 2.06-4.12c.14-2.9-2.1-5.36-5-5.5H5.5Zm-.04 5.71c-.32 0-.57-.27-.56-.58 0-.32.27-.57.58-.56.32 0 .57.27.56.58 0 .31-.25.55-.56.56h-.02Z\";\n\nexport const markerIconProps = (placeMarkerConfigs, type) => {\n\n\tconst scaledWidth = placeMarkerConfigs.size;\n\tconst scaledHeight = (scaledWidth * 3) / 2;\n\tconst iconUrl = customSVGIcon(\n\t\ttype,\n\t\tplaceMarkerConfigs.colors.innerFillColor,\n\t\tplaceMarkerConfigs.colors.innerStrokeColor,\n\t\tplaceMarkerConfigs.colors.outerFillColor,\n\t\tplaceMarkerConfigs.colors.outerStrokeColor\n\t);\n\treturn {\n\t\turl: iconUrl,\n\t\tscaledSize: new google.maps.Size(scaledWidth, scaledHeight),\n\t\tanchor: new google.maps.Point(scaledWidth / 2, scaledHeight)\n\t};\n};\n\nexport const iconProps = () => {\n\treturn {\n\t\tpath: iconPath,\n\t\tfillOpacity: 1,\n\t\tstrokeWeight: 1.75,\n\t\tscale: 1.6,\n\t\tanchor: new google.maps.Point(12, 17)\n\t};\n};\n\nexport const markerIcon = markerConfigs => {\n\treturn {\n\t\t...iconProps(),\n\t\tfillColor: markerConfigs.fillColor,\n\t\tstrokeColor: markerConfigs.strokeColor\n\t};\n};\n\nexport const markerIconSelected = markerConfigs => {\n\treturn {\n\t\t...iconProps(),\n\t\tfillColor: markerConfigs.selectedFillColor,\n\t\tstrokeColor: markerConfigs.selectedStrokeColor\n\t};\n};\n\nexport const pinIcon = markerConfigs => {\n\tconst { fillColor, strokeColor } = markerConfigs;\n\n\tconst svg = `\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"30\" viewBox=\"-6 -4 24 24\">\n\t\t<path d=\"${iconPath}\" fill=\"${fillColor}\" stroke=\"${strokeColor}\" stroke-width=\"2\"/>\n\t </svg>\n\t`;\n\n\treturn `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;\n};\n\n"],"names":["customSVGIcon","type","fillColor","arguments","length","undefined","strokeColor","backgroundFill","backgroundStroke","svg","placeTypes","FOOD","concat","TOURIST_ATTRACTION","SCHOOL","STORE","TRANSIT_STATION","PLACE_OF_WORSHIP","iconUrl","encodeURIComponent","iconPath","markerIconProps","placeMarkerConfigs","scaledWidth","size","scaledHeight","colors","innerFillColor","innerStrokeColor","outerFillColor","outerStrokeColor","url","scaledSize","google","maps","Size","anchor","Point","iconProps","path","fillOpacity","strokeWeight","scale","markerIcon","markerConfigs","_objectSpread","markerIconSelected","selectedFillColor","selectedStrokeColor","pinIcon"],"mappings":";;;AAGA,IAAMA,aAAa,GAAG,SAAhBA,aAAaA,CAClBC,IAAI,EAKA;AAAA,EAAA,IAJJC,SAAS,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,SAAS,CAAA;AAAA,EAAA,IACrBG,WAAW,GAAAH,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,SAAS,CAAA;AAAA,EAAA,IACvBI,cAAc,GAAAJ,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,SAAS,CAAA;AAAA,EAAA,IAC1BK,gBAAgB,GAAAL,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,SAAS,CAAA;EAE5B,IAAIM,GAAG,GAAG,EAAE,CAAA;AACZ,EAAA,QAAQR,IAAI;IACX,KAAKS,UAAU,CAACC,IAAI;AACnBF,MAAAA,GAAG,0WAAAG,MAAA,CAIWV,SAAS,EAAA,WAAA,CAAA,CAAAU,MAAA,CAAYN,WAAW,EAAAM,qCAAAA,CAAAA,CAAAA,MAAA,CACrBL,cAAc,EAAA,WAAA,CAAA,CAAAK,MAAA,CAAYJ,gBAAgB,EAQhE,qqBAAA,CAAA,CAAA;AACH,MAAA,MAAA;IACD,KAAKE,UAAU,CAACG,kBA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AEYM,UAAU,GAAG,SAAbA,UAAUA,CAAGC,aAAa,EAAI;AAC1C,EAAA,OAAAC,cAAA,CAAAA,cAAA,CACIP,EAAAA,EAAAA,SAAS,EAAE,CAAA,EAAA,EAAA,EAAA;IACdpC,SAAS,EAAE0C,aAAa,CAAC1C,SAAS;IAClCI,WAAW,EAAEsC,aAAa,CAACtC,WAAAA;AAAW,GAAA,CAAA,CAAA;AAExC,EAAC;IAEYwC,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAGF,aAAa,EAAI;AAClD,EAAA,OAAAC,cAAA,CAAAA,cAAA,CACIP,EAAAA,EAAAA,SAAS,EAAE,CAAA,EAAA,EAAA,EAAA;IACdpC,SAAS,EAAE0C,aAAa,CAACG,iBAAiB;IAC1CzC,WAAW,EAAEsC,aAAa,CAACI,mBAAAA;AAAmB,GAAA,CAAA,CAAA;AAEhD,EAAC;IAEYC,OAAO,GAAG,SAAVA,OAAOA,CAAGL,aAAa,EAAI;AACvC,EAAA,IAAQ1C,SAAS,GAAkB0C,aAAa,CAAxC1C,SAAS;IAAEI,WAAW,GAAKsC,aAAa,CAA7BtC,WAAW,CAAA;AAE9B,EAAA,IAAMG,GAAG,GAAA,mHAAA,CAAAG,MAAA,CAEGQ,QAAQ,EAAA,YAAA,CAAA,CAAAR,MAAA,CAAWV,SAAS,EAAA,cAAA,CAAA,CAAAU,MAAA,CAAaN,WAAW,EAE/D,yCAAA,CAAA,CAAA;AAED,EAAA,OAAA,0BAAA,CAAAM,MAAA,CAAkCO,kBAAkB,CAACV,GAAG,CAAC,CAAA,CAAA;AAC1D;;;;"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/* eslint-disable no-undef */
|
|
1
2
|
import React, { useEffect, useRef } from 'react';
|
|
2
|
-
import { GoogleMap, MarkerClustererF
|
|
3
|
+
import { GoogleMap, MarkerClustererF } from "@react-google-maps/api";
|
|
3
4
|
|
|
4
5
|
import MapMarker from "~/components/modules/maps/map-marker";
|
|
5
6
|
import PlaceMarker from "~/components/modules/maps/place-marker";
|
package/src/util/mapIconUtil.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable no-undef */
|
|
1
2
|
import { placeTypes } from '~/constants/placeTypes';
|
|
2
3
|
|
|
3
4
|
const customSVGIcon = (
|
|
@@ -9,8 +10,8 @@ const customSVGIcon = (
|
|
|
9
10
|
) => {
|
|
10
11
|
let svg = "";
|
|
11
12
|
switch (type) {
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
case placeTypes.FOOD:
|
|
14
|
+
svg = `
|
|
14
15
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
15
16
|
viewBox="0 0 60.8 89.6" preserveAspectRatio="xMidYMid meet" style="enable-background:new 0 0 60.8 89.6;" xml:space="preserve">
|
|
16
17
|
<style type="text/css">
|
|
@@ -24,9 +25,9 @@ const customSVGIcon = (
|
|
|
24
25
|
c1.1-2.4,3.9-4,5.6-4C40,18.3,40,52.4,40,52.4z"/>
|
|
25
26
|
</svg>
|
|
26
27
|
`;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
break;
|
|
29
|
+
case placeTypes.TOURIST_ATTRACTION:
|
|
30
|
+
svg = `<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
30
31
|
viewBox="0 0 60.8 89.6" preserveAspectRatio="xMidYMid meet" style="enable-background:new 0 0 60.8 89.6;" xml:space="preserve">
|
|
31
32
|
<style type="text/css">
|
|
32
33
|
.st0{fill:${fillColor}; stroke:${strokeColor};}
|
|
@@ -40,9 +41,9 @@ const customSVGIcon = (
|
|
|
40
41
|
S32.3,28.7,30.4,28.7z"/>
|
|
41
42
|
</svg>
|
|
42
43
|
`;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
break;
|
|
45
|
+
case placeTypes.SCHOOL:
|
|
46
|
+
svg = `
|
|
46
47
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
47
48
|
viewBox="0 0 60.8 89.6" preserveAspectRatio="xMidYMid meet" style="enable-background:new 0 0 60.8 89.6;" xml:space="preserve">
|
|
48
49
|
<style type="text/css">
|
|
@@ -54,9 +55,9 @@ const customSVGIcon = (
|
|
|
54
55
|
<polygon class="st0" points="44.4,40.4 41.8,40.4 41.8,31.4 30.1,37.8 15.8,30 30.1,22.2 44.4,30 "/>
|
|
55
56
|
</svg>
|
|
56
57
|
`;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
break;
|
|
59
|
+
case placeTypes.STORE:
|
|
60
|
+
svg = `<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
60
61
|
viewBox="0 0 60.8 89.6" preserveAspectRatio="xMidYMid meet" style="enable-background:new 0 0 60.8 89.6;" xml:space="preserve">
|
|
61
62
|
<style type="text/css">
|
|
62
63
|
.st0{fill:${fillColor}; stroke:${strokeColor};}
|
|
@@ -74,9 +75,9 @@ const customSVGIcon = (
|
|
|
74
75
|
<path d="M24,45.5c0-0.4-0.3-0.7-0.7-0.7s-0.7,0.3-0.7,0.7C22.6,46.2,24,46.2,24,45.5z"/>
|
|
75
76
|
</svg>
|
|
76
77
|
`;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
break;
|
|
79
|
+
case placeTypes.TRANSIT_STATION:
|
|
80
|
+
svg = `<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
80
81
|
viewBox="0 0 60.8 89.6" preserveAspectRatio="xMidYMid meet" style="enable-background:new 0 0 60.8 89.6;" xml:space="preserve">
|
|
81
82
|
<style type="text/css">
|
|
82
83
|
.st0{fill:${fillColor}; stroke:${strokeColor};}
|
|
@@ -96,9 +97,9 @@ const customSVGIcon = (
|
|
|
96
97
|
<polygon points="31,30.2 29.6,34.4 42.4,34.4 40.9,30.2 "/>
|
|
97
98
|
</svg>
|
|
98
99
|
`;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
break;
|
|
101
|
+
case placeTypes.PLACE_OF_WORSHIP:
|
|
102
|
+
svg = `<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
102
103
|
viewBox="0 0 60.8 89.6" style="enable-background:new 0 0 60.8 89.6;" xml:space="preserve">
|
|
103
104
|
<style type="text/css">
|
|
104
105
|
.st0{fill:${fillColor}; stroke:${strokeColor};}
|
|
@@ -112,7 +113,7 @@ const customSVGIcon = (
|
|
|
112
113
|
<path class="st0" d="M45.6,38.5c0,1.3-1,2.3-2.3,2.3h-3.8V29.5l4.9,2.7c0.7,0.4,1.2,1.2,1.2,2C45.6,34.2,45.6,38.5,45.6,38.5z"/>
|
|
113
114
|
</svg>
|
|
114
115
|
`;
|
|
115
|
-
|
|
116
|
+
break;
|
|
116
117
|
}
|
|
117
118
|
|
|
118
119
|
const iconUrl = `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;
|