@abcagency/hc-ui-components 1.3.61 → 1.3.63

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 (279) hide show
  1. package/dist/apis/hcApi.js +85 -85
  2. package/dist/apis/hcApi.js.map +1 -1
  3. package/dist/clientToken.js.map +1 -1
  4. package/dist/components/HireControlMap.js +14 -4
  5. package/dist/components/HireControlMap.js.map +1 -1
  6. package/dist/components/containers/accordions/filter-container.js +10 -3
  7. package/dist/components/containers/accordions/filter-container.js.map +1 -1
  8. package/dist/components/containers/accordions/filter-item-container.js.map +1 -1
  9. package/dist/components/containers/accordions/map-accordion-item-container.js.map +1 -1
  10. package/dist/components/containers/filter/commute-container.js +1 -1
  11. package/dist/components/containers/filter/commute-container.js.map +1 -1
  12. package/dist/components/containers/filter/filter-container.js.map +1 -1
  13. package/dist/components/containers/filter/filter-item-container.js.map +1 -1
  14. package/dist/components/containers/filter/location-container.js.map +1 -1
  15. package/dist/components/containers/filter/points-of-interest-container.js.map +1 -1
  16. package/dist/components/containers/filter/points-of-interest-radio-item-container.js.map +1 -1
  17. package/dist/components/containers/filter/search-container.js.map +1 -1
  18. package/dist/components/containers/jobListing/listing-details-container.js.map +1 -1
  19. package/dist/components/containers/list/item-list-container.js +21 -21
  20. package/dist/components/containers/list/item-list-container.js.map +1 -1
  21. package/dist/components/containers/list/list-item/list-item-container.js.map +1 -1
  22. package/dist/components/containers/maps/info-window-content-container.js.map +1 -1
  23. package/dist/components/containers/maps/map-container.js +1 -1
  24. package/dist/components/containers/maps/map-container.js.map +1 -1
  25. package/dist/components/containers/maps/map-list-container.js.map +1 -1
  26. package/dist/components/containers/maps/map-marker-container.js +1 -1
  27. package/dist/components/containers/maps/map-marker-container.js.map +1 -1
  28. package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -1
  29. package/dist/components/modules/accordions/default.js +2 -2
  30. package/dist/components/modules/accordions/default.js.map +1 -1
  31. package/dist/components/modules/accordions/filterItem.js.map +1 -1
  32. package/dist/components/modules/accordions/filters.js.map +1 -1
  33. package/dist/components/modules/buttons/button-group-apply.js +1 -1
  34. package/dist/components/modules/buttons/button-group-apply.js.map +1 -1
  35. package/dist/components/modules/buttons/commute-pill.js.map +1 -1
  36. package/dist/components/modules/buttons/default.js +2 -2
  37. package/dist/components/modules/buttons/default.js.map +1 -1
  38. package/dist/components/modules/buttons/items-pill.js +5 -8
  39. package/dist/components/modules/buttons/items-pill.js.map +1 -1
  40. package/dist/components/modules/buttons/pill-wrapper.js.map +1 -1
  41. package/dist/components/modules/buttons/show-all-button.js.map +1 -1
  42. package/dist/components/modules/cards/default.js +2 -2
  43. package/dist/components/modules/cards/default.js.map +1 -1
  44. package/dist/components/modules/cards/filter.js.map +1 -1
  45. package/dist/components/modules/dialogs/apply-dialog.js +1 -1
  46. package/dist/components/modules/dialogs/apply-dialog.js.map +1 -1
  47. package/dist/components/modules/filter/commute.js +2 -2
  48. package/dist/components/modules/filter/commute.js.map +1 -1
  49. package/dist/components/modules/filter/index.js +1 -1
  50. package/dist/components/modules/filter/index.js.map +1 -1
  51. package/dist/components/modules/filter/item.js.map +1 -1
  52. package/dist/components/modules/filter/location.js.map +1 -1
  53. package/dist/components/modules/filter/radio-item.js.map +1 -1
  54. package/dist/components/modules/filter/search.js.map +1 -1
  55. package/dist/components/modules/filter/sort.js +2 -2
  56. package/dist/components/modules/filter/sort.js.map +1 -1
  57. package/dist/components/modules/grid.js +1 -1
  58. package/dist/components/modules/grid.js.map +1 -1
  59. package/dist/components/modules/icon.js +1 -1
  60. package/dist/components/modules/icon.js.map +1 -1
  61. package/dist/components/modules/jobListing/listing-details.js +1 -1
  62. package/dist/components/modules/jobListing/listing-details.js.map +1 -1
  63. package/dist/components/modules/list/field-mapper.js.map +1 -1
  64. package/dist/components/modules/list/header-item.js.map +1 -1
  65. package/dist/components/modules/list/header.js +1 -1
  66. package/dist/components/modules/list/header.js.map +1 -1
  67. package/dist/components/modules/list/item-expand-card/index.js +1 -1
  68. package/dist/components/modules/list/item-expand-card/index.js.map +1 -1
  69. package/dist/components/modules/list/item-expand-card/recruiter-contact-nav.js +38 -38
  70. package/dist/components/modules/list/item-expand-card/recruiter-details.js +40 -40
  71. package/dist/components/modules/list/item-expand-card/recruiter-headshot.js +20 -20
  72. package/dist/components/modules/list/item-list.js +43 -43
  73. package/dist/components/modules/list/item-list.js.map +1 -1
  74. package/dist/components/modules/list/list-item/list-item.js.map +1 -1
  75. package/dist/components/modules/maps/info-window-card.js.map +1 -1
  76. package/dist/components/modules/maps/info-window-content.js.map +1 -1
  77. package/dist/components/modules/maps/map-list.js.map +1 -1
  78. package/dist/components/modules/maps/map-marker.js +1 -1
  79. package/dist/components/modules/maps/map-marker.js.map +1 -1
  80. package/dist/components/modules/maps/map.js +1 -1
  81. package/dist/components/modules/maps/map.js.map +1 -1
  82. package/dist/components/modules/maps/place-marker.js +1 -1
  83. package/dist/components/modules/maps/place-marker.js.map +1 -1
  84. package/dist/components/modules/maps/tabs.js +1 -1
  85. package/dist/components/modules/maps/tabs.js.map +1 -1
  86. package/dist/constants/eventTypes.js.map +1 -1
  87. package/dist/constants/placeTypes.js.map +1 -1
  88. package/dist/contexts/mapContext.js +83 -83
  89. package/dist/contexts/mapContext.js.map +1 -1
  90. package/dist/contexts/mapListContext.js +211 -192
  91. package/dist/contexts/mapListContext.js.map +1 -1
  92. package/dist/contexts/placesContext.js.map +1 -1
  93. package/dist/contexts/themeContext.js.map +1 -1
  94. package/dist/contexts/trackEventContext.js.map +1 -1
  95. package/dist/hooks/useList.js.map +1 -1
  96. package/dist/services/configService.js +9 -9
  97. package/dist/services/configService.js.map +1 -1
  98. package/dist/services/googlePlacesNearbyService.js +32 -32
  99. package/dist/services/googlePlacesNearbyService.js.map +1 -1
  100. package/dist/services/listingAggregatorService.js +34 -34
  101. package/dist/services/listingAggregatorService.js.map +1 -1
  102. package/dist/services/listingEntityService.js +9 -9
  103. package/dist/services/listingEntityService.js.map +1 -1
  104. package/dist/services/listingService.js +24 -24
  105. package/dist/services/listingService.js.map +1 -1
  106. package/dist/services/recruiterService.js +10 -10
  107. package/dist/services/recruiterService.js.map +1 -1
  108. package/dist/styles/index.css +1 -1
  109. package/dist/types/apis/hcApi.d.ts +5 -5
  110. package/dist/types/clientToken.d.ts +2 -2
  111. package/dist/types/components/containers/accordions/map-accordion-item-container.d.ts +12 -12
  112. package/dist/types/components/containers/jobListing/listing-details-container.d.ts +6 -6
  113. package/dist/types/components/containers/list/item-list-container.d.ts +9 -9
  114. package/dist/types/components/containers/list/list-item/list-item-container.d.ts +14 -14
  115. package/dist/types/components/modules/accordions/MapAccordionItem.d.ts +10 -10
  116. package/dist/types/components/modules/accordions/default.d.ts +19 -19
  117. package/dist/types/components/modules/buttons/button-group-apply.d.ts +24 -24
  118. package/dist/types/components/modules/buttons/commute-pill.d.ts +5 -5
  119. package/dist/types/components/modules/buttons/default.d.ts +48 -48
  120. package/dist/types/components/modules/buttons/pill-wrapper.d.ts +3 -3
  121. package/dist/types/components/modules/dialogs/apply-dialog.d.ts +8 -8
  122. package/dist/types/components/modules/filter/sort.d.ts +8 -8
  123. package/dist/types/components/modules/grid.d.ts +8 -8
  124. package/dist/types/components/modules/icon.d.ts +10 -10
  125. package/dist/types/components/modules/jobListing/listing-details.d.ts +20 -20
  126. package/dist/types/components/modules/list/field-mapper.d.ts +10 -10
  127. package/dist/types/components/modules/list/header-item.d.ts +11 -11
  128. package/dist/types/components/modules/list/header.d.ts +12 -12
  129. package/dist/types/components/modules/list/item-expand-card/index.d.ts +7 -7
  130. package/dist/types/components/modules/list/item-expand-card/recruiter-contact-nav.d.ts +17 -17
  131. package/dist/types/components/modules/list/item-expand-card/recruiter-details.d.ts +21 -21
  132. package/dist/types/components/modules/list/item-expand-card/recruiter-headshot.d.ts +8 -8
  133. package/dist/types/components/modules/list/item-list.d.ts +20 -20
  134. package/dist/types/components/modules/list/list-item/list-item.d.ts +3 -3
  135. package/dist/types/constants/eventTypes.d.ts +15 -15
  136. package/dist/types/contexts/mapContext.d.ts +29 -29
  137. package/dist/types/contexts/mapListContext.d.ts +69 -65
  138. package/dist/types/contexts/trackEventContext.d.ts +6 -6
  139. package/dist/types/enums/SectionType.d.ts +9 -9
  140. package/dist/types/hooks/useList.d.ts +13 -13
  141. package/dist/types/services/configService.d.ts +6 -6
  142. package/dist/types/services/googlePlacesNearbyService.d.ts +5 -5
  143. package/dist/types/services/listingAggregatorService.d.ts +12 -12
  144. package/dist/types/services/listingEntityService.d.ts +6 -6
  145. package/dist/types/services/listingService.d.ts +9 -9
  146. package/dist/types/services/recruiterService.d.ts +6 -6
  147. package/dist/types/types/Address.d.ts +7 -7
  148. package/dist/types/types/ContentSection.d.ts +8 -8
  149. package/dist/types/types/GetListingParams.d.ts +8 -8
  150. package/dist/types/types/LatLng.d.ts +4 -4
  151. package/dist/types/types/ListingEntity.d.ts +10 -10
  152. package/dist/types/types/ListingFields.d.ts +25 -25
  153. package/dist/types/types/Listings.d.ts +31 -31
  154. package/dist/types/types/Recruiter.d.ts +9 -9
  155. package/dist/types/types/SimilarListing.d.ts +24 -24
  156. package/dist/types/types/config/Colors.d.ts +8 -8
  157. package/dist/types/types/config/MapConfig.d.ts +30 -30
  158. package/dist/types/types/config/PointsOfInterestConfig.d.ts +13 -13
  159. package/dist/types/types/config/SearchConfig.d.ts +4 -4
  160. package/dist/types/util/filterUtil.d.ts +28 -28
  161. package/dist/types/util/loading.d.ts +3 -3
  162. package/dist/types/util/localStorageUtil.d.ts +3 -3
  163. package/dist/types/util/mapUtil.d.ts +16 -16
  164. package/dist/types/util/sortUtil.d.ts +1 -1
  165. package/dist/types/util/stringUtils.d.ts +1 -1
  166. package/dist/types/util/urlFilterUtil.d.ts +8 -8
  167. package/dist/util/filterUtil.js +1 -1
  168. package/dist/util/filterUtil.js.map +1 -1
  169. package/dist/util/loading.js.map +1 -1
  170. package/dist/util/localStorageUtil.js +37 -37
  171. package/dist/util/localStorageUtil.js.map +1 -1
  172. package/dist/util/mapIconUtil.js.map +1 -1
  173. package/dist/util/mapUtil.js.map +1 -1
  174. package/dist/util/sortUtil.js.map +1 -1
  175. package/dist/util/stringUtils.js.map +1 -1
  176. package/dist/util/urlFilterUtil.js.map +1 -1
  177. package/package.json +90 -90
  178. package/src/.editorconfig +12 -12
  179. package/src/apis/hcApi.ts +109 -109
  180. package/src/bundleIndex.js +14 -14
  181. package/src/clientToken.js +9 -9
  182. package/src/components/HireControlMap.js +153 -148
  183. package/src/components/containers/accordions/filter-container.js +52 -48
  184. package/src/components/containers/accordions/filter-item-container.js +83 -83
  185. package/src/components/containers/accordions/map-accordion-item-container.js +70 -70
  186. package/src/components/containers/filter/commute-container.js +89 -89
  187. package/src/components/containers/filter/filter-container.js +76 -76
  188. package/src/components/containers/filter/filter-item-container.js +117 -117
  189. package/src/components/containers/filter/location-container.js +45 -45
  190. package/src/components/containers/filter/points-of-interest-container.js +33 -33
  191. package/src/components/containers/filter/points-of-interest-radio-item-container.js +35 -35
  192. package/src/components/containers/filter/search-container.js +61 -61
  193. package/src/components/containers/jobListing/listing-details-container.js +42 -42
  194. package/src/components/containers/list/item-list-container.tsx +81 -81
  195. package/src/components/containers/list/list-item/list-item-container.js +43 -43
  196. package/src/components/containers/maps/info-window-content-container.js +53 -53
  197. package/src/components/containers/maps/map-container.js +249 -249
  198. package/src/components/containers/maps/map-list-container.js +50 -50
  199. package/src/components/containers/maps/map-marker-container.js +78 -78
  200. package/src/components/modules/accordions/MapAccordionItem.js +30 -30
  201. package/src/components/modules/accordions/default.js +171 -171
  202. package/src/components/modules/accordions/filterItem.js +27 -27
  203. package/src/components/modules/accordions/filters.js +32 -32
  204. package/src/components/modules/buttons/button-group-apply.js +115 -115
  205. package/src/components/modules/buttons/commute-pill.js +22 -22
  206. package/src/components/modules/buttons/default.js +194 -194
  207. package/src/components/modules/buttons/items-pill.js +31 -35
  208. package/src/components/modules/buttons/pill-wrapper.js +27 -27
  209. package/src/components/modules/buttons/show-all-button.js +19 -19
  210. package/src/components/modules/cards/default.js +167 -167
  211. package/src/components/modules/cards/filter.js +56 -56
  212. package/src/components/modules/dialogs/apply-dialog.js +48 -48
  213. package/src/components/modules/filter/commute.js +108 -108
  214. package/src/components/modules/filter/index.js +55 -55
  215. package/src/components/modules/filter/item.js +69 -69
  216. package/src/components/modules/filter/location.js +51 -51
  217. package/src/components/modules/filter/radio-item.js +42 -42
  218. package/src/components/modules/filter/search.js +79 -79
  219. package/src/components/modules/filter/sort.js +83 -83
  220. package/src/components/modules/grid.js +54 -54
  221. package/src/components/modules/icon.js +33 -33
  222. package/src/components/modules/jobListing/listing-details.js +110 -110
  223. package/src/components/modules/list/field-mapper.js +130 -130
  224. package/src/components/modules/list/header-item.js +92 -92
  225. package/src/components/modules/list/header.js +51 -51
  226. package/src/components/modules/list/item-expand-card/index.js +22 -22
  227. package/src/components/modules/list/item-expand-card/recruiter-contact-nav.js +50 -50
  228. package/src/components/modules/list/item-expand-card/recruiter-details.js +68 -68
  229. package/src/components/modules/list/item-expand-card/recruiter-headshot.js +22 -22
  230. package/src/components/modules/list/item-list.tsx +117 -117
  231. package/src/components/modules/list/list-item/list-item.js +130 -130
  232. package/src/components/modules/maps/info-window-card.js +17 -17
  233. package/src/components/modules/maps/info-window-content.js +64 -64
  234. package/src/components/modules/maps/map-list.js +38 -38
  235. package/src/components/modules/maps/map-marker.js +29 -29
  236. package/src/components/modules/maps/map.js +64 -64
  237. package/src/components/modules/maps/place-marker.js +41 -41
  238. package/src/components/modules/maps/tabs.js +81 -81
  239. package/src/constants/eventTypes.js +15 -15
  240. package/src/constants/placeTypes.js +8 -8
  241. package/src/contexts/mapContext.tsx +129 -129
  242. package/src/contexts/mapListContext.tsx +351 -326
  243. package/src/contexts/placesContext.js +102 -102
  244. package/src/contexts/themeContext.js +40 -40
  245. package/src/contexts/trackEventContext.js +14 -14
  246. package/src/enums/SectionType.ts +9 -9
  247. package/src/hooks/useList.js +89 -89
  248. package/src/index.js +3 -3
  249. package/src/services/configService.ts +16 -16
  250. package/src/services/googlePlacesNearbyService.ts +42 -42
  251. package/src/services/listingAggregatorService.ts +76 -76
  252. package/src/services/listingEntityService.ts +16 -16
  253. package/src/services/listingService.ts +40 -40
  254. package/src/services/recruiterService.ts +18 -18
  255. package/src/styles/bundle.css +268 -268
  256. package/src/styles/index.css +33 -33
  257. package/src/types/Address.ts +7 -7
  258. package/src/types/ContentSection.ts +9 -9
  259. package/src/types/GetListingParams.ts +8 -8
  260. package/src/types/LatLng.ts +4 -4
  261. package/src/types/ListingEntity.ts +11 -11
  262. package/src/types/ListingFields.ts +25 -25
  263. package/src/types/Listings.ts +32 -32
  264. package/src/types/Recruiter.ts +9 -9
  265. package/src/types/SimilarListing.ts +24 -24
  266. package/src/types/config/Colors.ts +8 -8
  267. package/src/types/config/MapConfig.ts +31 -31
  268. package/src/types/config/PointsOfInterestConfig.ts +13 -13
  269. package/src/types/config/SearchConfig.ts +4 -4
  270. package/src/util/arrayUtil.js +3 -3
  271. package/src/util/fieldMapper.js +22 -22
  272. package/src/util/filterUtil.js +311 -311
  273. package/src/util/loading.js +17 -17
  274. package/src/util/localStorageUtil.ts +34 -34
  275. package/src/util/mapIconUtil.js +180 -180
  276. package/src/util/mapUtil.js +92 -92
  277. package/src/util/sortUtil.js +32 -32
  278. package/src/util/stringUtils.js +6 -6
  279. package/src/util/urlFilterUtil.js +85 -85
