@abcagency/hc-ui-components 1.2.8 → 1.2.9

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.
Files changed (132) hide show
  1. package/dist/_virtual/_rollupPluginBabelHelpers.js +516 -516
  2. package/dist/apis/hcApi.js +189 -189
  3. package/dist/apis/hcApi.js.map +1 -1
  4. package/dist/clientToken.js +10 -10
  5. package/dist/clientToken.js.map +1 -1
  6. package/dist/components/HireControlMap.js +135 -135
  7. package/dist/components/HireControlMap.js.map +1 -1
  8. package/dist/components/modules/accordions/MapAccordionItem.js +76 -76
  9. package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -1
  10. package/dist/components/modules/accordions/default.js +108 -108
  11. package/dist/components/modules/accordions/default.js.map +1 -1
  12. package/dist/components/modules/accordions/filterItem.js +50 -50
  13. package/dist/components/modules/accordions/filterItem.js.map +1 -1
  14. package/dist/components/modules/accordions/filters.js +46 -46
  15. package/dist/components/modules/accordions/filters.js.map +1 -1
  16. package/dist/components/modules/buttons/button-group-apply.js +87 -87
  17. package/dist/components/modules/buttons/button-group-apply.js.map +1 -1
  18. package/dist/components/modules/buttons/commute-pill.js +18 -18
  19. package/dist/components/modules/buttons/commute-pill.js.map +1 -1
  20. package/dist/components/modules/buttons/default.js +145 -145
  21. package/dist/components/modules/buttons/default.js.map +1 -1
  22. package/dist/components/modules/buttons/items-pill.js +23 -23
  23. package/dist/components/modules/buttons/items-pill.js.map +1 -1
  24. package/dist/components/modules/buttons/pill-wrapper.js +20 -20
  25. package/dist/components/modules/buttons/pill-wrapper.js.map +1 -1
  26. package/dist/components/modules/buttons/show-all-button.js +39 -39
  27. package/dist/components/modules/buttons/show-all-button.js.map +1 -1
  28. package/dist/components/modules/cards/default.js +102 -102
  29. package/dist/components/modules/cards/default.js.map +1 -1
  30. package/dist/components/modules/cards/filter.js +38 -38
  31. package/dist/components/modules/cards/filter.js.map +1 -1
  32. package/dist/components/modules/dialogs/apply-dialog.js +46 -46
  33. package/dist/components/modules/dialogs/apply-dialog.js.map +1 -1
  34. package/dist/components/modules/filter/commute.js +184 -184
  35. package/dist/components/modules/filter/commute.js.map +1 -1
  36. package/dist/components/modules/filter/index.js +79 -79
  37. package/dist/components/modules/filter/index.js.map +1 -1
  38. package/dist/components/modules/filter/item.js +71 -71
  39. package/dist/components/modules/filter/item.js.map +1 -1
  40. package/dist/components/modules/filter/location.js +68 -68
  41. package/dist/components/modules/filter/location.js.map +1 -1
  42. package/dist/components/modules/filter/points-of-interest.js +38 -38
  43. package/dist/components/modules/filter/points-of-interest.js.map +1 -1
  44. package/dist/components/modules/filter/radio-item.js +46 -46
  45. package/dist/components/modules/filter/radio-item.js.map +1 -1
  46. package/dist/components/modules/filter/search.js +83 -83
  47. package/dist/components/modules/filter/search.js.map +1 -1
  48. package/dist/components/modules/filter/sort.js +93 -93
  49. package/dist/components/modules/filter/sort.js.map +1 -1
  50. package/dist/components/modules/grid.js +39 -39
  51. package/dist/components/modules/grid.js.map +1 -1
  52. package/dist/components/modules/icon.js +23 -23
  53. package/dist/components/modules/icon.js.map +1 -1
  54. package/dist/components/modules/jobListing/listing-details.js +71 -71
  55. package/dist/components/modules/jobListing/listing-details.js.map +1 -1
  56. package/dist/components/modules/maps/info-window-card.js +14 -14
  57. package/dist/components/modules/maps/info-window-card.js.map +1 -1
  58. package/dist/components/modules/maps/info-window-content.js +49 -39
  59. package/dist/components/modules/maps/info-window-content.js.map +1 -1
  60. package/dist/components/modules/maps/list/field-mapper.js +88 -88
  61. package/dist/components/modules/maps/list/field-mapper.js.map +1 -1
  62. package/dist/components/modules/maps/list/header-item.js +59 -59
  63. package/dist/components/modules/maps/list/header-item.js.map +1 -1
  64. package/dist/components/modules/maps/list/header.js +37 -37
  65. package/dist/components/modules/maps/list/header.js.map +1 -1
  66. package/dist/components/modules/maps/list/index.js +93 -93
  67. package/dist/components/modules/maps/list/index.js.map +1 -1
  68. package/dist/components/modules/maps/list/item-expand-card/index.js +16 -16
  69. package/dist/components/modules/maps/list/item-expand-card/index.js.map +1 -1
  70. package/dist/components/modules/maps/list/item-expand-card/recruiter-contact-nav.js +38 -38
  71. package/dist/components/modules/maps/list/item-expand-card/recruiter-contact-nav.js.map +1 -1
  72. package/dist/components/modules/maps/list/item-expand-card/recruiter-details.js +40 -40
  73. package/dist/components/modules/maps/list/item-expand-card/recruiter-details.js.map +1 -1
  74. package/dist/components/modules/maps/list/item-expand-card/recruiter-headshot.js +20 -20
  75. package/dist/components/modules/maps/list/item-expand-card/recruiter-headshot.js.map +1 -1
  76. package/dist/components/modules/maps/list/list-item/index.js +98 -98
  77. package/dist/components/modules/maps/list/list-item/index.js.map +1 -1
  78. package/dist/components/modules/maps/map-list.js +57 -57
  79. package/dist/components/modules/maps/map-list.js.map +1 -1
  80. package/dist/components/modules/maps/map-marker.js +85 -85
  81. package/dist/components/modules/maps/map-marker.js.map +1 -1
  82. package/dist/components/modules/maps/map.js +201 -201
  83. package/dist/components/modules/maps/map.js.map +1 -1
  84. package/dist/components/modules/maps/place-marker.js +37 -37
  85. package/dist/components/modules/maps/place-marker.js.map +1 -1
  86. package/dist/components/modules/maps/tabs.js +84 -84
  87. package/dist/components/modules/maps/tabs.js.map +1 -1
  88. package/dist/constants/placeTypes.js +11 -11
  89. package/dist/constants/placeTypes.js.map +1 -1
  90. package/dist/contexts/mapContext.js +133 -133
  91. package/dist/contexts/mapContext.js.map +1 -1
  92. package/dist/contexts/mapListContext.js +280 -280
  93. package/dist/contexts/mapListContext.js.map +1 -1
  94. package/dist/contexts/placesContext.js +152 -152
  95. package/dist/contexts/placesContext.js.map +1 -1
  96. package/dist/hooks/useList.js +119 -119
  97. package/dist/hooks/useList.js.map +1 -1
  98. package/dist/index.js +2 -2
  99. package/dist/services/_virtual/_rollupPluginBabelHelpers.js +372 -372
  100. package/dist/services/apis/hcApi.js +189 -189
  101. package/dist/services/apis/hcApi.js.map +1 -1
  102. package/dist/services/clientToken.js +7 -7
  103. package/dist/services/clientToken.js.map +1 -1
  104. package/dist/services/configService.js +33 -33
  105. package/dist/services/configService.js.map +1 -1
  106. package/dist/services/googlePlacesNearbyService.js +61 -61
  107. package/dist/services/googlePlacesNearbyService.js.map +1 -1
  108. package/dist/services/listingAggregatorService.js +56 -56
  109. package/dist/services/listingAggregatorService.js.map +1 -1
  110. package/dist/services/listingEntityService.js +36 -36
  111. package/dist/services/listingEntityService.js.map +1 -1
  112. package/dist/services/listingService.js +64 -64
  113. package/dist/services/listingService.js.map +1 -1
  114. package/dist/services/recruiterService.js +36 -36
  115. package/dist/services/recruiterService.js.map +1 -1
  116. package/dist/services/styles/index.css +2 -2
  117. package/dist/styles/index.css +2 -2
  118. package/dist/util/filterUtil.js +213 -213
  119. package/dist/util/filterUtil.js.map +1 -1
  120. package/dist/util/loading.js +16 -16
  121. package/dist/util/loading.js.map +1 -1
  122. package/dist/util/localStorageUtil.js +32 -32
  123. package/dist/util/localStorageUtil.js.map +1 -1
  124. package/dist/util/mapIconUtil.js +73 -73
  125. package/dist/util/mapIconUtil.js.map +1 -1
  126. package/dist/util/mapUtil.js +76 -76
  127. package/dist/util/mapUtil.js.map +1 -1
  128. package/dist/util/sortUtil.js +33 -33
  129. package/dist/util/sortUtil.js.map +1 -1
  130. package/dist/util/stringUtils.js +9 -9
  131. package/dist/util/stringUtils.js.map +1 -1
  132. package/package.json +1 -1
