@abcagency/hc-ui-components 1.3.38 → 1.3.39
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/dist/components/modules/list/field-mapper.js +12 -0
- package/dist/components/modules/list/field-mapper.js.map +1 -1
- package/dist/util/mapIconUtil.js +1 -1
- package/dist/util/mapIconUtil.js.map +1 -1
- package/package.json +1 -1
- package/src/components/modules/list/field-mapper.js +15 -0
- package/src/util/mapIconUtil.js +180 -180
|
@@ -57,6 +57,10 @@ var FieldMapper = function FieldMapper(_ref) {
|
|
|
57
57
|
}, specialFeaturePills("position"), " ")), /*#__PURE__*/React__default.createElement("ul", {
|
|
58
58
|
className: "hc-space-y-2 hc-text-xs"
|
|
59
59
|
}, [{
|
|
60
|
+
field: "categoryClass",
|
|
61
|
+
name: "categoryClass",
|
|
62
|
+
icon: "icon-park-solid:tree-list"
|
|
63
|
+
}, {
|
|
60
64
|
field: "category",
|
|
61
65
|
name: "Category",
|
|
62
66
|
icon: "icon-park-solid:tree-list"
|
|
@@ -64,6 +68,14 @@ var FieldMapper = function FieldMapper(_ref) {
|
|
|
64
68
|
field: "schedule",
|
|
65
69
|
name: "Schedule",
|
|
66
70
|
icon: "gravity-ui:clock-fill"
|
|
71
|
+
}, {
|
|
72
|
+
field: "city",
|
|
73
|
+
name: "Location",
|
|
74
|
+
icon: "fluent:location-16-filled"
|
|
75
|
+
}, {
|
|
76
|
+
field: "state",
|
|
77
|
+
name: "Location",
|
|
78
|
+
icon: "fluent:location-16-filled"
|
|
67
79
|
}, {
|
|
68
80
|
field: "cityState",
|
|
69
81
|
name: "Location",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-mapper.js","sources":["../../../../src/components/modules/list/field-mapper.js"],"sourcesContent":["import React from 'react';\n\nimport Grid from '~/components/modules/grid';\nimport Icon from '~/components/modules/icon';\nimport PillWrapper from '~/components/modules/buttons/pill-wrapper';\n\nimport { capitalize } from '~/util/stringUtils';\n\nconst FieldMapper = ({\n\titem,\n\tfieldsShown,\n\tspecialFeatures,\n\thandleFavouriteClick,\n\tisFavorite,\n\tincludeFavorite = true\n}) => {\n\tconst orderedFields = fieldsShown.filter(field => field in item.fields);\n\n\tconst specialFeaturePills = field => {\n\t\treturn field === 'position' && specialFeatures &&\n\t\t\tObject.entries(specialFeatures).map(([featureKey, featureLabel]) => {\n\t\t\t\treturn item.fields[featureKey] == 1 && (\n\t\t\t\t\t<PillWrapper key={featureKey}>{featureLabel}</PillWrapper>\n\t\t\t\t);\n\t\t\t});\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{orderedFields.map((field, index) => {\n\t\t\t\tlet value = item.fields[field];\n\t\t\t\treturn (\n\t\t\t\t\t<Grid.Item\n\t\t\t\t\t\tkey={field}\n\t\t\t\t\t\tclassName={`\n\t\t\t\t\t\t\thc-hidden md:hc-block hc-px-2\n\t\t\t\t\t\t\t${index === 0 ? \"hc-pl-7\" : \"\"}\n\t\t\t\t\t\t\t${field.toLowerCase() === \"position\" ? \"hc-col-span-4 hc-text-balance hc-font-semibold\" : (field.toLowerCase() === \"state\" || field.toLowerCase() == \"favorite\") ? \"hc-col-span-1\" : \"hc-col-span-2\"}\n\t\t\t\t\t\t`}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"hc-sr-only\">{capitalize(field)}</span>\n\t\t\t\t\t\t{value}\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t{specialFeaturePills(field)}\n\t\t\t\t\t</Grid.Item>\n\t\t\t\t);\n\t\t\t})}\n\t\t\t<Grid.Item className=\"md:hc-hidden\">\n\t\t\t\t{fieldsShown.includes(\"position\") &&\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"hc-flex hc-items-start\">\n\t\t\t\t\t\t\t<div className=\"hc-flex hc-justify-between hc-items-center hc-min-w-[100%]\"> {}\n\t\t\t\t\t\t\t\t<h3 className=\"hc-font-bold hc-mb-3 hc-flex-1\">{item.fields.position}</h3>\n\t\t\t\t\t\t\t\t{includeFavorite && <div className=\"hc-flex hc-justify-end hc-pb-2\">\n\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\ticon={isFavorite ? \"mdi:heart\" : \"mdi:heart-outline\"}\n\t\t\t\t\t\t\t\t\t\tsize=\"hc-size-3.5\"\n\t\t\t\t\t\t\t\t\t\ticonClasses={isFavorite ? \"hc-text-primary\" : \"\"}\n\t\t\t\t\t\t\t\t\t\tclassName={`hc-transition-opacity hc-duration-300 hc-cursor-pointer\n\t\t\t\t\t\t\t\t\t${isFavorite ? \"hc-opacity-100\" : \"hc-text-uiText/60 group-hover:hc-opacity-100\"}\n\t\t\t\t\t\t\t\t\t`}\n\t\t\t\t\t\t\t\t\t\tonClick={e => handleFavouriteClick(e, item)}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{specialFeatures && <div className='hc-pb-4'>{specialFeaturePills(\"position\", true)} </div>}\n\t\t\t\t\t</>\n\t\t\t\t}\n\n\t\t\t\t<ul className=\"hc-space-y-2 hc-text-xs\">\n\t\t\t\t\t{[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfield: \"category\",\n\t\t\t\t\t\t\tname: \"Category\",\n\t\t\t\t\t\t\ticon: \"icon-park-solid:tree-list\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfield: \"schedule\",\n\t\t\t\t\t\t\tname: \"Schedule\",\n\t\t\t\t\t\t\ticon: \"gravity-ui:clock-fill\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfield: \"cityState\",\n\t\t\t\t\t\t\tname: \"Location\",\n\t\t\t\t\t\t\ticon: \"fluent:location-16-filled\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfield: \"travelTime\",\n\t\t\t\t\t\t\tname: \"Commute\",\n\t\t\t\t\t\t\ticon: \"ri:pin-distance-fill\"\n\t\t\t\t\t\t}\n\t\t\t\t\t].map(listItem => (\n\t\t\t\t\t\t(fieldsShown.includes(listItem.field) && item.fields[listItem.field]) &&\n\t\t\t\t\t\t<li\n\t\t\t\t\t\t\tkey={listItem.field}\n\t\t\t\t\t\t\tclassName=\"hc-flex hc-gap-2\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={listItem.icon}\n\t\t\t\t\t\t\t\tsize=\"hc-size-3.5\"\n\t\t\t\t\t\t\t\tclassName=\"hc-text-uiAccent/30\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<span className=\"hc-sr-only\">{listItem.name}</span>\n\t\t\t\t\t\t\t{item.fields[listItem.field]}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t))}\n\t\t\t\t</ul>\n\t\t\t</Grid.Item>\n\t\t</>\n\t);\n};\n\nexport default FieldMapper;\n"],"names":["FieldMapper","_ref","item","fieldsShown","specialFeatures","handleFavouriteClick","isFavorite","_ref$includeFavorite","includeFavorite","orderedFields","filter","field","fields","specialFeaturePills","Object","entries","map","_ref2","_ref3","_slicedToArray","featureKey","featureLabel","React","createElement","PillWrapper","key","Fragment","index","value","Grid","Item","className","concat","toLowerCase","capitalize","includes","position","Icon","icon","size","iconClasses","onClick","e","name","listItem"],"mappings":";;;;;;;AAQA,IAAMA,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAOX;AAAA,EAAA,IANLC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,WAAW,GAAAF,IAAA,CAAXE,WAAW;IACXC,eAAe,GAAAH,IAAA,CAAfG,eAAe;IACfC,oBAAoB,GAAAJ,IAAA,CAApBI,oBAAoB;IACpBC,UAAU,GAAAL,IAAA,CAAVK,UAAU;IAAAC,oBAAA,GAAAN,IAAA,CACVO,eAAe;AAAfA,IAAAA,e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K,CAAC,iBACpEW,cAAA,CAAAC,aAAA,CAAA,IAAA,EAAA;MACCE,GAAG,EAAEmB,QAAQ,CAACjC,KAAM;AACpBoB,MAAAA,SAAS,EAAC,kBAAA;AAAkB,KAAA,eAE5BT,cAAA,CAAAC,aAAA,CAACc,aAAI,EAAA;MACJC,IAAI,EAAEM,QAAQ,CAACN,IAAK;AACpBC,MAAAA,IAAI,EAAC,aAAa;AAClBR,MAAAA,SAAS,EAAC,qBAAA;AAAqB,KAC/B,CAAC,eACFT,cAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMQ,MAAAA,SAAS,EAAC,YAAA;AAAY,KAAA,EAAEa,QAAQ,CAACD,IAAW,CAAC,EAClDzC,IAAI,CAACU,MAAM,CAACgC,QAAQ,CAACjC,KAAK,CACxB,CAAC,CAAA;GACL,CACE,CACM,CACV,CAAC,CAAA;AAEL;;;;"}
|
|
1
|
+
{"version":3,"file":"field-mapper.js","sources":["../../../../src/components/modules/list/field-mapper.js"],"sourcesContent":["import React from 'react';\n\nimport Grid from '~/components/modules/grid';\nimport Icon from '~/components/modules/icon';\nimport PillWrapper from '~/components/modules/buttons/pill-wrapper';\n\nimport { capitalize } from '~/util/stringUtils';\n\nconst FieldMapper = ({\n\titem,\n\tfieldsShown,\n\tspecialFeatures,\n\thandleFavouriteClick,\n\tisFavorite,\n\tincludeFavorite = true\n}) => {\n\tconst orderedFields = fieldsShown.filter(field => field in item.fields);\n\n\tconst specialFeaturePills = field => {\n\t\treturn field === 'position' && specialFeatures &&\n\t\t\tObject.entries(specialFeatures).map(([featureKey, featureLabel]) => {\n\t\t\t\treturn item.fields[featureKey] == 1 && (\n\t\t\t\t\t<PillWrapper key={featureKey}>{featureLabel}</PillWrapper>\n\t\t\t\t);\n\t\t\t});\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{orderedFields.map((field, index) => {\n\t\t\t\tlet value = item.fields[field];\n\t\t\t\treturn (\n\t\t\t\t\t<Grid.Item\n\t\t\t\t\t\tkey={field}\n\t\t\t\t\t\tclassName={`\n\t\t\t\t\t\t\thc-hidden md:hc-block hc-px-2\n\t\t\t\t\t\t\t${index === 0 ? \"hc-pl-7\" : \"\"}\n\t\t\t\t\t\t\t${field.toLowerCase() === \"position\" ? \"hc-col-span-4 hc-text-balance hc-font-semibold\" : (field.toLowerCase() === \"state\" || field.toLowerCase() == \"favorite\") ? \"hc-col-span-1\" : \"hc-col-span-2\"}\n\t\t\t\t\t\t`}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"hc-sr-only\">{capitalize(field)}</span>\n\t\t\t\t\t\t{value}\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t{specialFeaturePills(field)}\n\t\t\t\t\t</Grid.Item>\n\t\t\t\t);\n\t\t\t})}\n\t\t\t<Grid.Item className=\"md:hc-hidden\">\n\t\t\t\t{fieldsShown.includes(\"position\") &&\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"hc-flex hc-items-start\">\n\t\t\t\t\t\t\t<div className=\"hc-flex hc-justify-between hc-items-center hc-min-w-[100%]\"> {}\n\t\t\t\t\t\t\t\t<h3 className=\"hc-font-bold hc-mb-3 hc-flex-1\">{item.fields.position}</h3>\n\t\t\t\t\t\t\t\t{includeFavorite && <div className=\"hc-flex hc-justify-end hc-pb-2\">\n\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\ticon={isFavorite ? \"mdi:heart\" : \"mdi:heart-outline\"}\n\t\t\t\t\t\t\t\t\t\tsize=\"hc-size-3.5\"\n\t\t\t\t\t\t\t\t\t\ticonClasses={isFavorite ? \"hc-text-primary\" : \"\"}\n\t\t\t\t\t\t\t\t\t\tclassName={`hc-transition-opacity hc-duration-300 hc-cursor-pointer\n\t\t\t\t\t\t\t\t\t${isFavorite ? \"hc-opacity-100\" : \"hc-text-uiText/60 group-hover:hc-opacity-100\"}\n\t\t\t\t\t\t\t\t\t`}\n\t\t\t\t\t\t\t\t\t\tonClick={e => handleFavouriteClick(e, item)}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{specialFeatures && <div className='hc-pb-4'>{specialFeaturePills(\"position\", true)} </div>}\n\t\t\t\t\t</>\n\t\t\t\t}\n\n\t\t\t\t<ul className=\"hc-space-y-2 hc-text-xs\">\n\t\t\t\t\t{[\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfield: \"categoryClass\",\n\t\t\t\t\t\t\tname: \"categoryClass\",\n\t\t\t\t\t\t\ticon: \"icon-park-solid:tree-list\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfield: \"category\",\n\t\t\t\t\t\t\tname: \"Category\",\n\t\t\t\t\t\t\ticon: \"icon-park-solid:tree-list\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfield: \"schedule\",\n\t\t\t\t\t\t\tname: \"Schedule\",\n\t\t\t\t\t\t\ticon: \"gravity-ui:clock-fill\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfield: \"city\",\n\t\t\t\t\t\t\tname: \"Location\",\n\t\t\t\t\t\t\ticon: \"fluent:location-16-filled\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfield: \"state\",\n\t\t\t\t\t\t\tname: \"Location\",\n\t\t\t\t\t\t\ticon: \"fluent:location-16-filled\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfield: \"cityState\",\n\t\t\t\t\t\t\tname: \"Location\",\n\t\t\t\t\t\t\ticon: \"fluent:location-16-filled\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfield: \"travelTime\",\n\t\t\t\t\t\t\tname: \"Commute\",\n\t\t\t\t\t\t\ticon: \"ri:pin-distance-fill\"\n\t\t\t\t\t\t}\n\t\t\t\t\t].map(listItem => (\n\t\t\t\t\t\t(fieldsShown.includes(listItem.field) && item.fields[listItem.field]) &&\n\t\t\t\t\t\t<li\n\t\t\t\t\t\t\tkey={listItem.field}\n\t\t\t\t\t\t\tclassName=\"hc-flex hc-gap-2\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\ticon={listItem.icon}\n\t\t\t\t\t\t\t\tsize=\"hc-size-3.5\"\n\t\t\t\t\t\t\t\tclassName=\"hc-text-uiAccent/30\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<span className=\"hc-sr-only\">{listItem.name}</span>\n\t\t\t\t\t\t\t{item.fields[listItem.field]}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t))}\n\t\t\t\t</ul>\n\t\t\t</Grid.Item>\n\t\t</>\n\t);\n};\n\nexport default FieldMapper;\n"],"names":["FieldMapper","_ref","item","fieldsShown","specialFeatures","handleFavouriteClick","isFavorite","_ref$includeFavorite","includeFavorite","orderedFields","filter","field","fields","specialFeaturePills","Object","entries","map","_ref2","_ref3","_slicedToArray","featureKey","featureLabel","React","createElement","PillWrapper","key","Fragment","index","value","Grid","Item","className","concat","toLowerCase","capitalize","includes","position","Icon","icon","size","iconClasses","onClick","e","name","listItem"],"mappings":";;;;;;;AAQA,IAAMA,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAOX;AAAA,EAAA,IANLC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,WAAW,GAAAF,IAAA,CAAXE,WAAW;IACXC,eAAe,GAAAH,IAAA,CAAfG,eAAe;IACfC,oBAAoB,GAAAJ,IAAA,CAApBI,oBAAoB;IACpBC,UAAU,GAAAL,IAAA,CAAVK,UAAU;IAAAC,oBAAA,GAAAN,IAAA,CACVO,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,oBAAA,CAAA;AAE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ACC3B,IAAAA,KAAK,EAAE,YAAY;AACnBgC,IAAAA,IAAI,EAAE,SAAS;AACfL,IAAAA,IAAI,EAAE,sBAAA;AACP,GAAC,CACD,CAACtB,GAAG,CAAC,UAAA4B,QAAQ,EAAA;IAAA,OACZzC,WAAW,CAACgC,QAAQ,CAACS,QAAQ,CAACjC,KAAK,CAAC,IAAIT,IAAI,CAACU,MAAM,CAACgC,QAAQ,CAACjC,KAAK,CAAC,iBACpEW,cAAA,CAAAC,aAAA,CAAA,IAAA,EAAA;MACCE,GAAG,EAAEmB,QAAQ,CAACjC,KAAM;AACpBoB,MAAAA,SAAS,EAAC,kBAAA;AAAkB,KAAA,eAE5BT,cAAA,CAAAC,aAAA,CAACc,aAAI,EAAA;MACJC,IAAI,EAAEM,QAAQ,CAACN,IAAK;AACpBC,MAAAA,IAAI,EAAC,aAAa;AAClBR,MAAAA,SAAS,EAAC,qBAAA;AAAqB,KAC/B,CAAC,eACFT,cAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMQ,MAAAA,SAAS,EAAC,YAAA;AAAY,KAAA,EAAEa,QAAQ,CAACD,IAAW,CAAC,EAClDzC,IAAI,CAACU,MAAM,CAACgC,QAAQ,CAACjC,KAAK,CACxB,CAAC,CAAA;GACL,CACE,CACM,CACV,CAAC,CAAA;AAEL;;;;"}
|
package/dist/util/mapIconUtil.js
CHANGED
|
@@ -65,7 +65,7 @@ var markerIconSelected = function markerIconSelected(markerConfigs) {
|
|
|
65
65
|
var pinIcon = function pinIcon(markerConfigs) {
|
|
66
66
|
var fillColor = markerConfigs.fillColor,
|
|
67
67
|
strokeColor = markerConfigs.strokeColor;
|
|
68
|
-
var 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=\"".concat(iconPath, "\" fill=\"").concat(fillColor, "\" stroke=\"").concat(strokeColor, "\" stroke-width=\"2\"/>\n\t </svg>\n\t");
|
|
68
|
+
var svg = "\n\t<svg aria-hidden=\"true\" xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"30\" viewBox=\"-6 -4 24 24\">\n\t\t<path d=\"".concat(iconPath, "\" fill=\"").concat(fillColor, "\" stroke=\"").concat(strokeColor, "\" stroke-width=\"2\"/>\n\t </svg>\n\t");
|
|
69
69
|
return "data:image/svg+xml;utf8,".concat(encodeURIComponent(svg));
|
|
70
70
|
};
|
|
71
71
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapIconUtil.js","sources":["../../src/util/mapIconUtil.js"],"sourcesContent":["/* eslint-disable no-undef */\r\nimport { placeTypes } from '~/constants/placeTypes';\r\n\r\nconst customSVGIcon = (\r\n\ttype,\r\n\tfillColor = \"#FFFFFF\",\r\n\tstrokeColor = \"#000000\",\r\n\tbackgroundFill = \"#000000\",\r\n\tbackgroundStroke = \"#000000\"\r\n) => {\r\n\tlet svg = \"\";\r\n\tswitch (type) {\r\n\t\tcase placeTypes.FOOD:\r\n\t\t\tsvg = `\r\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\"\r\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\">\r\n\t\t\t\t\t<style type=\"text/css\">\r\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\r\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\r\n\t\t\t\t\t</style>\r\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\"/>\r\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\r\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\"/>\r\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\r\n\t\t\t\t\t\tc1.1-2.4,3.9-4,5.6-4C40,18.3,40,52.4,40,52.4z\"/>\r\n\t\t\t\t\t</svg>\r\n\t\t\t\t\t`;\r\n\t\t\tbreak;\r\n\t\tcase placeTypes.TOURIST_ATTRACTION:\r\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\"\r\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\">\r\n\t\t\t\t\t<style type=\"text/css\">\r\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\r\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\r\n\t\t\t\t\t</style>\r\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\"/>\r\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\r\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\r\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\r\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\r\n\t\t\t\t\t\tS32.3,28.7,30.4,28.7z\"/>\r\n\t\t\t\t\t</svg>\r\n\t\t\t\t\t`;\r\n\t\t\tbreak;\r\n\t\tcase placeTypes.SCHOOL:\r\n\t\t\tsvg = `\r\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\"\r\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\">\r\n\t\t\t\t\t<style type=\"text/css\">\r\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\r\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\r\n\t\t\t\t\t</style>\r\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\"/>\r\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\"/>\r\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 \"/>\r\n\t\t\t\t\t</svg>\r\n\t\t\t\t\t`;\r\n\t\t\tbreak;\r\n\t\tcase placeTypes.STORE:\r\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\"\r\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\">\r\n\t\t\t\t\t<style type=\"text/css\">\r\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\r\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\r\n\t\t\t\t\t</style>\r\n\t\t\t\t\t<g>\r\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\"\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t</g>\r\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\r\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\r\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\r\n\t\t\t\t\t\tC45.4,26.9,45.5,27.3,45.4,27.7z\"/>\r\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\"/>\r\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\"/>\r\n\t\t\t\t\t</svg>\r\n\t\t\t\t\t`;\r\n\t\t\tbreak;\r\n\t\tcase placeTypes.TRANSIT_STATION:\r\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\"\r\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\">\r\n\t\t\t\t\t<style type=\"text/css\">\r\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\r\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\r\n\t\t\t\t\t</style>\r\n\t\t\t\t\t<g>\r\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\"\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t</g>\r\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\r\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\"/>\r\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\r\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\"/>\r\n\t\t\t\t\t<circle cx=\"20.7\" cy=\"37.1\" r=\"1.4\"/>\r\n\t\t\t\t\t<circle cx=\"41.5\" cy=\"37.1\" r=\"1.4\"/>\r\n\t\t\t\t\t<circle cx=\"30.4\" cy=\"37.1\" r=\"1.4\"/>\r\n\t\t\t\t\t<polygon points=\"31,30.2 29.6,34.4 42.4,34.4 40.9,30.2 \"/>\r\n\t\t\t\t\t</svg>\r\n\t\t\t\t\t`;\r\n\t\t\tbreak;\r\n\t\tcase placeTypes.PLACE_OF_WORSHIP:\r\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\"\r\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\">\r\n\t\t\t\t\t<style type=\"text/css\">\r\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\r\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\r\n\t\t\t\t\t</style>\r\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\"/>\r\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\"/>\r\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\r\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\r\n\t\t\t\t\t\tL38,40.8z\"/>\r\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\"/>\r\n\t\t\t\t\t</svg>\r\n\t\t\t\t\t`;\r\n\t\t\tbreak;\r\n\t}\r\n\r\n\tconst iconUrl = `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;\r\n\treturn iconUrl;\r\n};\r\n\r\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\";\r\n\r\nexport const markerIconProps = (placeMarkerConfigs, type) => {\r\n\r\n\tconst scaledWidth = placeMarkerConfigs.size;\r\n\tconst scaledHeight = (scaledWidth * 3) / 2;\r\n\tconst iconUrl = customSVGIcon(\r\n\t\ttype,\r\n\t\tplaceMarkerConfigs.colors.innerFillColor,\r\n\t\tplaceMarkerConfigs.colors.innerStrokeColor,\r\n\t\tplaceMarkerConfigs.colors.outerFillColor,\r\n\t\tplaceMarkerConfigs.colors.outerStrokeColor\r\n\t);\r\n\treturn {\r\n\t\turl: iconUrl,\r\n\t\tscaledSize: new google.maps.Size(scaledWidth, scaledHeight),\r\n\t\tanchor: new google.maps.Point(scaledWidth / 2, scaledHeight)\r\n\t};\r\n};\r\n\r\nexport const iconProps = () => {\r\n\treturn {\r\n\t\tpath: iconPath,\r\n\t\tfillOpacity: 1,\r\n\t\tstrokeWeight: 1.75,\r\n\t\tscale: 1.6,\r\n\t\tanchor: new google.maps.Point(12, 17)\r\n\t};\r\n};\r\n\r\nexport const markerIcon = markerConfigs => {\r\n\treturn {\r\n\t\t...iconProps(),\r\n\t\tfillColor: markerConfigs.fillColor,\r\n\t\tstrokeColor: markerConfigs.strokeColor\r\n\t};\r\n};\r\n\r\nexport const markerIconSelected = markerConfigs => {\r\n\treturn {\r\n\t\t...iconProps(),\r\n\t\tfillColor: markerConfigs.selectedFillColor,\r\n\t\tstrokeColor: markerConfigs.selectedStrokeColor\r\n\t};\r\n};\r\n\r\nexport const pinIcon = markerConfigs => {\r\n\tconst { fillColor, strokeColor } = markerConfigs;\r\n\r\n\tconst svg = `\r\n\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"30\" viewBox=\"-6 -4 24 24\">\r\n\t\t<path d=\"${iconPath}\" fill=\"${fillColor}\" stroke=\"${strokeColor}\" stroke-width=\"2\"/>\r\n\t </svg>\r\n\t`;\r\n\r\n\treturn `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;\r\n};\r\n\r\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,kBAAkB;AACjCJ,MAAAA,GAAG,4VAAAG,MAAA,CAGWV,SAAS,EAAA,WAAA,CAAA,CAAAU,MA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AA,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;;;;"}
|
|
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 aria-hidden=\"true\" 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,WA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|
+
{
|
|
75
|
+
field: "categoryClass",
|
|
76
|
+
name: "categoryClass",
|
|
77
|
+
icon: "icon-park-solid:tree-list"
|
|
78
|
+
},
|
|
74
79
|
{
|
|
75
80
|
field: "category",
|
|
76
81
|
name: "Category",
|
|
@@ -81,6 +86,16 @@ const FieldMapper = ({
|
|
|
81
86
|
name: "Schedule",
|
|
82
87
|
icon: "gravity-ui:clock-fill"
|
|
83
88
|
},
|
|
89
|
+
{
|
|
90
|
+
field: "city",
|
|
91
|
+
name: "Location",
|
|
92
|
+
icon: "fluent:location-16-filled"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
field: "state",
|
|
96
|
+
name: "Location",
|
|
97
|
+
icon: "fluent:location-16-filled"
|
|
98
|
+
},
|
|
84
99
|
{
|
|
85
100
|
field: "cityState",
|
|
86
101
|
name: "Location",
|
package/src/util/mapIconUtil.js
CHANGED
|
@@ -1,180 +1,180 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
|
-
import { placeTypes } from '~/constants/placeTypes';
|
|
3
|
-
|
|
4
|
-
const customSVGIcon = (
|
|
5
|
-
type,
|
|
6
|
-
fillColor = "#FFFFFF",
|
|
7
|
-
strokeColor = "#000000",
|
|
8
|
-
backgroundFill = "#000000",
|
|
9
|
-
backgroundStroke = "#000000"
|
|
10
|
-
) => {
|
|
11
|
-
let svg = "";
|
|
12
|
-
switch (type) {
|
|
13
|
-
case placeTypes.FOOD:
|
|
14
|
-
svg = `
|
|
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"
|
|
16
|
-
viewBox="0 0 60.8 89.6" preserveAspectRatio="xMidYMid meet" style="enable-background:new 0 0 60.8 89.6;" xml:space="preserve">
|
|
17
|
-
<style type="text/css">
|
|
18
|
-
.st0{fill:${fillColor}; stroke:${strokeColor};}
|
|
19
|
-
.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}
|
|
20
|
-
</style>
|
|
21
|
-
<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"/>
|
|
22
|
-
<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
|
|
23
|
-
l-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"/>
|
|
24
|
-
<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
|
|
25
|
-
c1.1-2.4,3.9-4,5.6-4C40,18.3,40,52.4,40,52.4z"/>
|
|
26
|
-
</svg>
|
|
27
|
-
`;
|
|
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"
|
|
31
|
-
viewBox="0 0 60.8 89.6" preserveAspectRatio="xMidYMid meet" style="enable-background:new 0 0 60.8 89.6;" xml:space="preserve">
|
|
32
|
-
<style type="text/css">
|
|
33
|
-
.st0{fill:${fillColor}; stroke:${strokeColor};}
|
|
34
|
-
.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}
|
|
35
|
-
</style>
|
|
36
|
-
<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"/>
|
|
37
|
-
<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
|
|
38
|
-
c1.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
|
|
39
|
-
c0,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
|
|
40
|
-
s-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
|
|
41
|
-
S32.3,28.7,30.4,28.7z"/>
|
|
42
|
-
</svg>
|
|
43
|
-
`;
|
|
44
|
-
break;
|
|
45
|
-
case placeTypes.SCHOOL:
|
|
46
|
-
svg = `
|
|
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"
|
|
48
|
-
viewBox="0 0 60.8 89.6" preserveAspectRatio="xMidYMid meet" style="enable-background:new 0 0 60.8 89.6;" xml:space="preserve">
|
|
49
|
-
<style type="text/css">
|
|
50
|
-
.st0{fill:${fillColor}; stroke:${strokeColor};}
|
|
51
|
-
.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}
|
|
52
|
-
</style>
|
|
53
|
-
<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"/>
|
|
54
|
-
<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"/>
|
|
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 "/>
|
|
56
|
-
</svg>
|
|
57
|
-
`;
|
|
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"
|
|
61
|
-
viewBox="0 0 60.8 89.6" preserveAspectRatio="xMidYMid meet" style="enable-background:new 0 0 60.8 89.6;" xml:space="preserve">
|
|
62
|
-
<style type="text/css">
|
|
63
|
-
.st0{fill:${fillColor}; stroke:${strokeColor};}
|
|
64
|
-
.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}
|
|
65
|
-
</style>
|
|
66
|
-
<g>
|
|
67
|
-
<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"
|
|
68
|
-
/>
|
|
69
|
-
</g>
|
|
70
|
-
<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
|
|
71
|
-
s1.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
|
|
72
|
-
h-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
|
|
73
|
-
C45.4,26.9,45.5,27.3,45.4,27.7z"/>
|
|
74
|
-
<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"/>
|
|
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"/>
|
|
76
|
-
</svg>
|
|
77
|
-
`;
|
|
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"
|
|
81
|
-
viewBox="0 0 60.8 89.6" preserveAspectRatio="xMidYMid meet" style="enable-background:new 0 0 60.8 89.6;" xml:space="preserve">
|
|
82
|
-
<style type="text/css">
|
|
83
|
-
.st0{fill:${fillColor}; stroke:${strokeColor};}
|
|
84
|
-
.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}
|
|
85
|
-
</style>
|
|
86
|
-
<g>
|
|
87
|
-
<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"
|
|
88
|
-
/>
|
|
89
|
-
</g>
|
|
90
|
-
<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
|
|
91
|
-
c2.3,0,4.2,1.9,4.2,4.2v1.4h-2.8v-2.8H19.3v9.7h6.9v7H26.3z"/>
|
|
92
|
-
<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
|
|
93
|
-
v-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"/>
|
|
94
|
-
<circle cx="20.7" cy="37.1" r="1.4"/>
|
|
95
|
-
<circle cx="41.5" cy="37.1" r="1.4"/>
|
|
96
|
-
<circle cx="30.4" cy="37.1" r="1.4"/>
|
|
97
|
-
<polygon points="31,30.2 29.6,34.4 42.4,34.4 40.9,30.2 "/>
|
|
98
|
-
</svg>
|
|
99
|
-
`;
|
|
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"
|
|
103
|
-
viewBox="0 0 60.8 89.6" style="enable-background:new 0 0 60.8 89.6;" xml:space="preserve">
|
|
104
|
-
<style type="text/css">
|
|
105
|
-
.st0{fill:${fillColor}; stroke:${strokeColor};}
|
|
106
|
-
.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}
|
|
107
|
-
</style>
|
|
108
|
-
<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"/>
|
|
109
|
-
<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"/>
|
|
110
|
-
<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
|
|
111
|
-
c0-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
|
|
112
|
-
L38,40.8z"/>
|
|
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"/>
|
|
114
|
-
</svg>
|
|
115
|
-
`;
|
|
116
|
-
break;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const iconUrl = `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;
|
|
120
|
-
return iconUrl;
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
export 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";
|
|
124
|
-
|
|
125
|
-
export const markerIconProps = (placeMarkerConfigs, type) => {
|
|
126
|
-
|
|
127
|
-
const scaledWidth = placeMarkerConfigs.size;
|
|
128
|
-
const scaledHeight = (scaledWidth * 3) / 2;
|
|
129
|
-
const iconUrl = customSVGIcon(
|
|
130
|
-
type,
|
|
131
|
-
placeMarkerConfigs.colors.innerFillColor,
|
|
132
|
-
placeMarkerConfigs.colors.innerStrokeColor,
|
|
133
|
-
placeMarkerConfigs.colors.outerFillColor,
|
|
134
|
-
placeMarkerConfigs.colors.outerStrokeColor
|
|
135
|
-
);
|
|
136
|
-
return {
|
|
137
|
-
url: iconUrl,
|
|
138
|
-
scaledSize: new google.maps.Size(scaledWidth, scaledHeight),
|
|
139
|
-
anchor: new google.maps.Point(scaledWidth / 2, scaledHeight)
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
export const iconProps = () => {
|
|
144
|
-
return {
|
|
145
|
-
path: iconPath,
|
|
146
|
-
fillOpacity: 1,
|
|
147
|
-
strokeWeight: 1.75,
|
|
148
|
-
scale: 1.6,
|
|
149
|
-
anchor: new google.maps.Point(12, 17)
|
|
150
|
-
};
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
export const markerIcon = markerConfigs => {
|
|
154
|
-
return {
|
|
155
|
-
...iconProps(),
|
|
156
|
-
fillColor: markerConfigs.fillColor,
|
|
157
|
-
strokeColor: markerConfigs.strokeColor
|
|
158
|
-
};
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
export const markerIconSelected = markerConfigs => {
|
|
162
|
-
return {
|
|
163
|
-
...iconProps(),
|
|
164
|
-
fillColor: markerConfigs.selectedFillColor,
|
|
165
|
-
strokeColor: markerConfigs.selectedStrokeColor
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
export const pinIcon = markerConfigs => {
|
|
170
|
-
const { fillColor, strokeColor } = markerConfigs;
|
|
171
|
-
|
|
172
|
-
const svg = `
|
|
173
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="-6 -4 24 24">
|
|
174
|
-
<path d="${iconPath}" fill="${fillColor}" stroke="${strokeColor}" stroke-width="2"/>
|
|
175
|
-
</svg>
|
|
176
|
-
`;
|
|
177
|
-
|
|
178
|
-
return `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;
|
|
179
|
-
};
|
|
180
|
-
|
|
1
|
+
/* eslint-disable no-undef */
|
|
2
|
+
import { placeTypes } from '~/constants/placeTypes';
|
|
3
|
+
|
|
4
|
+
const customSVGIcon = (
|
|
5
|
+
type,
|
|
6
|
+
fillColor = "#FFFFFF",
|
|
7
|
+
strokeColor = "#000000",
|
|
8
|
+
backgroundFill = "#000000",
|
|
9
|
+
backgroundStroke = "#000000"
|
|
10
|
+
) => {
|
|
11
|
+
let svg = "";
|
|
12
|
+
switch (type) {
|
|
13
|
+
case placeTypes.FOOD:
|
|
14
|
+
svg = `
|
|
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"
|
|
16
|
+
viewBox="0 0 60.8 89.6" preserveAspectRatio="xMidYMid meet" style="enable-background:new 0 0 60.8 89.6;" xml:space="preserve">
|
|
17
|
+
<style type="text/css">
|
|
18
|
+
.st0{fill:${fillColor}; stroke:${strokeColor};}
|
|
19
|
+
.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}
|
|
20
|
+
</style>
|
|
21
|
+
<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"/>
|
|
22
|
+
<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
|
|
23
|
+
l-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"/>
|
|
24
|
+
<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
|
|
25
|
+
c1.1-2.4,3.9-4,5.6-4C40,18.3,40,52.4,40,52.4z"/>
|
|
26
|
+
</svg>
|
|
27
|
+
`;
|
|
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"
|
|
31
|
+
viewBox="0 0 60.8 89.6" preserveAspectRatio="xMidYMid meet" style="enable-background:new 0 0 60.8 89.6;" xml:space="preserve">
|
|
32
|
+
<style type="text/css">
|
|
33
|
+
.st0{fill:${fillColor}; stroke:${strokeColor};}
|
|
34
|
+
.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}
|
|
35
|
+
</style>
|
|
36
|
+
<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"/>
|
|
37
|
+
<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
|
|
38
|
+
c1.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
|
|
39
|
+
c0,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
|
|
40
|
+
s-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
|
|
41
|
+
S32.3,28.7,30.4,28.7z"/>
|
|
42
|
+
</svg>
|
|
43
|
+
`;
|
|
44
|
+
break;
|
|
45
|
+
case placeTypes.SCHOOL:
|
|
46
|
+
svg = `
|
|
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"
|
|
48
|
+
viewBox="0 0 60.8 89.6" preserveAspectRatio="xMidYMid meet" style="enable-background:new 0 0 60.8 89.6;" xml:space="preserve">
|
|
49
|
+
<style type="text/css">
|
|
50
|
+
.st0{fill:${fillColor}; stroke:${strokeColor};}
|
|
51
|
+
.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}
|
|
52
|
+
</style>
|
|
53
|
+
<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"/>
|
|
54
|
+
<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"/>
|
|
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 "/>
|
|
56
|
+
</svg>
|
|
57
|
+
`;
|
|
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"
|
|
61
|
+
viewBox="0 0 60.8 89.6" preserveAspectRatio="xMidYMid meet" style="enable-background:new 0 0 60.8 89.6;" xml:space="preserve">
|
|
62
|
+
<style type="text/css">
|
|
63
|
+
.st0{fill:${fillColor}; stroke:${strokeColor};}
|
|
64
|
+
.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}
|
|
65
|
+
</style>
|
|
66
|
+
<g>
|
|
67
|
+
<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"
|
|
68
|
+
/>
|
|
69
|
+
</g>
|
|
70
|
+
<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
|
|
71
|
+
s1.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
|
|
72
|
+
h-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
|
|
73
|
+
C45.4,26.9,45.5,27.3,45.4,27.7z"/>
|
|
74
|
+
<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"/>
|
|
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"/>
|
|
76
|
+
</svg>
|
|
77
|
+
`;
|
|
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"
|
|
81
|
+
viewBox="0 0 60.8 89.6" preserveAspectRatio="xMidYMid meet" style="enable-background:new 0 0 60.8 89.6;" xml:space="preserve">
|
|
82
|
+
<style type="text/css">
|
|
83
|
+
.st0{fill:${fillColor}; stroke:${strokeColor};}
|
|
84
|
+
.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}
|
|
85
|
+
</style>
|
|
86
|
+
<g>
|
|
87
|
+
<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"
|
|
88
|
+
/>
|
|
89
|
+
</g>
|
|
90
|
+
<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
|
|
91
|
+
c2.3,0,4.2,1.9,4.2,4.2v1.4h-2.8v-2.8H19.3v9.7h6.9v7H26.3z"/>
|
|
92
|
+
<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
|
|
93
|
+
v-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"/>
|
|
94
|
+
<circle cx="20.7" cy="37.1" r="1.4"/>
|
|
95
|
+
<circle cx="41.5" cy="37.1" r="1.4"/>
|
|
96
|
+
<circle cx="30.4" cy="37.1" r="1.4"/>
|
|
97
|
+
<polygon points="31,30.2 29.6,34.4 42.4,34.4 40.9,30.2 "/>
|
|
98
|
+
</svg>
|
|
99
|
+
`;
|
|
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"
|
|
103
|
+
viewBox="0 0 60.8 89.6" style="enable-background:new 0 0 60.8 89.6;" xml:space="preserve">
|
|
104
|
+
<style type="text/css">
|
|
105
|
+
.st0{fill:${fillColor}; stroke:${strokeColor};}
|
|
106
|
+
.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}
|
|
107
|
+
</style>
|
|
108
|
+
<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"/>
|
|
109
|
+
<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"/>
|
|
110
|
+
<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
|
|
111
|
+
c0-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
|
|
112
|
+
L38,40.8z"/>
|
|
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"/>
|
|
114
|
+
</svg>
|
|
115
|
+
`;
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const iconUrl = `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;
|
|
120
|
+
return iconUrl;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export 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";
|
|
124
|
+
|
|
125
|
+
export const markerIconProps = (placeMarkerConfigs, type) => {
|
|
126
|
+
|
|
127
|
+
const scaledWidth = placeMarkerConfigs.size;
|
|
128
|
+
const scaledHeight = (scaledWidth * 3) / 2;
|
|
129
|
+
const iconUrl = customSVGIcon(
|
|
130
|
+
type,
|
|
131
|
+
placeMarkerConfigs.colors.innerFillColor,
|
|
132
|
+
placeMarkerConfigs.colors.innerStrokeColor,
|
|
133
|
+
placeMarkerConfigs.colors.outerFillColor,
|
|
134
|
+
placeMarkerConfigs.colors.outerStrokeColor
|
|
135
|
+
);
|
|
136
|
+
return {
|
|
137
|
+
url: iconUrl,
|
|
138
|
+
scaledSize: new google.maps.Size(scaledWidth, scaledHeight),
|
|
139
|
+
anchor: new google.maps.Point(scaledWidth / 2, scaledHeight)
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export const iconProps = () => {
|
|
144
|
+
return {
|
|
145
|
+
path: iconPath,
|
|
146
|
+
fillOpacity: 1,
|
|
147
|
+
strokeWeight: 1.75,
|
|
148
|
+
scale: 1.6,
|
|
149
|
+
anchor: new google.maps.Point(12, 17)
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export const markerIcon = markerConfigs => {
|
|
154
|
+
return {
|
|
155
|
+
...iconProps(),
|
|
156
|
+
fillColor: markerConfigs.fillColor,
|
|
157
|
+
strokeColor: markerConfigs.strokeColor
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export const markerIconSelected = markerConfigs => {
|
|
162
|
+
return {
|
|
163
|
+
...iconProps(),
|
|
164
|
+
fillColor: markerConfigs.selectedFillColor,
|
|
165
|
+
strokeColor: markerConfigs.selectedStrokeColor
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export const pinIcon = markerConfigs => {
|
|
170
|
+
const { fillColor, strokeColor } = markerConfigs;
|
|
171
|
+
|
|
172
|
+
const svg = `
|
|
173
|
+
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="-6 -4 24 24">
|
|
174
|
+
<path d="${iconPath}" fill="${fillColor}" stroke="${strokeColor}" stroke-width="2"/>
|
|
175
|
+
</svg>
|
|
176
|
+
`;
|
|
177
|
+
|
|
178
|
+
return `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;
|
|
179
|
+
};
|
|
180
|
+
|