@@ -1,34 +1,34 @@
1
- export const getStorageObject = <T>(item: string, defaultItem: T | null = null): T | null => {
2
- if (typeof window === 'undefined') return defaultItem;
3
- const storageItem = localStorage.getItem(item);
4
- if (storageItem === null || storageItem === 'undefined') {
5
- localStorage.removeItem(item);
6
- return defaultItem;
7
- }
8
- try {
9
- return JSON.parse(storageItem) ?? defaultItem;
10
- } catch (error) {
11
- console.error(`Error parsing JSON for ${item}:`, error);
12
- return defaultItem;
13
- }
14
- };
15
-
16
- export const getStorageItem = (item: string, defaultItem: string | null = null): string | null => {
17
- if (typeof window === 'undefined') return defaultItem;
18
- const storageItem = localStorage.getItem(item);
19
- if (storageItem === null || storageItem === 'undefined') {
20
- localStorage.removeItem(item);
21
- return defaultItem;
22
- }
23
- return storageItem ?? defaultItem;
24
- };
25
-
26
- export const setStorageObject = (key: string, item: any): void => {
27
- if (typeof window === 'undefined') return;
28
- if (item === undefined) return;
29
- try {
30
- localStorage.setItem(key, JSON.stringify(item));
31
- } catch (err) {
32
- console.error(`Error setting item ${key} in localStorage:`, err);
33
- }
34
- };
1
+ export const getStorageObject = <T>(item: string, defaultItem: T | null = null): T | null => {
2
+ if (typeof window === 'undefined') return defaultItem;
3
+ const storageItem = localStorage.getItem(item);
4
+ if (storageItem === null || storageItem === 'undefined') {
5
+ localStorage.removeItem(item);
6
+ return defaultItem;
7
+ }
8
+ try {
9
+ return JSON.parse(storageItem) ?? defaultItem;
10
+ } catch (error) {
11
+ console.error(`Error parsing JSON for ${item}:`, error);
12
+ return defaultItem;
13
+ }
14
+ };
15
+
16
+ export const getStorageItem = (item: string, defaultItem: string | null = null): string | null => {
17
+ if (typeof window === 'undefined') return defaultItem;
18
+ const storageItem = localStorage.getItem(item);
19
+ if (storageItem === null || storageItem === 'undefined') {
20
+ localStorage.removeItem(item);
21
+ return defaultItem;
22
+ }
23
+ return storageItem ?? defaultItem;
24
+ };
25
+
26
+ export const setStorageObject = (key: string, item: any): void => {
27
+ if (typeof window === 'undefined') return;
28
+ if (item === undefined) return;
29
+ try {
30
+ localStorage.setItem(key, JSON.stringify(item));
31
+ } catch (err) {
32
+ console.error(`Error setting item ${key} in localStorage:`, err);
33
+ }
34
+ };
@@ -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 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
-
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
+
@@ -1,92 +1,92 @@
1
- export const getDistinctItemsByProximity = (items, listingEntitiesDetails) => {
2
- const clusters = {};
3
-
4
- if (!listingEntitiesDetails) return [];
5
-
6
- const closeItemPairs = findCloseItems(listingEntitiesDetails);
7
- if (closeItemPairs.length > 0) {
8
- listingEntitiesDetails = adjustItemPositions(
9
- listingEntitiesDetails,
10
- closeItemPairs
11
- );
12
- }
13
-
14
- items?.forEach(item => {
15
- if(item.entityId !== -1){
16
-
17
- const entityDetails = listingEntitiesDetails[item.entityId];
18
-
19
- if (!entityDetails) {
20
- console.error(`Details not found for entityId: ${item.entityId}`);
21
- return;
22
- }
23
-
24
- item.mapDetails = entityDetails;
25
-
26
- if (!clusters[item.entityId]) {
27
- clusters[item.entityId] = {
28
- ...item.mapDetails,
29
- items: { [item.id]: item }
30
- };
31
- } else {
32
- clusters[item.entityId].items[item.id] = item;
33
- }}
34
- });
35
-
36
- return Object.values(clusters);
37
- };
38
-
39
- export const findCloseItems = itemsObj => {
40
- const closeItems = [];
41
- const items = Object.values(itemsObj); // Convert object to array for iteration
42
- const proximityThreshold = 0.0001;
43
-
44
- for (let i = 0; i < items.length; i++) {
45
- for (let j = i + 1; j < items.length; j++) {
46
- const distanceLat = Math.abs(items[i].latitude - items[j].latitude);
47
- const distanceLng = Math.abs(items[i].longitude - items[j].longitude);
48
- if (
49
- distanceLat < proximityThreshold &&
50
- distanceLng < proximityThreshold
51
- ) {
52
- closeItems.push({ item1: items[i], item2: items[j] });
53
- }
54
- }
55
- }
56
-
57
- return closeItems;
58
- };
59
-
60
- export const adjustItemPositions = (itemsObj, closeItemPairs) => {
61
- const adjustmentValue = 0.0001;
62
- const adjustedItems = { ...itemsObj }; // Create a shallow copy of the object
63
-
64
- closeItemPairs.forEach(pair => {
65
- if (adjustedItems[pair.item1.id] && adjustedItems[pair.item2.id]) {
66
- adjustedItems[pair.item2.id].latitude += adjustmentValue;
67
- adjustedItems[pair.item2.id].longitude += adjustmentValue;
68
- }
69
- });
70
-
71
- return adjustedItems;
72
- };
73
-
74
- export const clusterOptions = (clusterGridSize, fillColor) => {
75
- return {
76
- gridSize: clusterGridSize,
77
- maxZoom:15,
78
- styles:[{
79
- url: createSvgDataUri(fillColor),
80
- textColor:'white',
81
- height: 40,
82
- width: 40
83
- }]
84
- };
85
- };
86
-
87
- function createSvgDataUri(fillColor) {
88
- const svg = `<svg width="50" height="50" xmlns="http://www.w3.org/2000/svg">
89
- <circle cx="25" cy="25" r="20" fill="${fillColor}" />
90
- </svg>`;
91
- return `data:image/svg+xml;base64,${btoa(svg)}`;
92
- }
1
+ export const getDistinctItemsByProximity = (items, listingEntitiesDetails) => {
2
+ const clusters = {};
3
+
4
+ if (!listingEntitiesDetails) return [];
5
+
6
+ const closeItemPairs = findCloseItems(listingEntitiesDetails);
7
+ if (closeItemPairs.length > 0) {
8
+ listingEntitiesDetails = adjustItemPositions(
9
+ listingEntitiesDetails,
10
+ closeItemPairs
11
+ );
12
+ }
13
+
14
+ items?.forEach(item => {
15
+ if(item.entityId !== -1){
16
+
17
+ const entityDetails = listingEntitiesDetails[item.entityId];
18
+
19
+ if (!entityDetails) {
20
+ console.error(`Details not found for entityId: ${item.entityId}`);
21
+ return;
22
+ }
23
+
24
+ item.mapDetails = entityDetails;
25
+
26
+ if (!clusters[item.entityId]) {
27
+ clusters[item.entityId] = {
28
+ ...item.mapDetails,
29
+ items: { [item.id]: item }
30
+ };
31
+ } else {
32
+ clusters[item.entityId].items[item.id] = item;
33
+ }}
34
+ });
35
+
36
+ return Object.values(clusters);
37
+ };
38
+
39
+ export const findCloseItems = itemsObj => {
40
+ const closeItems = [];
41
+ const items = Object.values(itemsObj); // Convert object to array for iteration
42
+ const proximityThreshold = 0.0001;
43
+
44
+ for (let i = 0; i < items.length; i++) {
45
+ for (let j = i + 1; j < items.length; j++) {
46
+ const distanceLat = Math.abs(items[i].latitude - items[j].latitude);
47
+ const distanceLng = Math.abs(items[i].longitude - items[j].longitude);
48
+ if (
49
+ distanceLat < proximityThreshold &&
50
+ distanceLng < proximityThreshold
51
+ ) {
52
+ closeItems.push({ item1: items[i], item2: items[j] });
53
+ }
54
+ }
55
+ }
56
+
57
+ return closeItems;
58
+ };
59
+
60
+ export const adjustItemPositions = (itemsObj, closeItemPairs) => {
61
+ const adjustmentValue = 0.0001;
62
+ const adjustedItems = { ...itemsObj }; // Create a shallow copy of the object
63
+
64
+ closeItemPairs.forEach(pair => {
65
+ if (adjustedItems[pair.item1.id] && adjustedItems[pair.item2.id]) {
66
+ adjustedItems[pair.item2.id].latitude += adjustmentValue;
67
+ adjustedItems[pair.item2.id].longitude += adjustmentValue;
68
+ }
69
+ });
70
+
71
+ return adjustedItems;
72
+ };
73
+
74
+ export const clusterOptions = (clusterGridSize, fillColor) => {
75
+ return {
76
+ gridSize: clusterGridSize,
77
+ maxZoom:15,
78
+ styles:[{
79
+ url: createSvgDataUri(fillColor),
80
+ textColor:'white',
81
+ height: 40,
82
+ width: 40
83
+ }]
84
+ };
85
+ };
86
+
87
+ function createSvgDataUri(fillColor) {
88
+ const svg = `<svg width="50" height="50" xmlns="http://www.w3.org/2000/svg">
89
+ <circle cx="25" cy="25" r="20" fill="${fillColor}" />
90
+ </svg>`;
91
+ return `data:image/svg+xml;base64,${btoa(svg)}`;
92
+ }