@@ -1,32 +1,32 @@
1
- var getStorageObject = function getStorageObject(item) {
2
- var _JSON$parse;
3
- var defaultItem = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
4
- if (typeof window == 'undefined') return defaultItem;
5
- if (localStorage.getItem(item) == null) return defaultItem;
6
- if (localStorage.getItem(item) == 'undefined') {
7
- localStorage.removeItem(item);
8
- }
9
- return (_JSON$parse = JSON.parse(localStorage.getItem(item))) !== null && _JSON$parse !== void 0 ? _JSON$parse : defaultItem;
10
- };
11
- var getStorageItem = function getStorageItem(item) {
12
- var _localStorage$getItem;
13
- var defaultItem = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
14
- if (typeof window == 'undefined') return defaultItem;
15
- if (localStorage.getItem(item) == null) return defaultItem;
16
- if (localStorage.getItem(item) == 'undefined') {
17
- localStorage.removeItem(item);
18
- }
19
- return (_localStorage$getItem = localStorage.getItem(item)) !== null && _localStorage$getItem !== void 0 ? _localStorage$getItem : defaultItem;
20
- };
21
- var setStorageObject = function setStorageObject(key, item) {
22
- if (typeof window == 'undefined') return;
23
- if (item == undefined) return;
24
- try {
25
- localStorage.setItem(key, JSON.stringify(item));
26
- } catch (err) {
27
- console.log(err);
28
- }
29
- };
30
-
31
- export { getStorageItem, getStorageObject, setStorageObject };
32
- //# sourceMappingURL=localStorageUtil.js.map
1
+ var getStorageObject = function getStorageObject(item) {
2
+ var _JSON$parse;
3
+ var defaultItem = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
4
+ if (typeof window == 'undefined') return defaultItem;
5
+ if (localStorage.getItem(item) == null) return defaultItem;
6
+ if (localStorage.getItem(item) == 'undefined') {
7
+ localStorage.removeItem(item);
8
+ }
9
+ return (_JSON$parse = JSON.parse(localStorage.getItem(item))) !== null && _JSON$parse !== void 0 ? _JSON$parse : defaultItem;
10
+ };
11
+ var getStorageItem = function getStorageItem(item) {
12
+ var _localStorage$getItem;
13
+ var defaultItem = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
14
+ if (typeof window == 'undefined') return defaultItem;
15
+ if (localStorage.getItem(item) == null) return defaultItem;
16
+ if (localStorage.getItem(item) == 'undefined') {
17
+ localStorage.removeItem(item);
18
+ }
19
+ return (_localStorage$getItem = localStorage.getItem(item)) !== null && _localStorage$getItem !== void 0 ? _localStorage$getItem : defaultItem;
20
+ };
21
+ var setStorageObject = function setStorageObject(key, item) {
22
+ if (typeof window == 'undefined') return;
23
+ if (item == undefined) return;
24
+ try {
25
+ localStorage.setItem(key, JSON.stringify(item));
26
+ } catch (err) {
27
+ console.log(err);
28
+ }
29
+ };
30
+
31
+ export { getStorageItem, getStorageObject, setStorageObject };
32
+ //# sourceMappingURL=localStorageUtil.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"localStorageUtil.js","sources":["../../src/util/localStorageUtil.js"],"sourcesContent":["export const getStorageObject = (item, defaultItem = null) =>{\n\tif(typeof window == 'undefined') return defaultItem;\n\tif(localStorage.getItem(item) == null) return defaultItem;\n\tif(localStorage.getItem(item) == 'undefined'){\n\t\tlocalStorage.removeItem(item);\n\t}\n\treturn JSON.parse(localStorage.getItem(item)) ?? defaultItem;\n};\n\nexport const getStorageItem = (item, defaultItem = null) =>{\n\tif(typeof window == 'undefined') return defaultItem;\n\tif(localStorage.getItem(item) == null) return defaultItem;\n\tif(localStorage.getItem(item) == 'undefined'){\n\t\tlocalStorage.removeItem(item);\n\t}\n\treturn localStorage.getItem(item) ?? defaultItem;\n};\n\nexport const setStorageObject = (key, item) =>{\n\tif(typeof window == 'undefined') return;\n\tif(item == undefined)return;\n\ttry{\n\t\tlocalStorage.setItem(key, JSON.stringify(item));\n\t}catch(err){\n\t\tconsole.log(err);\n\t}\n};"],"names":["getStorageObject","item","_JSON$parse","defaultItem","arguments","length","undefined","window","localStorage","getItem","removeItem","JSON","parse","getStorageItem","_localStorage$getItem","setStorageObject","key","setItem","stringify","err","console","log"],"mappings":"IAAaA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,IAAI,EAAwB;AAAA,EAAA,IAAAC,WAAA,CAAA;AAAA,EAAA,IAAtBC,WAAW,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,IAAI,CAAA;AACxD,EAAA,IAAG,OAAOG,MAAM,IAAI,WAAW,EAAE,OAAOJ,WAAW,CAAA;EACnD,IAAGK,YAAY,CAACC,OAAO,CAACR,IAAI,CAAC,IAAI,IAAI,EAAE,OAAOE,WAAW,CAAA;EACzD,IAAGK,YAAY,CAACC,OAAO,CAACR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,GAAG,EAAEL,IAAI,CAACO,SAAS,CAACjB,IAAI,CAAC,CAAC,CAAA;GAC/C,CAAA,OAAMkB,GAAG,EAAC;AACVC,IAAAA,OAAO,CAACC,GAAG,CAACF,GAAG,CAAC,CAAA;AACjB,GAAA;AACD;;;;"}
1
+ {"version":3,"file":"localStorageUtil.js","sources":["../../src/util/localStorageUtil.js"],"sourcesContent":["export const getStorageObject = (item, defaultItem = null) =>{\r\n\tif(typeof window == 'undefined') return defaultItem;\r\n\tif(localStorage.getItem(item) == null) return defaultItem;\r\n\tif(localStorage.getItem(item) == 'undefined'){\r\n\t\tlocalStorage.removeItem(item);\r\n\t}\r\n\treturn JSON.parse(localStorage.getItem(item)) ?? defaultItem;\r\n};\r\n\r\nexport const getStorageItem = (item, defaultItem = null) =>{\r\n\tif(typeof window == 'undefined') return defaultItem;\r\n\tif(localStorage.getItem(item) == null) return defaultItem;\r\n\tif(localStorage.getItem(item) == 'undefined'){\r\n\t\tlocalStorage.removeItem(item);\r\n\t}\r\n\treturn localStorage.getItem(item) ?? defaultItem;\r\n};\r\n\r\nexport const setStorageObject = (key, item) =>{\r\n\tif(typeof window == 'undefined') return;\r\n\tif(item == undefined)return;\r\n\ttry{\r\n\t\tlocalStorage.setItem(key, JSON.stringify(item));\r\n\t}catch(err){\r\n\t\tconsole.log(err);\r\n\t}\r\n};"],"names":["getStorageObject","item","_JSON$parse","defaultItem","arguments","length","undefined","window","localStorage","getItem","removeItem","JSON","parse","getStorageItem","_localStorage$getItem","setStorageObject","key","setItem","stringify","err","console","log"],"mappings":"IAAaA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,IAAI,EAAwB;AAAA,EAAA,IAAAC,WAAA,CAAA;AAAA,EAAA,IAAtBC,WAAW,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,IAAI,CAAA;AACxD,EAAA,IA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BA,CAAIC,GAAG,EAAEf,IAAI,EAAI;AAC7C,EAAA,IAAG,OAAOM,MAAM,IAAI,WAAW,EAAE,OAAA;EACjC,IAAGN,IAAI,IAAIK,SAAS,EAAC,OAAA;EACrB,IAAG;IACFE,YAAY,CAACS,OAAO,CAACD,GAAG,EAAEL,IAAI,CAACO,SAAS,CAACjB,IAAI,CAAC,CAAC,CAAA;GAC/C,CAAA,OAAMkB,GAAG,EAAC;AACVC,IAAAA,OAAO,CAACC,GAAG,CAACF,GAAG,CAAC,CAAA;AACjB,GAAA;AACD;;;;"}
@@ -1,73 +1,73 @@
1
- import { objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
2
- import { placeTypes } from '../constants/placeTypes.js';
3
-
4
- var customSVGIcon = function customSVGIcon(type) {
5
- var fillColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "#FFFFFF";
6
- var strokeColor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "#000000";
7
- var backgroundFill = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "#000000";
8
- var backgroundStroke = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "#000000";
9
- var svg = "";
10
- switch (type) {
11
- case placeTypes.FOOD:
12
- svg = "\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:".concat(fillColor, "; stroke:").concat(strokeColor, ";}\n\t\t\t\t\t.svg-background{fill:").concat(backgroundFill, "; stroke:").concat(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");
13
- break;
14
- case placeTypes.TOURIST_ATTRACTION:
15
- 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\"\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:".concat(fillColor, "; stroke:").concat(strokeColor, ";}\n\t\t\t\t\t.svg-background{fill:").concat(backgroundFill, "; stroke:").concat(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");
16
- break;
17
- case placeTypes.SCHOOL:
18
- svg = "\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:".concat(fillColor, "; stroke:").concat(strokeColor, ";}\n\t\t\t\t\t.svg-background{fill:").concat(backgroundFill, "; stroke:").concat(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");
19
- break;
20
- case placeTypes.STORE:
21
- 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\"\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:".concat(fillColor, "; stroke:").concat(strokeColor, ";}\n\t\t\t\t\t.svg-background{fill:").concat(backgroundFill, "; stroke:").concat(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");
22
- break;
23
- case placeTypes.TRANSIT_STATION:
24
- 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\"\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:".concat(fillColor, "; stroke:").concat(strokeColor, ";}\n\t\t\t\t\t.svg-background{fill:").concat(backgroundFill, "; stroke:").concat(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");
25
- break;
26
- case placeTypes.PLACE_OF_WORSHIP:
27
- 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\"\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:".concat(fillColor, "; stroke:").concat(strokeColor, ";}\n\t\t\t\t\t.svg-background{fill:").concat(backgroundFill, "; stroke:").concat(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");
28
- break;
29
- }
30
- var iconUrl = "data:image/svg+xml;utf8,".concat(encodeURIComponent(svg));
31
- return iconUrl;
32
- };
33
- var 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";
34
- var markerIconProps = function markerIconProps(placeMarkerConfigs, type) {
35
- var scaledWidth = placeMarkerConfigs.size;
36
- var scaledHeight = scaledWidth * 3 / 2;
37
- var iconUrl = customSVGIcon(type, placeMarkerConfigs.colors.innerFillColor, placeMarkerConfigs.colors.innerStrokeColor, placeMarkerConfigs.colors.outerFillColor, placeMarkerConfigs.colors.outerStrokeColor);
38
- return {
39
- url: iconUrl,
40
- scaledSize: new google.maps.Size(scaledWidth, scaledHeight),
41
- anchor: new google.maps.Point(scaledWidth / 2, scaledHeight)
42
- };
43
- };
44
- var iconProps = function iconProps() {
45
- return {
46
- path: iconPath,
47
- fillOpacity: 1,
48
- strokeWeight: 1.75,
49
- scale: 1.6,
50
- anchor: new google.maps.Point(12, 17)
51
- };
52
- };
53
- var markerIcon = function markerIcon(markerConfigs) {
54
- return _objectSpread2(_objectSpread2({}, iconProps()), {}, {
55
- fillColor: markerConfigs.fillColor,
56
- strokeColor: markerConfigs.strokeColor
57
- });
58
- };
59
- var markerIconSelected = function markerIconSelected(markerConfigs) {
60
- return _objectSpread2(_objectSpread2({}, iconProps()), {}, {
61
- fillColor: markerConfigs.selectedFillColor,
62
- strokeColor: markerConfigs.selectedStrokeColor
63
- });
64
- };
65
- var pinIcon = function pinIcon(markerConfigs) {
66
- var fillColor = markerConfigs.fillColor,
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");
69
- return "data:image/svg+xml;utf8,".concat(encodeURIComponent(svg));
70
- };
71
-
72
- export { iconPath, iconProps, markerIcon, markerIconProps, markerIconSelected, pinIcon };
73
- //# sourceMappingURL=mapIconUtil.js.map
1
+ import { objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
2
+ import { placeTypes } from '../constants/placeTypes.js';
3
+
4
+ var customSVGIcon = function customSVGIcon(type) {
5
+ var fillColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "#FFFFFF";
6
+ var strokeColor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "#000000";
7
+ var backgroundFill = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "#000000";
8
+ var backgroundStroke = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "#000000";
9
+ var svg = "";
10
+ switch (type) {
11
+ case placeTypes.FOOD:
12
+ svg = "\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:".concat(fillColor, "; stroke:").concat(strokeColor, ";}\n\t\t\t\t\t.svg-background{fill:").concat(backgroundFill, "; stroke:").concat(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");
13
+ break;
14
+ case placeTypes.TOURIST_ATTRACTION:
15
+ 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\"\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:".concat(fillColor, "; stroke:").concat(strokeColor, ";}\n\t\t\t\t\t.svg-background{fill:").concat(backgroundFill, "; stroke:").concat(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");
16
+ break;
17
+ case placeTypes.SCHOOL:
18
+ svg = "\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:".concat(fillColor, "; stroke:").concat(strokeColor, ";}\n\t\t\t\t\t.svg-background{fill:").concat(backgroundFill, "; stroke:").concat(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");
19
+ break;
20
+ case placeTypes.STORE:
21
+ 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\"\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:".concat(fillColor, "; stroke:").concat(strokeColor, ";}\n\t\t\t\t\t.svg-background{fill:").concat(backgroundFill, "; stroke:").concat(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");
22
+ break;
23
+ case placeTypes.TRANSIT_STATION:
24
+ 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\"\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:".concat(fillColor, "; stroke:").concat(strokeColor, ";}\n\t\t\t\t\t.svg-background{fill:").concat(backgroundFill, "; stroke:").concat(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");
25
+ break;
26
+ case placeTypes.PLACE_OF_WORSHIP:
27
+ 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\"\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:".concat(fillColor, "; stroke:").concat(strokeColor, ";}\n\t\t\t\t\t.svg-background{fill:").concat(backgroundFill, "; stroke:").concat(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");
28
+ break;
29
+ }
30
+ var iconUrl = "data:image/svg+xml;utf8,".concat(encodeURIComponent(svg));
31
+ return iconUrl;
32
+ };
33
+ var 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";
34
+ var markerIconProps = function markerIconProps(placeMarkerConfigs, type) {
35
+ var scaledWidth = placeMarkerConfigs.size;
36
+ var scaledHeight = scaledWidth * 3 / 2;
37
+ var iconUrl = customSVGIcon(type, placeMarkerConfigs.colors.innerFillColor, placeMarkerConfigs.colors.innerStrokeColor, placeMarkerConfigs.colors.outerFillColor, placeMarkerConfigs.colors.outerStrokeColor);
38
+ return {
39
+ url: iconUrl,
40
+ scaledSize: new google.maps.Size(scaledWidth, scaledHeight),
41
+ anchor: new google.maps.Point(scaledWidth / 2, scaledHeight)
42
+ };
43
+ };
44
+ var iconProps = function iconProps() {
45
+ return {
46
+ path: iconPath,
47
+ fillOpacity: 1,
48
+ strokeWeight: 1.75,
49
+ scale: 1.6,
50
+ anchor: new google.maps.Point(12, 17)
51
+ };
52
+ };
53
+ var markerIcon = function markerIcon(markerConfigs) {
54
+ return _objectSpread2(_objectSpread2({}, iconProps()), {}, {
55
+ fillColor: markerConfigs.fillColor,
56
+ strokeColor: markerConfigs.strokeColor
57
+ });
58
+ };
59
+ var markerIconSelected = function markerIconSelected(markerConfigs) {
60
+ return _objectSpread2(_objectSpread2({}, iconProps()), {}, {
61
+ fillColor: markerConfigs.selectedFillColor,
62
+ strokeColor: markerConfigs.selectedStrokeColor
63
+ });
64
+ };
65
+ var pinIcon = function pinIcon(markerConfigs) {
66
+ var fillColor = markerConfigs.fillColor,
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");
69
+ return "data:image/svg+xml;utf8,".concat(encodeURIComponent(svg));
70
+ };
71
+
72
+ export { iconPath, iconProps, markerIcon, markerIconProps, markerIconSelected, pinIcon };
73
+ //# sourceMappingURL=mapIconUtil.js.map
@@ -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\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":";;;AAEA,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,IAC1B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G,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":["import { 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\tcase placeTypes.FOOD:\r\n\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\tbreak;\r\n\tcase placeTypes.TOURIST_ATTRACTION:\r\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\"\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\tbreak;\r\n\tcase placeTypes.SCHOOL:\r\n\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\tbreak;\r\n\tcase placeTypes.STORE:\r\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\"\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\tbreak;\r\n\tcase placeTypes.TRANSIT_STATION:\r\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\"\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\tbreak;\r\n\tcase placeTypes.PLACE_OF_WORSHIP:\r\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\"\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\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":";;;AAEA,IAAMA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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,76 +1,76 @@
1
- import { objectSpread2 as _objectSpread2, defineProperty as _defineProperty } from '../_virtual/_rollupPluginBabelHelpers.js';
2
-
3
- var getDistinctItemsByProximity = function getDistinctItemsByProximity(items, listingEntitiesDetails) {
4
- var clusters = {};
5
- if (!listingEntitiesDetails) return [];
6
- var closeItemPairs = findCloseItems(listingEntitiesDetails);
7
- if (closeItemPairs.length > 0) {
8
- listingEntitiesDetails = adjustItemPositions(listingEntitiesDetails, closeItemPairs);
9
- }
10
- items === null || items === void 0 || items.forEach(function (item) {
11
- if (item.entityId !== -1) {
12
- var entityDetails = listingEntitiesDetails[item.entityId];
13
- if (!entityDetails) {
14
- console.error("Details not found for entityId: ".concat(item.entityId));
15
- return;
16
- }
17
- item.mapDetails = entityDetails;
18
- if (!clusters[item.entityId]) {
19
- clusters[item.entityId] = _objectSpread2(_objectSpread2({}, item.mapDetails), {}, {
20
- items: _defineProperty({}, item.id, item)
21
- });
22
- } else {
23
- clusters[item.entityId].items[item.id] = item;
24
- }
25
- }
26
- });
27
- return Object.values(clusters);
28
- };
29
- var findCloseItems = function findCloseItems(itemsObj) {
30
- var closeItems = [];
31
- var items = Object.values(itemsObj); // Convert object to array for iteration
32
- var proximityThreshold = 0.0001;
33
- for (var i = 0; i < items.length; i++) {
34
- for (var j = i + 1; j < items.length; j++) {
35
- var distanceLat = Math.abs(items[i].latitude - items[j].latitude);
36
- var distanceLng = Math.abs(items[i].longitude - items[j].longitude);
37
- if (distanceLat < proximityThreshold && distanceLng < proximityThreshold) {
38
- closeItems.push({
39
- item1: items[i],
40
- item2: items[j]
41
- });
42
- }
43
- }
44
- }
45
- return closeItems;
46
- };
47
- var adjustItemPositions = function adjustItemPositions(itemsObj, closeItemPairs) {
48
- var adjustmentValue = 0.0001;
49
- var adjustedItems = _objectSpread2({}, itemsObj); // Create a shallow copy of the object
50
-
51
- closeItemPairs.forEach(function (pair) {
52
- if (adjustedItems[pair.item1.id] && adjustedItems[pair.item2.id]) {
53
- adjustedItems[pair.item2.id].latitude += adjustmentValue;
54
- adjustedItems[pair.item2.id].longitude += adjustmentValue;
55
- }
56
- });
57
- return adjustedItems;
58
- };
59
- var clusterOptions = function clusterOptions(clusterGridSize, fillColor) {
60
- return {
61
- gridSize: clusterGridSize,
62
- styles: [{
63
- url: createSvgDataUri(fillColor),
64
- textColor: 'white',
65
- height: 40,
66
- width: 40
67
- }]
68
- };
69
- };
70
- function createSvgDataUri(fillColor) {
71
- var svg = "<svg width=\"50\" height=\"50\" xmlns=\"http://www.w3.org/2000/svg\">\n\t <circle cx=\"25\" cy=\"25\" r=\"20\" fill=\"".concat(fillColor, "\" />\n\t</svg>");
72
- return "data:image/svg+xml;base64,".concat(btoa(svg));
73
- }
74
-
75
- export { adjustItemPositions, clusterOptions, findCloseItems, getDistinctItemsByProximity };
76
- //# sourceMappingURL=mapUtil.js.map
1
+ import { objectSpread2 as _objectSpread2, defineProperty as _defineProperty } from '../_virtual/_rollupPluginBabelHelpers.js';
2
+
3
+ var getDistinctItemsByProximity = function getDistinctItemsByProximity(items, listingEntitiesDetails) {
4
+ var clusters = {};
5
+ if (!listingEntitiesDetails) return [];
6
+ var closeItemPairs = findCloseItems(listingEntitiesDetails);
7
+ if (closeItemPairs.length > 0) {
8
+ listingEntitiesDetails = adjustItemPositions(listingEntitiesDetails, closeItemPairs);
9
+ }
10
+ items === null || items === void 0 || items.forEach(function (item) {
11
+ if (item.entityId !== -1) {
12
+ var entityDetails = listingEntitiesDetails[item.entityId];
13
+ if (!entityDetails) {
14
+ console.error("Details not found for entityId: ".concat(item.entityId));
15
+ return;
16
+ }
17
+ item.mapDetails = entityDetails;
18
+ if (!clusters[item.entityId]) {
19
+ clusters[item.entityId] = _objectSpread2(_objectSpread2({}, item.mapDetails), {}, {
20
+ items: _defineProperty({}, item.id, item)
21
+ });
22
+ } else {
23
+ clusters[item.entityId].items[item.id] = item;
24
+ }
25
+ }
26
+ });
27
+ return Object.values(clusters);
28
+ };
29
+ var findCloseItems = function findCloseItems(itemsObj) {
30
+ var closeItems = [];
31
+ var items = Object.values(itemsObj); // Convert object to array for iteration
32
+ var proximityThreshold = 0.0001;
33
+ for (var i = 0; i < items.length; i++) {
34
+ for (var j = i + 1; j < items.length; j++) {
35
+ var distanceLat = Math.abs(items[i].latitude - items[j].latitude);
36
+ var distanceLng = Math.abs(items[i].longitude - items[j].longitude);
37
+ if (distanceLat < proximityThreshold && distanceLng < proximityThreshold) {
38
+ closeItems.push({
39
+ item1: items[i],
40
+ item2: items[j]
41
+ });
42
+ }
43
+ }
44
+ }
45
+ return closeItems;
46
+ };
47
+ var adjustItemPositions = function adjustItemPositions(itemsObj, closeItemPairs) {
48
+ var adjustmentValue = 0.0001;
49
+ var adjustedItems = _objectSpread2({}, itemsObj); // Create a shallow copy of the object
50
+
51
+ closeItemPairs.forEach(function (pair) {
52
+ if (adjustedItems[pair.item1.id] && adjustedItems[pair.item2.id]) {
53
+ adjustedItems[pair.item2.id].latitude += adjustmentValue;
54
+ adjustedItems[pair.item2.id].longitude += adjustmentValue;
55
+ }
56
+ });
57
+ return adjustedItems;
58
+ };
59
+ var clusterOptions = function clusterOptions(clusterGridSize, fillColor) {
60
+ return {
61
+ gridSize: clusterGridSize,
62
+ styles: [{
63
+ url: createSvgDataUri(fillColor),
64
+ textColor: 'white',
65
+ height: 40,
66
+ width: 40
67
+ }]
68
+ };
69
+ };
70
+ function createSvgDataUri(fillColor) {
71
+ var svg = "<svg width=\"50\" height=\"50\" xmlns=\"http://www.w3.org/2000/svg\">\n\t <circle cx=\"25\" cy=\"25\" r=\"20\" fill=\"".concat(fillColor, "\" />\n\t</svg>");
72
+ return "data:image/svg+xml;base64,".concat(btoa(svg));
73
+ }
74
+
75
+ export { adjustItemPositions, clusterOptions, findCloseItems, getDistinctItemsByProximity };
76
+ //# sourceMappingURL=mapUtil.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mapUtil.js","sources":["../../src/util/mapUtil.js"],"sourcesContent":["export const getDistinctItemsByProximity = (items, listingEntitiesDetails) => {\n\tconst clusters = {};\n\n\tif (!listingEntitiesDetails) return [];\n\n\tconst closeItemPairs = findCloseItems(listingEntitiesDetails);\n\tif (closeItemPairs.length > 0) {\n\t\tlistingEntitiesDetails = adjustItemPositions(\n\t\t\tlistingEntitiesDetails,\n\t\t\tcloseItemPairs,\n\t\t);\n\t}\n\n\titems?.forEach(item => {\n\t\tif(item.entityId !== -1){\n\n\t\t\tconst entityDetails = listingEntitiesDetails[item.entityId];\n\n\t\t\tif (!entityDetails) {\n\t\t\t\tconsole.error(`Details not found for entityId: ${item.entityId}`);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\titem.mapDetails = entityDetails;\n\n\t\t\tif (!clusters[item.entityId]) {\n\t\t\t\tclusters[item.entityId] = {\n\t\t\t\t\t...item.mapDetails,\n\t\t\t\t\titems: { [item.id]: item }\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tclusters[item.entityId].items[item.id] = item;\n\t\t\t}}\n\t});\n\n\treturn Object.values(clusters);\n};\n\nexport const findCloseItems = itemsObj => {\n\tconst closeItems = [];\n\tconst items = Object.values(itemsObj); // Convert object to array for iteration\n\tconst proximityThreshold = 0.0001;\n\n\tfor (let i = 0; i < items.length; i++) {\n\t\tfor (let j = i + 1; j < items.length; j++) {\n\t\t\tconst distanceLat = Math.abs(items[i].latitude - items[j].latitude);\n\t\t\tconst distanceLng = Math.abs(items[i].longitude - items[j].longitude);\n\t\t\tif (\n\t\t\t\tdistanceLat < proximityThreshold &&\n\t\t\t\tdistanceLng < proximityThreshold\n\t\t\t) {\n\t\t\t\tcloseItems.push({ item1: items[i], item2: items[j] });\n\t\t\t}\n\t\t}\n\t}\n\n\treturn closeItems;\n};\n\nexport const adjustItemPositions = (itemsObj, closeItemPairs) => {\n\tconst adjustmentValue = 0.0001;\n\tconst adjustedItems = { ...itemsObj }; // Create a shallow copy of the object\n\n\tcloseItemPairs.forEach(pair => {\n\t\tif (adjustedItems[pair.item1.id] && adjustedItems[pair.item2.id]) {\n\t\t\tadjustedItems[pair.item2.id].latitude += adjustmentValue;\n\t\t\tadjustedItems[pair.item2.id].longitude += adjustmentValue;\n\t\t}\n\t});\n\n\treturn adjustedItems;\n};\n\nexport const clusterOptions = (clusterGridSize, fillColor) => {\n\treturn {\n\t\tgridSize: clusterGridSize,\n\t\tstyles:[{\n\t\t\turl: createSvgDataUri(fillColor),\n\t\t\ttextColor:'white',\n\t\t\theight: 40,\n\t\t\twidth: 40\n\t\t}]\n\t};\n};\n\nfunction createSvgDataUri(fillColor) {\n\tconst svg = `<svg width=\"50\" height=\"50\" xmlns=\"http://www.w3.org/2000/svg\">\n\t <circle cx=\"25\" cy=\"25\" r=\"20\" fill=\"${fillColor}\" />\n\t</svg>`;\n\treturn `data:image/svg+xml;base64,${btoa(svg)}`;\n}\n"],"names":["getDistinctItemsByProximity","items","listingEntitiesDetails","clusters","closeItemPairs","findCloseItems","length","adjustItemPositions","forEach","item","entityId","entityDetails","console","error","concat","mapDetails","_objectSpread","_defineProperty","id","Object","values","itemsObj","closeItems","proximityThreshold","i","j","distanceLat","Math","abs","latitude","distanceLng","longitude","push","item1","item2","adjustmentValue","adjustedItems","pair","clusterOptions","clusterGridSize","fillColor","gridSize","styles","url","createSvgDataUri","textColor","height","width","svg","btoa"],"mappings":";;AAAO,IAAMA,2BAA2B,GAAG,SAA9BA,2BAA2BA,CAAIC,KAAK,EAAEC,sBAAsB,EAAK;EAC7E,IAAMC,QAAQ,GAAG,EAAE,CAAA;AAEnB,EAAA,IAAI,CAACD,sBAAsB,EAAE,OAAO,EAAE,CAAA;AAEtC,EAAA,IAAME,cAAc,GAAGC,cAAc,CAACH,sBAAsB,CAAC,CAAA;AAC7D,EAAA,IAAIE,cAAc,CAACE,MAAM,GAAG,CAAC,EAAE;AAC9BJ,IAAAA,sBAAsB,GAAGK,mBAAmB,CAC3CL,sBAAsB,EACtBE,cACD,CAAC,CAAA;AACF,GAAA;EAEAH,KAAK,KAAA,IAAA,IAALA,KAAK,KAALA,KAAAA,CAAAA,IAAAA,KAAK,CAAEO,OAAO,CAAC,UAAAC,IAAI,EAAI;AACtB,IAAA,IAAGA,IAAI,CAACC,QAAQ,KAAK,CAAC,CAAC,EAAC;AAEvB,MAAA,IAAMC,aAAa,GAAGT,sBAAsB,CAACO,IAAI,CAACC,QAAQ,CAAC,CAAA;MAE3D,IAAI,CAACC,aAAa,EAAE;QACnBC,OAAO,CAACC,KAAK,CAAAC,kCAAAA,CAAAA,MAAA,CAAoCL,IAAI,CAACC,QAAQ,CAAE,CAAC,CAAA;AACjE,QAAA,OAAA;AACD,OAAA;MAEAD,IAAI,CAACM,UAAU,GAAGJ,aAAa,CAAA;A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SAAS,CAAC;AAChCK,MAAAA,SAAS,EAAC,OAAO;AACjBC,MAAAA,MAAM,EAAE,EAAE;AACVC,MAAAA,KAAK,EAAE,EAAA;KACP,CAAA;GACD,CAAA;AACF,EAAC;AAED,SAASH,gBAAgBA,CAACJ,SAAS,EAAE;AACpC,EAAA,IAAMQ,GAAG,GAAA,yHAAA,CAAAlC,MAAA,CACgC0B,SAAS,EAC3C,iBAAA,CAAA,CAAA;AACP,EAAA,OAAA,4BAAA,CAAA1B,MAAA,CAAoCmC,IAAI,CAACD,GAAG,CAAC,CAAA,CAAA;AAC9C;;;;"}
1
+ {"version":3,"file":"mapUtil.js","sources":["../../src/util/mapUtil.js"],"sourcesContent":["export const getDistinctItemsByProximity = (items, listingEntitiesDetails) => {\r\n\tconst clusters = {};\r\n\r\n\tif (!listingEntitiesDetails) return [];\r\n\r\n\tconst closeItemPairs = findCloseItems(listingEntitiesDetails);\r\n\tif (closeItemPairs.length > 0) {\r\n\t\tlistingEntitiesDetails = adjustItemPositions(\r\n\t\t\tlistingEntitiesDetails,\r\n\t\t\tcloseItemPairs\r\n\t\t);\r\n\t}\r\n\r\n\titems?.forEach(item => {\r\n\t\tif(item.entityId !== -1){\r\n\r\n\t\t\tconst entityDetails = listingEntitiesDetails[item.entityId];\r\n\r\n\t\t\tif (!entityDetails) {\r\n\t\t\t\tconsole.error(`Details not found for entityId: ${item.entityId}`);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\titem.mapDetails = entityDetails;\r\n\r\n\t\t\tif (!clusters[item.entityId]) {\r\n\t\t\t\tclusters[item.entityId] = {\r\n\t\t\t\t\t...item.mapDetails,\r\n\t\t\t\t\titems: { [item.id]: item }\r\n\t\t\t\t};\r\n\t\t\t} else {\r\n\t\t\t\tclusters[item.entityId].items[item.id] = item;\r\n\t\t\t}}\r\n\t});\r\n\r\n\treturn Object.values(clusters);\r\n};\r\n\r\nexport const findCloseItems = itemsObj => {\r\n\tconst closeItems = [];\r\n\tconst items = Object.values(itemsObj); // Convert object to array for iteration\r\n\tconst proximityThreshold = 0.0001;\r\n\r\n\tfor (let i = 0; i < items.length; i++) {\r\n\t\tfor (let j = i + 1; j < items.length; j++) {\r\n\t\t\tconst distanceLat = Math.abs(items[i].latitude - items[j].latitude);\r\n\t\t\tconst distanceLng = Math.abs(items[i].longitude - items[j].longitude);\r\n\t\t\tif (\r\n\t\t\t\tdistanceLat < proximityThreshold &&\r\n\t\t\t\tdistanceLng < proximityThreshold\r\n\t\t\t) {\r\n\t\t\t\tcloseItems.push({ item1: items[i], item2: items[j] });\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn closeItems;\r\n};\r\n\r\nexport const adjustItemPositions = (itemsObj, closeItemPairs) => {\r\n\tconst adjustmentValue = 0.0001;\r\n\tconst adjustedItems = { ...itemsObj }; // Create a shallow copy of the object\r\n\r\n\tcloseItemPairs.forEach(pair => {\r\n\t\tif (adjustedItems[pair.item1.id] && adjustedItems[pair.item2.id]) {\r\n\t\t\tadjustedItems[pair.item2.id].latitude += adjustmentValue;\r\n\t\t\tadjustedItems[pair.item2.id].longitude += adjustmentValue;\r\n\t\t}\r\n\t});\r\n\r\n\treturn adjustedItems;\r\n};\r\n\r\nexport const clusterOptions = (clusterGridSize, fillColor) => {\r\n\treturn {\r\n\t\tgridSize: clusterGridSize,\r\n\t\tstyles:[{\r\n\t\t\turl: createSvgDataUri(fillColor),\r\n\t\t\ttextColor:'white',\r\n\t\t\theight: 40,\r\n\t\t\twidth: 40\r\n\t\t}]\r\n\t};\r\n};\r\n\r\nfunction createSvgDataUri(fillColor) {\r\n\tconst svg = `<svg width=\"50\" height=\"50\" xmlns=\"http://www.w3.org/2000/svg\">\r\n\t <circle cx=\"25\" cy=\"25\" r=\"20\" fill=\"${fillColor}\" />\r\n\t</svg>`;\r\n\treturn `data:image/svg+xml;base64,${btoa(svg)}`;\r\n}\r\n"],"names":["getDistinctItemsByProximity","items","listingEntitiesDetails","clusters","closeItemPairs","findCloseItems","length","adjustItemPositions","forEach","item","entityId","entityDetails","console","error","concat","mapDetails","_objectSpread","_defineProperty","id","Object","values","itemsObj","closeItems","proximityThreshold","i","j","distanceLat","Math","abs","latitude","distanceLng","longitude","push","item1","item2","adjustmentValue","adjustedItems","pair","clusterOptions","clusterGridSize","fillColor","gridSize","styles","url","createSvgDataUri","textColor","height","width","svg","btoa"],"mappings":";;AAAO,IAAMA,2BAA2B,GAAG,SAA9BA,2BAA2BA,CAAIC,KAAK,EAAEC,sBAAsB,EAAK;EAC7E,IAAMC,QAAQ,GAAG,EAAE,CAAA;AAEnB,EAAA,IAAI,CAACD,sBAAsB,EAAE,OAAO,EAAE,CAAA;AAEtC,EAAA,IAAME,cAAc,GAAGC,cAAc,CAACH,sBAAsB,CAAC,CAAA;AAC7D,EAAA,IAAIE,cAAc,CAACE,MAAM,GAAG,CAAC,EAAE;AAC9BJ,IAAAA,sBAAsB,GAAGK,mBAAmB,CAC3CL,sBAAsB,EACtBE,cACD,CAAC,CAAA;AACF,GAAA;EAEAH,KAAK,KAAA,IAAA,IAALA,KAAK,KAALA,KAAAA,CAAAA,IAAAA,KAAK,CAAEO,OAAO,CAAC,UAAAC,IAAI,EAAI;AACtB,IAAA,IAAGA,IAAI,CAACC,QAAQ,KAAK,CAAC,CAAC,EAAC;AAEvB,MAAA,IAAMC,aAAa,GAAGT,sBAAsB,CAACO,IAAI,CAACC,QAAQ,CAAC,CAAA;MAE3D,IAAI,CAACC,aAAa,EAAE;QACnBC,OAAO,CAACC,KAAK,CAAAC,kCAAAA,CAAAA,MAAA,CAAoCL,IAAI,CAACC,QAAQ,CAAE,CAAC,CAAA;AACjE,QAAA,OAAA;AACD,OAAA;MAEAD,IAAI,CAACM,UAAU,GAAGJ,aAAa,CAAA;AAE/B,MAAA,IAAI,CAACR,QAAQ,CAACM,IAAI,CAACC,QAAQ,CAAC,EAAE;AAC7BP,QAAAA,QAAQ,CAACM,IAAI,CAACC,QAAQ,CAAC,GAAAM,cAAA,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AAC;AAED,SAASH,gBAAgBA,CAACJ,SAAS,EAAE;AACpC,EAAA,IAAMQ,GAAG,GAAA,yHAAA,CAAAlC,MAAA,CACgC0B,SAAS,EAC3C,iBAAA,CAAA,CAAA;AACP,EAAA,OAAA,4BAAA,CAAA1B,MAAA,CAAoCmC,IAAI,CAACD,GAAG,CAAC,CAAA,CAAA;AAC9C;;;;"}
@@ -1,33 +1,33 @@
1
- var dynamicSort = function dynamicSort(items, fieldName) {
2
- var order = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "asc";
3
- if (!items || !items.length) {
4
- return [];
5
- }
6
- var inferType = function inferType(value) {
7
- if (!isNaN(Date.parse(value)) && isNaN(value)) {
8
- return "date";
9
- } else if (!isNaN(parseFloat(value)) && isFinite(value)) {
10
- return "number";
11
- } else {
12
- return "string";
13
- }
14
- };
15
- var dataType = inferType(items[0].fields[fieldName]);
16
- return items.sort(function (a, b) {
17
- var valA = a.fields[fieldName];
18
- var valB = b.fields[fieldName];
19
- if (!valA || !valB) return;
20
- var comparison = 0;
21
- if (dataType === "string") {
22
- comparison = valA.localeCompare(valB);
23
- } else if (dataType === "number") {
24
- comparison = valA - valB;
25
- } else if (dataType === "date") {
26
- comparison = new Date(valA) - new Date(valB);
27
- }
28
- return order === "desc" ? comparison * -1 : comparison;
29
- });
30
- };
31
-
32
- export { dynamicSort };
33
- //# sourceMappingURL=sortUtil.js.map
1
+ var dynamicSort = function dynamicSort(items, fieldName) {
2
+ var order = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "asc";
3
+ if (!items || !items.length) {
4
+ return [];
5
+ }
6
+ var inferType = function inferType(value) {
7
+ if (!isNaN(Date.parse(value)) && isNaN(value)) {
8
+ return "date";
9
+ } else if (!isNaN(parseFloat(value)) && isFinite(value)) {
10
+ return "number";
11
+ } else {
12
+ return "string";
13
+ }
14
+ };
15
+ var dataType = inferType(items[0].fields[fieldName]);
16
+ return items.sort(function (a, b) {
17
+ var valA = a.fields[fieldName];
18
+ var valB = b.fields[fieldName];
19
+ if (!valA || !valB) return;
20
+ var comparison = 0;
21
+ if (dataType === "string") {
22
+ comparison = valA.localeCompare(valB);
23
+ } else if (dataType === "number") {
24
+ comparison = valA - valB;
25
+ } else if (dataType === "date") {
26
+ comparison = new Date(valA) - new Date(valB);
27
+ }
28
+ return order === "desc" ? comparison * -1 : comparison;
29
+ });
30
+ };
31
+
32
+ export { dynamicSort };
33
+ //# sourceMappingURL=sortUtil.js.map