@abcagency/hc-ui-components 1.9.19 → 1.9.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/HireControlMap.js +2 -1
- package/dist/components/HireControlMap.js.map +1 -1
- package/dist/components/containers/accordions/map-accordion-item-container.js +5 -2
- package/dist/components/containers/accordions/map-accordion-item-container.js.map +1 -1
- package/dist/components/containers/filter/location-container.js +6 -2
- package/dist/components/containers/filter/location-container.js.map +1 -1
- package/dist/components/containers/filter/points-of-interest-container.js +11 -1
- package/dist/components/containers/filter/points-of-interest-container.js.map +1 -1
- package/dist/components/containers/maps/map-container.js +17 -4
- package/dist/components/containers/maps/map-container.js.map +1 -1
- package/dist/contexts/placesContext.js +5 -3
- package/dist/contexts/placesContext.js.map +1 -1
- package/dist/types/types/config/MapConfig.d.ts +1 -0
- package/dist/types/types/config/PointsOfInterestConfig.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/HireControlMap.js +1 -0
- package/src/components/containers/accordions/map-accordion-item-container.js +3 -2
- package/src/components/containers/filter/location-container.js +3 -1
- package/src/components/containers/filter/points-of-interest-container.js +10 -1
- package/src/components/containers/maps/map-container.js +15 -4
- package/src/contexts/placesContext.js +3 -3
- package/src/types/config/MapConfig.ts +1 -0
- package/src/types/config/PointsOfInterestConfig.ts +1 -0
|
@@ -20,7 +20,7 @@ var LIBRARIES = ['places'];
|
|
|
20
20
|
|
|
21
21
|
// Component to handle all context providers
|
|
22
22
|
var ContextProviders = function ContextProviders(_ref) {
|
|
23
|
-
var _siteConfig$pointsOfI;
|
|
23
|
+
var _siteConfig$pointsOfI, _siteConfig$pointsOfI2;
|
|
24
24
|
var children = _ref.children,
|
|
25
25
|
siteConfig = _ref.siteConfig,
|
|
26
26
|
trackEvent = _ref.trackEvent,
|
|
@@ -46,6 +46,7 @@ var ContextProviders = function ContextProviders(_ref) {
|
|
|
46
46
|
placeMappings: (_siteConfig$pointsOfI = siteConfig.pointsOfInterestConfig.placeMappings) !== null && _siteConfig$pointsOfI !== void 0 ? _siteConfig$pointsOfI : {},
|
|
47
47
|
additionalMapMarkers: mapListProps.additionalMapMarkers,
|
|
48
48
|
googleMapsApiKey: googleMapsApiKey,
|
|
49
|
+
showAtZoomLevel: (_siteConfig$pointsOfI2 = siteConfig.pointsOfInterestConfig.showAtZoomLevel) !== null && _siteConfig$pointsOfI2 !== void 0 ? _siteConfig$pointsOfI2 : 12,
|
|
49
50
|
markerColors: {
|
|
50
51
|
fillColor: siteConfig.colors.primary,
|
|
51
52
|
strokeColor: siteConfig.colors.primaryDark,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HireControlMap.js","sources":["../../src/components/HireControlMap.js"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { useLoadScript } from '@react-google-maps/api';\n\nimport Grid from '~/components/modules/grid';\nimport Filter from '~/components/containers/filter/filter-container';\nimport MapList from '~/components/containers/maps/map-list-container';\n\n// Context imports\nimport { MapProvider } from '~/contexts/mapContext';\nimport { PlacesProvider } from '~/contexts/placesContext';\nimport { MapListProvider } from '~/contexts/mapListContext';\nimport { TrackEventProvider } from '~/contexts/trackEventContext';\nimport { ThemeProvider } from '~/contexts/themeContext';\n\nimport { initializeAlgoliaSearch } from '~/util/algoliaSearchUtil';\n\n// Libraries for Google Maps\nconst LIBRARIES = ['places'];\n\n// Since all data is now passed in statically, no need to fetch config\n\n// Component to handle all context providers\nconst ContextProviders = ({ children, siteConfig, trackEvent, googleMapsApiKey, ...mapListProps }) => { return(\n\t<TrackEventProvider trackEvent={trackEvent}>\n\t\t<ThemeProvider\n\t\t\tuiText={siteConfig.colors.uiText}\n\t\t\tuiAccent={siteConfig.colors.uiAccent}\n\t\t\tprimary={siteConfig.colors.primary}\n\t\t\tprimaryDark={siteConfig.colors.primaryDark}\n\t\t\tsecondary={siteConfig.colors.secondary}\n\t\t\tsecondaryDark={siteConfig.colors.secondaryDark}\n\t\t>\n\t\t\t<MapListProvider siteConfig={siteConfig} googleMapsApiKey={googleMapsApiKey} {...mapListProps}>\n\t\t\t\t<MapProvider resetFilters={mapListProps.resetFilters} defaultZoomOverride={mapListProps.defaultZoomOverride} localStorageKey={mapListProps.localStorageKey}>\n\t\t\t\t\t<PlacesProvider\n\t\t\t\t\t\tplaceMappings={siteConfig.pointsOfInterestConfig.placeMappings ?? {}}\n\t\t\t\t\t\tadditionalMapMarkers={mapListProps.additionalMapMarkers}\n\t\t\t\t\t\tgoogleMapsApiKey={googleMapsApiKey}\n\t\t\t\t\t\tmarkerColors={{\n\t\t\t\t\t\t\tfillColor: siteConfig.colors.primary,\n\t\t\t\t\t\t\tstrokeColor: siteConfig.colors.primaryDark,\n\t\t\t\t\t\t\tselectedFillColor: siteConfig.colors.secondary,\n\t\t\t\t\t\t\tselectedStrokeColor: siteConfig.colors.secondaryDark,\n\t\t\t\t\t\t\tplaceMarkers: {\n\t\t\t\t\t\t\t\tcolors: siteConfig.pointsOfInterestConfig.placeMarkerColors,\n\t\t\t\t\t\t\t\tsize: siteConfig.pointsOfInterestConfig.placeMarkerSize\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</PlacesProvider>\n\t\t\t\t</MapProvider>\n\t\t\t</MapListProvider>\n\t\t</ThemeProvider>\n\t</TrackEventProvider>\n);};\n\n// Main component\n//\nexport const HireControlMap = ({\n\tclientToken,\n\tgoogleMapsApiKey, // Required: Google Maps API key from Next.js\n\tcontainerStyle = { height: '100vh' },\n\tnavigateToDetails = null,\n\tnavigateToEasyApply = null,\n\thandleUrlUpdate = null,\n\tLink = null,\n\tlinkFormat = '/jobs/[slug]',\n\teasyApplyUrl = null,\n\teasyApplyText = 'Easy Apply',\n\tisIframe = false,\n\thideMap = false, // Override to hide map even if siteConfig.showMap is true\n\thideFilters = false, // Hide the entire filter section\n\tnoEntities = false, // Skip entity fetching and hide entity-related filters\n\ttrackEvent = (eventType, eventObj) => {\n\t\tconsole.log(eventType);\n\t\tconsole.log(eventObj);\n\t},\n\t//providing listings entities and a getListingEntities function should negate the need for map code to fetch data\n\tlistings = [],\n\tentities = [],\n\tgetListingEntitiesCallback = null,\n\tdefaultFilters = null,\n\thiddenFilters = null,\n\tsetFiltersUrl = null,\n\tExpandListComponent = null,\n\tadditionalMapMarkers = [],\n\tdefaultZoomOverride = null,\n\t//Default site configuration file passed here stops need to fetch from api\n\tsiteConfiguration = null,\n\tlocalStorageKey = 'defaultKey.',\n\t// Algolia search configuration (optional)\n\talgoliaAppId = null,\n\talgoliaApiKey = null,\n\talgoliaIndexName = null,\n\t/**\n\t * Filter configuration (optional)\n\t * @param {boolean} hideZeroResults - Hide filter options with 0 results (default: false)\n\t * @param {boolean} dynamicCounts - Update counts based on active filters.\n\t * If false, shows initial/total counts (default: true)\n\t * @param {boolean} showFavorites - Show favorites special feature filter (default: true)\n\t * @param {boolean} collapsedByDefault - Start with all filter sections collapsed (default: false)\n\t * @param {boolean} sortAlphabetically - Sort filter options alphabetically instead of by count (default: false)\n\t * @param {object} classNames - Custom Tailwind classes to apply to filter components\n\t * @param {string} classNames.filterContainer - Classes for the main filter container wrapper\n\t * @param {string} classNames.filterContent - Classes for the scrollable filter content area\n\t * @param {string} classNames.filterAccordion - Classes for each filter accordion section\n\t * @param {string} classNames.filterAccordionHeader - Classes for accordion header/trigger\n\t * @param {string} classNames.filterAccordionContent - Classes for accordion content area\n\t * @param {string} classNames.filterItem - Classes for individual filter items (checkboxes/options)\n\t * @param {string} classNames.filterItemLabel - Classes for filter item labels\n\t * @param {string} classNames.filterItemCheckbox - Classes for filter item checkboxes\n\t * @param {string} classNames.filterItemCount - Classes for filter item count badges\n\t * @param {string} classNames.searchInput - Classes for search input field\n\t * @param {string} classNames.resetButton - Classes for reset all button\n\t * @param {string} classNames.showJobsButton - Classes for show jobs button\n\t * @param {string} classNames.filterFooter - Classes for the footer containing buttons\n\t */\n\tfilterConfig = {\n\t\thideZeroResults: false, // Hide filter options with 0 results\n\t\tdynamicCounts: true, // Update counts based on other active filters (false = show initial counts only)\n\t\tshowFavorites: true, // Show favorites filter\n\t\tcollapsedByDefault: false, // Start with all filter sections collapsed\n\t\tsortAlphabetically: false, // Sort filter options alphabetically instead of by count\n\t\tclassNames: {\n\t\t\tfilterContainer: '', // Main filter container wrapper\n\t\t\tfilterContent: '', // Scrollable content area\n\t\t\tfilterAccordion: '', // Filter accordion section\n\t\t\tfilterAccordionHeader: '', // Accordion header/trigger\n\t\t\tfilterAccordionContent: '', // Accordion content body\n\t\t\tfilterItem: '', // Individual filter items\n\t\t\tfilterItemLabel: '', // Filter item labels\n\t\t\tfilterItemCheckbox: '', // Filter item checkboxes\n\t\t\tfilterItemCount: '', // Filter item count badges\n\t\t\tsearchInput: '', // Search input field\n\t\t\tresetButton: '', // Reset all button\n\t\t\tshowJobsButton: '', // Show jobs button\n\t\t\tfilterFooter: '' // Footer with buttons\n\t\t}\n\t}\n}) => {\n\t// Initialize Algolia when credentials are provided (client-side only)\n\tconst [algoliaInitialized, setAlgoliaInitialized] = useState(false);\n\t\n\tuseEffect(() => {\n\t\tif (algoliaAppId && algoliaApiKey && algoliaIndexName && typeof window !== 'undefined') {\n\t\t\tinitializeAlgoliaSearch(algoliaAppId, algoliaApiKey, algoliaIndexName).then(initialized => {\n\t\t\t\tsetAlgoliaInitialized(initialized);\n\t\t\t\tif (initialized) {\n\t\t\t\t\tconsole.log('Algolia search initialized successfully');\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}, [algoliaAppId, algoliaApiKey, algoliaIndexName]);\n\n\t// Load Google Maps (non-blocking - map component will handle this)\n\tconst { isLoaded: isMapsLoaded, loadError } = useLoadScript({\n\t\tgoogleMapsApiKey: googleMapsApiKey,\n\t\tversion: 'quarterly',\n\t\tlibraries: LIBRARIES\n\t});\n\n\t// Only show errors for critical failures\n\tif (!googleMapsApiKey) {\n\t\tconsole.error('Google Maps API key is required');\n\t\treturn <div className=\"hc-p-4\">Google Maps API key is required</div>;\n\t}\n\n\tif (loadError) {\n\t\tconsole.error('Google Maps failed to load:', loadError);\n\t\treturn <div className=\"hc-p-4\">Error loading Google Maps</div>;\n\t}\n\n\t// Don't block rendering - let filters and list show immediately\n\t// Map container will handle its own loading state\n\n\t// siteConfiguration is now required - all data passed in statically\n\tif (!siteConfiguration) {\n\t\tconsole.error('Site configuration is required');\n\t\treturn <div className=\"hc-p-4\">Site configuration is required</div>;\n\t}\n\n\t// Prepare props for MapListProvider\n\tconst mapListProps = {\n\t\tresetFilters: false,\n\t\tnavigateToDetails,\n\t\tnavigateToEasyApply,\n\t\tLink,\n\t\tlinkFormat,\n\t\teasyApplyUrl,\n\t\teasyApplyText,\n\t\tlistings,\n\t\tentities,\n\t\tsiteConfig: siteConfiguration,\n\t\tgetListingEntitiesCallback,\n\t\tsetFiltersUrl,\n\t\thiddenFilters,\n\t\thandleUrlUpdate,\n\t\tdefaultFilters,\n\t\tdefaultZoomOverride, // will usually fit bounds\n\t\tcontainerStyle,\n\t\tExpandListComponent: ExpandListComponent ?? null,\n\t\tadditionalMapMarkers,\n\t\tisIframe,\n\t\tlocalStorageKey,\n\t\thideMap,\n\t\thideFilters,\n\t\tnoEntities,\n\t\tfilterConfig\n\t};\n\n\t// Calculate effective showMap value\n\tconst effectiveShowMap = hideMap ? false : siteConfiguration.showMap;\n\n\t// Prepare marker configuration\n\tconst markerConfigs = {\n\t\tfillColor: siteConfiguration.colors.primary,\n\t\tstrokeColor: siteConfiguration.colors.primaryDark,\n\t\tselectedFillColor: siteConfiguration.colors.secondary,\n\t\tselectedStrokeColor: siteConfiguration.colors.secondaryDark,\n\t\tplaceMarkers: {\n\t\t\tcolors: siteConfiguration.pointsOfInterestConfig.placeMarkerColors,\n\t\t\tsize: siteConfiguration.pointsOfInterestConfig.placeMarkerSize\n\t\t}\n\t};\n\n\t// Render immediately - individual components handle their own loading\n\t// Only Google Maps components will wait for isMapsLoaded\n\treturn (\n\t\t<ContextProviders\n\t\t\tsiteConfig={siteConfiguration}\n\t\t\ttrackEvent={trackEvent}\n\t\t\tgoogleMapsApiKey={googleMapsApiKey || process.env.GOOGLE_MAPS_API_KEY}\n\t\t\t{...mapListProps}\n\t\t>\n\t\t\t<Grid\n\t\t\t\tas='section'\n\t\t\t\tid='job-search-interface'\n\t\t\t\tcolumns={hideFilters ? 'hc-grid-cols-1' : 'md:hc-grid-cols-[1fr_2.5fr] lg:hc-grid-cols-[1fr_3.5fr]'}\n\t\t\t\tgap='hc-gap-0'\n\t\t\t\tautoRows={false}\n\t\t\t\tclassName={'hc-bundle hc-items-stretch hc-divide-x hc-divide-uiAccent/20'}\n\t\t\t>\n\t\t\t\t{!hideFilters && (\n\t\t\t\t\t<Grid.Item className='hc-bg-gray-100'>\n\t\t\t\t\t\t<Filter isDesktop={true} showMap={effectiveShowMap} className='hc-hidden md:hc-block' />\n\t\t\t\t\t</Grid.Item>\n\t\t\t\t)}\n\t\t\t\t<MapList\n\t\t\t\t\tcontainerStyle={containerStyle}\n\t\t\t\t\tmapPosition={siteConfiguration.mapPosition}\n\t\t\t\t\tshowMap={effectiveShowMap}\n\t\t\t\t\tfieldsShown={siteConfiguration.fieldsShown}\n\t\t\t\t\tspecialFeatures={siteConfiguration.specialFeatures}\n\t\t\t\t\tfieldNames={siteConfiguration.fieldNames}\n\t\t\t\t\tplaceMappings={siteConfiguration.pointsOfInterestConfig.placeMappings ?? {}}\n\t\t\t\t\tmarkerConfigs={markerConfigs}\n\t\t\t\t/>\n\t\t\t</Grid>\n\t\t</ContextProviders>\n\t);\n};\n\nexport default HireControlMap;\n"],"names":["LIBRARIES","ContextProviders","_ref","_siteConfig$pointsOfI","children","siteConfig","trackEvent","googleMapsApiKey","mapListProps","_objectWithoutProperties","_excluded","React","createElement","TrackEventProvider","ThemeProvider","uiText","colors","uiAccent","primary","primaryDark","secondary","secondaryDark","MapListProvider","_extends","MapProvider","resetFilters","defaultZoomOverride","localStorageKey","PlacesProvider","placeMappings","pointsOfInterestConfig","additionalMapMarkers","markerColors","fillColor","strokeColor","selectedFillColor","selectedStrokeColor","placeMarkers","placeMarkerColors","size","placeMarkerSize","HireControlMap","_ref2","_siteConfiguration$po","clientToken","_ref2$containerStyle","containerStyle","height","_ref2$navigateToDetai","navigateToDetails","_ref2$navigateToEasyA","navigateToEasyApply","_ref2$handleUrlUpdate","handleUrlUpdate","_ref2$Link","Link","_ref2$linkFormat","linkFormat","_ref2$easyApplyUrl","easyApplyUrl","_ref2$easyApplyText","easyApplyText","_ref2$isIframe","isIframe","_ref2$hideMap","hideMap","_ref2$hideFilters","hideFilters","_ref2$noEntities","noEntities","_ref2$trackEvent","eventType","eventObj","console","log","_ref2$listings","listings","_ref2$entities","entities","_ref2$getListingEntit","getListingEntitiesCallback","_ref2$defaultFilters","defaultFilters","_ref2$hiddenFilters","hiddenFilters","_ref2$setFiltersUrl","setFiltersUrl","_ref2$ExpandListCompo","ExpandListComponent","_ref2$additionalMapMa","_ref2$defaultZoomOver","_ref2$siteConfigurati","siteConfiguration","_ref2$localStorageKey","_ref2$algoliaAppId","algoliaAppId","_ref2$algoliaApiKey","algoliaApiKey","_ref2$algoliaIndexNam","algoliaIndexName","_ref2$filterConfig","filterConfig","hideZeroResults","dynamicCounts","showFavorites","collapsedByDefault","sortAlphabetically","classNames","filterContainer","filterContent","filterAccordion","filterAccordionHeader","filterAccordionContent","filterItem","filterItemLabel","filterItemCheckbox","filterItemCount","searchInput","resetButton","showJobsButton","filterFooter","_useState","useState","_useState2","_slicedToArray","algoliaInitialized","setAlgoliaInitialized","useEffect","window","initializeAlgoliaSearch","then","initialized","_useLoadScript","useLoadScript","version","libraries","isLoaded","loadError","error","className","effectiveShowMap","showMap","markerConfigs","process","env","GOOGLE_MAPS_API_KEY","Grid","as","id","columns","gap","autoRows","Item","Filter","isDesktop","MapList","mapPosition","fieldsShown","specialFeatures","fieldNames"],"mappings":";;;;;;;;;;;;;;;AAgBA;AACA,IAAMA,SAAS,GAAG,CAAC,QAAQ,CAA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uBAAA;AAAuB,GAAE,CAC7E,CACX,eACDhI,KAAA,CAAAC,aAAA,CAAC+I,gBAAO,EAAA;AACP7G,IAAAA,cAAc,EAAEA,cAAe;IAC/B8G,WAAW,EAAEhE,iBAAiB,CAACgE,WAAY;AAC3Cf,IAAAA,OAAO,EAAED,gBAAiB;IAC1BiB,WAAW,EAAEjE,iBAAiB,CAACiE,WAAY;IAC3CC,eAAe,EAAElE,iBAAiB,CAACkE,eAAgB;IACnDC,UAAU,EAAEnE,iBAAiB,CAACmE,UAAW;AACzClI,IAAAA,aAAa,EAAAc,CAAAA,qBAAA,GAAEiD,iBAAiB,CAAC9D,sBAAsB,CAACD,aAAa,MAAA,IAAA,IAAAc,qBAAA,KAAA,KAAA,CAAA,GAAAA,qBAAA,GAAI,EAAG;AAC5EmG,IAAAA,aAAa,EAAEA,aAAAA;GACf,CACI,CACW,CAAC,CAAA;AAErB,EAAC;AAED,uBAAerG,cAAc;;;;"}
|
|
1
|
+
{"version":3,"file":"HireControlMap.js","sources":["../../src/components/HireControlMap.js"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { useLoadScript } from '@react-google-maps/api';\n\nimport Grid from '~/components/modules/grid';\nimport Filter from '~/components/containers/filter/filter-container';\nimport MapList from '~/components/containers/maps/map-list-container';\n\n// Context imports\nimport { MapProvider } from '~/contexts/mapContext';\nimport { PlacesProvider } from '~/contexts/placesContext';\nimport { MapListProvider } from '~/contexts/mapListContext';\nimport { TrackEventProvider } from '~/contexts/trackEventContext';\nimport { ThemeProvider } from '~/contexts/themeContext';\n\nimport { initializeAlgoliaSearch } from '~/util/algoliaSearchUtil';\n\n// Libraries for Google Maps\nconst LIBRARIES = ['places'];\n\n// Since all data is now passed in statically, no need to fetch config\n\n// Component to handle all context providers\nconst ContextProviders = ({ children, siteConfig, trackEvent, googleMapsApiKey, ...mapListProps }) => { return(\n\t<TrackEventProvider trackEvent={trackEvent}>\n\t\t<ThemeProvider\n\t\t\tuiText={siteConfig.colors.uiText}\n\t\t\tuiAccent={siteConfig.colors.uiAccent}\n\t\t\tprimary={siteConfig.colors.primary}\n\t\t\tprimaryDark={siteConfig.colors.primaryDark}\n\t\t\tsecondary={siteConfig.colors.secondary}\n\t\t\tsecondaryDark={siteConfig.colors.secondaryDark}\n\t\t>\n\t\t\t<MapListProvider siteConfig={siteConfig} googleMapsApiKey={googleMapsApiKey} {...mapListProps}>\n\t\t\t\t<MapProvider resetFilters={mapListProps.resetFilters} defaultZoomOverride={mapListProps.defaultZoomOverride} localStorageKey={mapListProps.localStorageKey}>\n\t\t\t\t\t<PlacesProvider\n\t\t\t\t\t\tplaceMappings={siteConfig.pointsOfInterestConfig.placeMappings ?? {}}\n\t\t\t\t\t\tadditionalMapMarkers={mapListProps.additionalMapMarkers}\n\t\t\t\t\t\tgoogleMapsApiKey={googleMapsApiKey}\n\t\t\t\t\t\tshowAtZoomLevel={siteConfig.pointsOfInterestConfig.showAtZoomLevel ?? 12}\n\t\t\t\t\t\tmarkerColors={{\n\t\t\t\t\t\t\tfillColor: siteConfig.colors.primary,\n\t\t\t\t\t\t\tstrokeColor: siteConfig.colors.primaryDark,\n\t\t\t\t\t\t\tselectedFillColor: siteConfig.colors.secondary,\n\t\t\t\t\t\t\tselectedStrokeColor: siteConfig.colors.secondaryDark,\n\t\t\t\t\t\t\tplaceMarkers: {\n\t\t\t\t\t\t\t\tcolors: siteConfig.pointsOfInterestConfig.placeMarkerColors,\n\t\t\t\t\t\t\t\tsize: siteConfig.pointsOfInterestConfig.placeMarkerSize\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</PlacesProvider>\n\t\t\t\t</MapProvider>\n\t\t\t</MapListProvider>\n\t\t</ThemeProvider>\n\t</TrackEventProvider>\n);};\n\n// Main component\n//\nexport const HireControlMap = ({\n\tclientToken,\n\tgoogleMapsApiKey, // Required: Google Maps API key from Next.js\n\tcontainerStyle = { height: '100vh' },\n\tnavigateToDetails = null,\n\tnavigateToEasyApply = null,\n\thandleUrlUpdate = null,\n\tLink = null,\n\tlinkFormat = '/jobs/[slug]',\n\teasyApplyUrl = null,\n\teasyApplyText = 'Easy Apply',\n\tisIframe = false,\n\thideMap = false, // Override to hide map even if siteConfig.showMap is true\n\thideFilters = false, // Hide the entire filter section\n\tnoEntities = false, // Skip entity fetching and hide entity-related filters\n\ttrackEvent = (eventType, eventObj) => {\n\t\tconsole.log(eventType);\n\t\tconsole.log(eventObj);\n\t},\n\t//providing listings entities and a getListingEntities function should negate the need for map code to fetch data\n\tlistings = [],\n\tentities = [],\n\tgetListingEntitiesCallback = null,\n\tdefaultFilters = null,\n\thiddenFilters = null,\n\tsetFiltersUrl = null,\n\tExpandListComponent = null,\n\tadditionalMapMarkers = [],\n\tdefaultZoomOverride = null,\n\t//Default site configuration file passed here stops need to fetch from api\n\tsiteConfiguration = null,\n\tlocalStorageKey = 'defaultKey.',\n\t// Algolia search configuration (optional)\n\talgoliaAppId = null,\n\talgoliaApiKey = null,\n\talgoliaIndexName = null,\n\t/**\n\t * Filter configuration (optional)\n\t * @param {boolean} hideZeroResults - Hide filter options with 0 results (default: false)\n\t * @param {boolean} dynamicCounts - Update counts based on active filters.\n\t * If false, shows initial/total counts (default: true)\n\t * @param {boolean} showFavorites - Show favorites special feature filter (default: true)\n\t * @param {boolean} collapsedByDefault - Start with all filter sections collapsed (default: false)\n\t * @param {boolean} sortAlphabetically - Sort filter options alphabetically instead of by count (default: false)\n\t * @param {object} classNames - Custom Tailwind classes to apply to filter components\n\t * @param {string} classNames.filterContainer - Classes for the main filter container wrapper\n\t * @param {string} classNames.filterContent - Classes for the scrollable filter content area\n\t * @param {string} classNames.filterAccordion - Classes for each filter accordion section\n\t * @param {string} classNames.filterAccordionHeader - Classes for accordion header/trigger\n\t * @param {string} classNames.filterAccordionContent - Classes for accordion content area\n\t * @param {string} classNames.filterItem - Classes for individual filter items (checkboxes/options)\n\t * @param {string} classNames.filterItemLabel - Classes for filter item labels\n\t * @param {string} classNames.filterItemCheckbox - Classes for filter item checkboxes\n\t * @param {string} classNames.filterItemCount - Classes for filter item count badges\n\t * @param {string} classNames.searchInput - Classes for search input field\n\t * @param {string} classNames.resetButton - Classes for reset all button\n\t * @param {string} classNames.showJobsButton - Classes for show jobs button\n\t * @param {string} classNames.filterFooter - Classes for the footer containing buttons\n\t */\n\tfilterConfig = {\n\t\thideZeroResults: false, // Hide filter options with 0 results\n\t\tdynamicCounts: true, // Update counts based on other active filters (false = show initial counts only)\n\t\tshowFavorites: true, // Show favorites filter\n\t\tcollapsedByDefault: false, // Start with all filter sections collapsed\n\t\tsortAlphabetically: false, // Sort filter options alphabetically instead of by count\n\t\tclassNames: {\n\t\t\tfilterContainer: '', // Main filter container wrapper\n\t\t\tfilterContent: '', // Scrollable content area\n\t\t\tfilterAccordion: '', // Filter accordion section\n\t\t\tfilterAccordionHeader: '', // Accordion header/trigger\n\t\t\tfilterAccordionContent: '', // Accordion content body\n\t\t\tfilterItem: '', // Individual filter items\n\t\t\tfilterItemLabel: '', // Filter item labels\n\t\t\tfilterItemCheckbox: '', // Filter item checkboxes\n\t\t\tfilterItemCount: '', // Filter item count badges\n\t\t\tsearchInput: '', // Search input field\n\t\t\tresetButton: '', // Reset all button\n\t\t\tshowJobsButton: '', // Show jobs button\n\t\t\tfilterFooter: '' // Footer with buttons\n\t\t}\n\t}\n}) => {\n\t// Initialize Algolia when credentials are provided (client-side only)\n\tconst [algoliaInitialized, setAlgoliaInitialized] = useState(false);\n\t\n\tuseEffect(() => {\n\t\tif (algoliaAppId && algoliaApiKey && algoliaIndexName && typeof window !== 'undefined') {\n\t\t\tinitializeAlgoliaSearch(algoliaAppId, algoliaApiKey, algoliaIndexName).then(initialized => {\n\t\t\t\tsetAlgoliaInitialized(initialized);\n\t\t\t\tif (initialized) {\n\t\t\t\t\tconsole.log('Algolia search initialized successfully');\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}, [algoliaAppId, algoliaApiKey, algoliaIndexName]);\n\n\t// Load Google Maps (non-blocking - map component will handle this)\n\tconst { isLoaded: isMapsLoaded, loadError } = useLoadScript({\n\t\tgoogleMapsApiKey: googleMapsApiKey,\n\t\tversion: 'quarterly',\n\t\tlibraries: LIBRARIES\n\t});\n\n\t// Only show errors for critical failures\n\tif (!googleMapsApiKey) {\n\t\tconsole.error('Google Maps API key is required');\n\t\treturn <div className=\"hc-p-4\">Google Maps API key is required</div>;\n\t}\n\n\tif (loadError) {\n\t\tconsole.error('Google Maps failed to load:', loadError);\n\t\treturn <div className=\"hc-p-4\">Error loading Google Maps</div>;\n\t}\n\n\t// Don't block rendering - let filters and list show immediately\n\t// Map container will handle its own loading state\n\n\t// siteConfiguration is now required - all data passed in statically\n\tif (!siteConfiguration) {\n\t\tconsole.error('Site configuration is required');\n\t\treturn <div className=\"hc-p-4\">Site configuration is required</div>;\n\t}\n\n\t// Prepare props for MapListProvider\n\tconst mapListProps = {\n\t\tresetFilters: false,\n\t\tnavigateToDetails,\n\t\tnavigateToEasyApply,\n\t\tLink,\n\t\tlinkFormat,\n\t\teasyApplyUrl,\n\t\teasyApplyText,\n\t\tlistings,\n\t\tentities,\n\t\tsiteConfig: siteConfiguration,\n\t\tgetListingEntitiesCallback,\n\t\tsetFiltersUrl,\n\t\thiddenFilters,\n\t\thandleUrlUpdate,\n\t\tdefaultFilters,\n\t\tdefaultZoomOverride, // will usually fit bounds\n\t\tcontainerStyle,\n\t\tExpandListComponent: ExpandListComponent ?? null,\n\t\tadditionalMapMarkers,\n\t\tisIframe,\n\t\tlocalStorageKey,\n\t\thideMap,\n\t\thideFilters,\n\t\tnoEntities,\n\t\tfilterConfig\n\t};\n\n\t// Calculate effective showMap value\n\tconst effectiveShowMap = hideMap ? false : siteConfiguration.showMap;\n\n\t// Prepare marker configuration\n\tconst markerConfigs = {\n\t\tfillColor: siteConfiguration.colors.primary,\n\t\tstrokeColor: siteConfiguration.colors.primaryDark,\n\t\tselectedFillColor: siteConfiguration.colors.secondary,\n\t\tselectedStrokeColor: siteConfiguration.colors.secondaryDark,\n\t\tplaceMarkers: {\n\t\t\tcolors: siteConfiguration.pointsOfInterestConfig.placeMarkerColors,\n\t\t\tsize: siteConfiguration.pointsOfInterestConfig.placeMarkerSize\n\t\t}\n\t};\n\n\t// Render immediately - individual components handle their own loading\n\t// Only Google Maps components will wait for isMapsLoaded\n\treturn (\n\t\t<ContextProviders\n\t\t\tsiteConfig={siteConfiguration}\n\t\t\ttrackEvent={trackEvent}\n\t\t\tgoogleMapsApiKey={googleMapsApiKey || process.env.GOOGLE_MAPS_API_KEY}\n\t\t\t{...mapListProps}\n\t\t>\n\t\t\t<Grid\n\t\t\t\tas='section'\n\t\t\t\tid='job-search-interface'\n\t\t\t\tcolumns={hideFilters ? 'hc-grid-cols-1' : 'md:hc-grid-cols-[1fr_2.5fr] lg:hc-grid-cols-[1fr_3.5fr]'}\n\t\t\t\tgap='hc-gap-0'\n\t\t\t\tautoRows={false}\n\t\t\t\tclassName={'hc-bundle hc-items-stretch hc-divide-x hc-divide-uiAccent/20'}\n\t\t\t>\n\t\t\t\t{!hideFilters && (\n\t\t\t\t\t<Grid.Item className='hc-bg-gray-100'>\n\t\t\t\t\t\t<Filter isDesktop={true} showMap={effectiveShowMap} className='hc-hidden md:hc-block' />\n\t\t\t\t\t</Grid.Item>\n\t\t\t\t)}\n\t\t\t\t<MapList\n\t\t\t\t\tcontainerStyle={containerStyle}\n\t\t\t\t\tmapPosition={siteConfiguration.mapPosition}\n\t\t\t\t\tshowMap={effectiveShowMap}\n\t\t\t\t\tfieldsShown={siteConfiguration.fieldsShown}\n\t\t\t\t\tspecialFeatures={siteConfiguration.specialFeatures}\n\t\t\t\t\tfieldNames={siteConfiguration.fieldNames}\n\t\t\t\t\tplaceMappings={siteConfiguration.pointsOfInterestConfig.placeMappings ?? {}}\n\t\t\t\t\tmarkerConfigs={markerConfigs}\n\t\t\t\t/>\n\t\t\t</Grid>\n\t\t</ContextProviders>\n\t);\n};\n\nexport default HireControlMap;\n"],"names":["LIBRARIES","ContextProviders","_ref","_siteConfig$pointsOfI","_siteConfig$pointsOfI2","children","siteConfig","trackEvent","googleMapsApiKey","mapListProps","_objectWithoutProperties","_excluded","React","createElement","TrackEventProvider","ThemeProvider","uiText","colors","uiAccent","primary","primaryDark","secondary","secondaryDark","MapListProvider","_extends","MapProvider","resetFilters","defaultZoomOverride","localStorageKey","PlacesProvider","placeMappings","pointsOfInterestConfig","additionalMapMarkers","showAtZoomLevel","markerColors","fillColor","strokeColor","selectedFillColor","selectedStrokeColor","placeMarkers","placeMarkerColors","size","placeMarkerSize","HireControlMap","_ref2","_siteConfiguration$po","clientToken","_ref2$containerStyle","containerStyle","height","_ref2$navigateToDetai","navigateToDetails","_ref2$navigateToEasyA","navigateToEasyApply","_ref2$handleUrlUpdate","handleUrlUpdate","_ref2$Link","Link","_ref2$linkFormat","linkFormat","_ref2$easyApplyUrl","easyApplyUrl","_ref2$easyApplyText","easyApplyText","_ref2$isIframe","isIframe","_ref2$hideMap","hideMap","_ref2$hideFilters","hideFilters","_ref2$noEntities","noEntities","_ref2$trackEvent","eventType","eventObj","console","log","_ref2$listings","listings","_ref2$entities","entities","_ref2$getListingEntit","getListingEntitiesCallback","_ref2$defaultFilters","defaultFilters","_ref2$hiddenFilters","hiddenFilters","_ref2$setFiltersUrl","setFiltersUrl","_ref2$ExpandListCompo","ExpandListComponent","_ref2$additionalMapMa","_ref2$defaultZoomOver","_ref2$siteConfigurati","siteConfiguration","_ref2$localStorageKey","_ref2$algoliaAppId","algoliaAppId","_ref2$algoliaApiKey","algoliaApiKey","_ref2$algoliaIndexNam","algoliaIndexName","_ref2$filterConfig","filterConfig","hideZeroResults","dynamicCounts","showFavorites","collapsedByDefault","sortAlphabetically","classNames","filterContainer","filterContent","filterAccordion","filterAccordionHeader","filterAccordionContent","filterItem","filterItemLabel","filterItemCheckbox","filterItemCount","searchInput","resetButton","showJobsButton","filterFooter","_useState","useState","_useState2","_slicedToArray","algoliaInitialized","setAlgoliaInitialized","useEffect","window","initializeAlgoliaSearch","then","initialized","_useLoadScript","useLoadScript","version","libraries","isLoaded","loadError","error","className","effectiveShowMap","showMap","markerConfigs","process","env","GOOGLE_MAPS_API_KEY","Grid","as","id","columns","gap","autoRows","Item","Filter","isDesktop","MapList","mapPosition","fieldsShown","specialFeatures","fieldNames"],"mappings":";;;;;;;;;;;;;;;AAgBA;AACA,IAAMA,SAAS,GAAG,CAAC,QAAQ,CAAC,CAAA;;AAE5B;;AAEA;AACA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAAgF;EAAA,IAAAC,qBAAA,EAAAC,sBAAA,CAAA;AAAA,EAAA,IAA1EC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IAAEC,UAAU,GAAAJ,IAAA,CAAVI,UAAU;IAAEC,UAAU,GAAAL,IAAA,CAAVK,UAAU;IAAEC,gBAAgB,GAAAN,IAAA,CAAhBM,gBAAgB;AAAKC,IAAAA,YAAY,GAAAC,wBAAA,CAAAR,IAAA,EAAAS,SAAA,CAAA,CAAA;AAAS,EAAA,oBACvGC,KAAA,CAAAC,aAAA,CAACC,kBAAkB,EAAA;AAACP,IAAAA,UAAU,EAAEA,UAAAA;AAAW,GAAA,eAC1CK,KAAA,CAAAC,aAAA,CAACE,aAAa,EAAA;AACbC,IAAAA,MAAM,EAAEV,UAAU,CAACW,MAAM,CAACD,MAAO;AACjCE,IAAAA,QAAQ,EAAEZ,UAAU,CAACW,MAAM,CAACC,QAAS;AACrCC,IAAAA,OAAO,EAAEb,UAAU,CAACW,MAAM,CAACE,OAAQ;AACnCC,IAAAA,WAAW,EAAEd,UAAU,CAACW,MAAM,CAACG,WAAY;AAC3CC,IAAAA,SAAS,EAAEf,UAAU,CAACW,MAAM,CAACI,SAAU;AACvCC,IAAAA,aAAa,EAAEhB,UAAU,CAACW,MAAM,CAACK,aAAAA;AAAc,GAAA,eAE/CV,KAAA,CAAAC,aAAA,CAACU,e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AS;AACZC,IAAAA,EAAE,EAAC,sBAAsB;AACzBC,IAAAA,OAAO,EAAElF,WAAW,GAAG,gBAAgB,GAAG,yDAA0D;AACpGmF,IAAAA,GAAG,EAAC,UAAU;AACdC,IAAAA,QAAQ,EAAE,KAAM;AAChBZ,IAAAA,SAAS,EAAE,8DAAA;GAEV,EAAA,CAACxE,WAAW,iBACZzD,KAAA,CAAAC,aAAA,CAACuI,IAAI,CAACM,IAAI,EAAA;AAACb,IAAAA,SAAS,EAAC,gBAAA;AAAgB,GAAA,eACpCjI,KAAA,CAAAC,aAAA,CAAC8I,eAAM,EAAA;AAACC,IAAAA,SAAS,EAAE,IAAK;AAACb,IAAAA,OAAO,EAAED,gBAAiB;AAACD,IAAAA,SAAS,EAAC,uBAAA;AAAuB,GAAE,CAC7E,CACX,eACDjI,KAAA,CAAAC,aAAA,CAACgJ,gBAAO,EAAA;AACP7G,IAAAA,cAAc,EAAEA,cAAe;IAC/B8G,WAAW,EAAEhE,iBAAiB,CAACgE,WAAY;AAC3Cf,IAAAA,OAAO,EAAED,gBAAiB;IAC1BiB,WAAW,EAAEjE,iBAAiB,CAACiE,WAAY;IAC3CC,eAAe,EAAElE,iBAAiB,CAACkE,eAAgB;IACnDC,UAAU,EAAEnE,iBAAiB,CAACmE,UAAW;AACzCnI,IAAAA,aAAa,EAAAe,CAAAA,qBAAA,GAAEiD,iBAAiB,CAAC/D,sBAAsB,CAACD,aAAa,MAAA,IAAA,IAAAe,qBAAA,KAAA,KAAA,CAAA,GAAAA,qBAAA,GAAI,EAAG;AAC5EmG,IAAAA,aAAa,EAAEA,aAAAA;GACf,CACI,CACW,CAAC,CAAA;AAErB,EAAC;AAED,uBAAerG,cAAc;;;;"}
|
|
@@ -7,6 +7,7 @@ import MapAccordionItem from '../../modules/accordions/MapAccordionItem.js';
|
|
|
7
7
|
import ListItemContainer from '../list/list-item/list-item-container.js';
|
|
8
8
|
|
|
9
9
|
var MapAccordionItemContainer = function MapAccordionItemContainer(_ref) {
|
|
10
|
+
var _siteConfig$jobPinZoo;
|
|
10
11
|
var showMap = _ref.showMap,
|
|
11
12
|
item = _ref.item,
|
|
12
13
|
itemRefs = _ref.itemRefs,
|
|
@@ -16,12 +17,14 @@ var MapAccordionItemContainer = function MapAccordionItemContainer(_ref) {
|
|
|
16
17
|
isActive = _ref.isActive;
|
|
17
18
|
var _useMapList = useMapList(),
|
|
18
19
|
mapItems = _useMapList.mapItems,
|
|
19
|
-
recruiters = _useMapList.recruiters
|
|
20
|
+
recruiters = _useMapList.recruiters,
|
|
21
|
+
siteConfig = _useMapList.siteConfig;
|
|
20
22
|
var _useMap = useMap(),
|
|
21
23
|
selectItem = _useMap.selectItem;
|
|
22
24
|
var _useTrackEvent = useTrackEvent(),
|
|
23
25
|
trackEvent = _useTrackEvent.trackEvent,
|
|
24
26
|
eventTypes = _useTrackEvent.eventTypes;
|
|
27
|
+
var jobPinZoomLevel = (_siteConfig$jobPinZoo = siteConfig === null || siteConfig === void 0 ? void 0 : siteConfig.jobPinZoomLevel) !== null && _siteConfig$jobPinZoo !== void 0 ? _siteConfig$jobPinZoo : 12;
|
|
25
28
|
var setSelectedItemAndZoomMap = function setSelectedItemAndZoomMap(item, isActive) {
|
|
26
29
|
if (isActive) {
|
|
27
30
|
if (typeof window !== 'undefined') {
|
|
@@ -41,7 +44,7 @@ var MapAccordionItemContainer = function MapAccordionItemContainer(_ref) {
|
|
|
41
44
|
return ((_x$entityKey = x.entityKey) === null || _x$entityKey === void 0 ? void 0 : _x$entityKey.toLowerCase()) === ((_item$fields$entityKe = item.fields.entityKey) === null || _item$fields$entityKe === void 0 ? void 0 : _item$fields$entityKe.toLowerCase());
|
|
42
45
|
}) || null;
|
|
43
46
|
console.log('location is', location);
|
|
44
|
-
selectItem(item, location,
|
|
47
|
+
selectItem(item, location, jobPinZoomLevel, {
|
|
45
48
|
lat: location === null || location === void 0 ? void 0 : location.latitude,
|
|
46
49
|
lng: location === null || location === void 0 ? void 0 : location.longitude
|
|
47
50
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-accordion-item-container.js","sources":["../../../../src/components/containers/accordions/map-accordion-item-container.js"],"sourcesContent":["import React from 'react';\nimport { useMap } from '~/contexts/mapContext';\nimport { useMapList } from '~/contexts/mapListContext';\nimport { useTrackEvent } from '~/contexts/trackEventContext';\nimport { setStorageObject } from '~/util/localStorageUtil';\nimport MapAccordionItem from '~/components/modules/accordions/MapAccordionItem';\nimport ListItemContainer from '~/components/containers/list/list-item/list-item-container';\n\nconst MapAccordionItemContainer = ({\n\tshowMap,\n\titem,\n\titemRefs,\n\tfieldsShown,\n\titemExpandedContent,\n\tspecialFeatures,\n\tisActive\n}) => {\n\tconst { mapItems, recruiters } = useMapList();\n\tconst { selectItem } = useMap();\n\tconst { trackEvent, eventTypes } = useTrackEvent();\n\n\tconst setSelectedItemAndZoomMap = (item, isActive) => {\n\t\tif (isActive) {\n\t\t\tif (typeof window !== 'undefined') {\n\t\t\t\tlocalStorage.removeItem(\"selectedListItem\");\n\t\t\t}\n\t\t\tselectItem(null, null, 9, { lat: 39.8283, lng: -98.5795 });\n\t\t} else {\n\t\t\tsetStorageObject(\"selectedListItem\", item);\n\t\t\tconsole.log('mapItems here', mapItems);\n\t\t\t//edited here for new structure of entity key\n\t\t\tconsole.log('the item in questions is',item);\n\t\t\tconst location = mapItems.find(x => x.entityKey?.toLowerCase() === item.fields.entityKey?.toLowerCase()) || null;\n\t\t\tconsole.log('location is', location);\n\t\t\tselectItem(item, location,
|
|
1
|
+
{"version":3,"file":"map-accordion-item-container.js","sources":["../../../../src/components/containers/accordions/map-accordion-item-container.js"],"sourcesContent":["import React from 'react';\nimport { useMap } from '~/contexts/mapContext';\nimport { useMapList } from '~/contexts/mapListContext';\nimport { useTrackEvent } from '~/contexts/trackEventContext';\nimport { setStorageObject } from '~/util/localStorageUtil';\nimport MapAccordionItem from '~/components/modules/accordions/MapAccordionItem';\nimport ListItemContainer from '~/components/containers/list/list-item/list-item-container';\n\nconst MapAccordionItemContainer = ({\n\tshowMap,\n\titem,\n\titemRefs,\n\tfieldsShown,\n\titemExpandedContent,\n\tspecialFeatures,\n\tisActive\n}) => {\n\tconst { mapItems, recruiters, siteConfig } = useMapList();\n\tconst { selectItem } = useMap();\n\tconst { trackEvent, eventTypes } = useTrackEvent();\n\tconst jobPinZoomLevel = siteConfig?.jobPinZoomLevel ?? 12;\n\n\tconst setSelectedItemAndZoomMap = (item, isActive) => {\n\t\tif (isActive) {\n\t\t\tif (typeof window !== 'undefined') {\n\t\t\t\tlocalStorage.removeItem(\"selectedListItem\");\n\t\t\t}\n\t\t\tselectItem(null, null, 9, { lat: 39.8283, lng: -98.5795 });\n\t\t} else {\n\t\t\tsetStorageObject(\"selectedListItem\", item);\n\t\t\tconsole.log('mapItems here', mapItems);\n\t\t\t//edited here for new structure of entity key\n\t\t\tconsole.log('the item in questions is',item);\n\t\t\tconst location = mapItems.find(x => x.entityKey?.toLowerCase() === item.fields.entityKey?.toLowerCase()) || null;\n\t\t\tconsole.log('location is', location);\n\t\t\tselectItem(item, location, jobPinZoomLevel, {\n\t\t\t\tlat: location?.latitude,\n\t\t\t\tlng: location?.longitude\n\t\t\t});\n\t\t}\n\t};\n\n\tconst handleItemClick = item => {\n\t\ttrackEvent(eventTypes.JOB_LISTING_SELECTED, {\n\t\t\tjobTitle: item.fields.title,\n\t\t\tjobCategory: item.fields.category,\n\t\t\tentityDisplayName: item?.mapDetails?.entityDisplayName\n\t\t});\n\n\t\tsetSelectedItemAndZoomMap(item, isActive);\n\t};\n\n\treturn (\n\t\t<MapAccordionItem\n\t\t\titem={item}\n\t\t\titemRefs={itemRefs}\n\t\t\titemExpandedContent={itemExpandedContent}\n\t\t\tisActive={isActive}\n\t\t\trecruiter={recruiters[item.recruiterId]}\n\t\t>\n\t\t\t<ListItemContainer\n\t\t\t\tshowMap={showMap}\n\t\t\t\titem={item}\n\t\t\t\tfieldsShown={fieldsShown}\n\t\t\t\tspecialFeatures={specialFeatures}\n\t\t\t\tisActive={isActive}\n\t\t\t\tonClick={() => handleItemClick(item)}\n\t\t\t/>\n\t\t</MapAccordionItem>\n\t);\n};\n\nexport default MapAccordionItemContainer;\n"],"names":["MapAccordionItemContainer","_ref","_siteConfig$jobPinZoo","showMap","item","itemRefs","fieldsShown","itemExpandedContent","specialFeatures","isActive","_useMapList","useMapList","mapItems","recruiters","siteConfig","_useMap","useMap","selectItem","_useTrackEvent","useTrackEvent","trackEvent","eventTypes","jobPinZoomLevel","setSelectedItemAndZoomMap","window","localStorage","removeItem","lat","lng","setStorageObject","console","log","location","find","x","_x$entityKey","_item$fields$entityKe","entityKey","toLowerCase","fields","latitude","longitude","handleItemClick","_item$mapDetails","JOB_LISTING_SELECTED","jobTitle","title","jobCategory","category","entityDisplayName","mapDetails","React","createElement","MapAccordionItem","recruiter","recruiterId","ListItemContainer","onClick"],"mappings":";;;;;;;;AAQA,IAAMA,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAAC,IAAA,EAQzB;AAAA,EAAA,IAAAC,qBAAA,CAAA;AAAA,EAAA,IAPLC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IACPC,IAAI,GAAAH,IAAA,CAAJG,IAAI;IACJC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;IACRC,WAAW,GAAAL,IAAA,CAAXK,WAAW;IACXC,mBAAmB,GAAAN,IAAA,CAAnBM,mBAAmB;IACnBC,eAAe,GAAAP,IAAA,CAAfO,eAAe;IACfC,QAAQ,GAAAR,IAAA,CAARQ,QAAQ,CAAA;AAER,EAAA,IAAAC,WAAA,GAA6CC,UAAU,EAAE;IAAjDC,QAAQ,GAAAF,WAAA,CAARE,QAAQ;IAAEC,UAAU,GAAAH,WAAA,CAAVG,UAAU;IAAEC,UAAU,GAAAJ,WAAA,CAAVI,UAAU,CAAA;AACxC,EAAA,IAAAC,OAAA,GAAuBC,MAAM,EAAE;IAAvBC,UAAU,GAAAF,OAAA,CAAVE,UAAU,CAAA;AAClB,EA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IAAI,EAAEK,QAAQ,CAAC,CAAA;GACzC,CAAA;AAED,EAAA,oBACC0C,KAAA,CAAAC,aAAA,CAACC,gBAAgB,EAAA;AAChBjD,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,QAAQ,EAAEA,QAAS;AACnBE,IAAAA,mBAAmB,EAAEA,mBAAoB;AACzCE,IAAAA,QAAQ,EAAEA,QAAS;AACnB6C,IAAAA,SAAS,EAAEzC,UAAU,CAACT,IAAI,CAACmD,WAAW,CAAA;AAAE,GAAA,eAExCJ,KAAA,CAAAC,aAAA,CAACI,iBAAiB,EAAA;AACjBrD,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,IAAI,EAAEA,IAAK;AACXE,IAAAA,WAAW,EAAEA,WAAY;AACzBE,IAAAA,eAAe,EAAEA,eAAgB;AACjCC,IAAAA,QAAQ,EAAEA,QAAS;IACnBgD,OAAO,EAAE,SAAAA,OAAA,GAAA;MAAA,OAAMf,eAAe,CAACtC,IAAI,CAAC,CAAA;AAAA,KAAA;AAAC,GACrC,CACgB,CAAC,CAAA;AAErB;;;;"}
|
|
@@ -5,6 +5,7 @@ import FilterPointsOfInterestContainer from './points-of-interest-container.js';
|
|
|
5
5
|
import { useMapList } from '../../../contexts/mapListContext.js';
|
|
6
6
|
|
|
7
7
|
var FilterLocationContainer = function FilterLocationContainer(_ref) {
|
|
8
|
+
var _siteConfig$pointsOfI, _siteConfig$pointsOfI2;
|
|
8
9
|
var className = _ref.className,
|
|
9
10
|
defaultValue = _ref.defaultValue,
|
|
10
11
|
setDefaultValue = _ref.setDefaultValue,
|
|
@@ -16,9 +17,11 @@ var FilterLocationContainer = function FilterLocationContainer(_ref) {
|
|
|
16
17
|
setSelectedFilters = _useMapList.setSelectedFilters,
|
|
17
18
|
selectedFilters = _useMapList.selectedFilters,
|
|
18
19
|
filterOptions = _useMapList.filterOptions,
|
|
19
|
-
noEntities = _useMapList.noEntities
|
|
20
|
+
noEntities = _useMapList.noEntities,
|
|
21
|
+
siteConfig = _useMapList.siteConfig;
|
|
20
22
|
var locations = filterOptions === null || filterOptions === void 0 ? void 0 : filterOptions.locations;
|
|
21
23
|
var pointsOfInterest = filterOptions === null || filterOptions === void 0 ? void 0 : filterOptions.pointsOfInterest;
|
|
24
|
+
var showAtZoomLevel = (_siteConfig$pointsOfI = siteConfig === null || siteConfig === void 0 || (_siteConfig$pointsOfI2 = siteConfig.pointsOfInterestConfig) === null || _siteConfig$pointsOfI2 === void 0 ? void 0 : _siteConfig$pointsOfI2.showAtZoomLevel) !== null && _siteConfig$pointsOfI !== void 0 ? _siteConfig$pointsOfI : 12;
|
|
22
25
|
return /*#__PURE__*/React.createElement(FilterLocation, {
|
|
23
26
|
className: className,
|
|
24
27
|
defaultValue: defaultValue,
|
|
@@ -35,7 +38,8 @@ var FilterLocationContainer = function FilterLocationContainer(_ref) {
|
|
|
35
38
|
className: "hc-mt-4",
|
|
36
39
|
pointsOfInterest: pointsOfInterest,
|
|
37
40
|
setDefaultValue: setDefaultValue,
|
|
38
|
-
defaultValue: defaultValue
|
|
41
|
+
defaultValue: defaultValue,
|
|
42
|
+
showAtZoomLevel: showAtZoomLevel
|
|
39
43
|
}));
|
|
40
44
|
};
|
|
41
45
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location-container.js","sources":["../../../../src/components/containers/filter/location-container.js"],"sourcesContent":["import React from 'react';\nimport FilterLocation from '~/components/modules/filter/location';\nimport FilterCommute from '~/components/containers/filter/commute-container';\nimport FilterPointsOfInterest from '~/components/containers/filter/points-of-interest-container';\nimport { useMapList } from '~/contexts/mapListContext';\n\nconst FilterLocationContainer = ({\n\tclassName,\n\tdefaultValue,\n\tsetDefaultValue,\n\tshowMap = false,\n\tsetLocation,\n\tsetSelectedListItem\n}) => {\n\tconst { setSelectedFilters, selectedFilters, filterOptions, noEntities } = useMapList();\n\n\tconst locations = filterOptions?.locations;\n\tconst pointsOfInterest = filterOptions?.pointsOfInterest;\n\n\treturn (\n\t\t<FilterLocation\n\t\t\tclassName={className}\n\t\t\tdefaultValue={defaultValue}\n\t\t\tsetDefaultValue={setDefaultValue}\n\t\t\tshowMap={showMap}\n\t\t\tsetLocation={setLocation}\n\t\t\tsetSelectedListItem={setSelectedListItem}\n\t\t\tlocations={locations}\n\t\t\tsetSelectedFilters={setSelectedFilters}\n\t\t\tselectedFilters={selectedFilters}\n\t\t>\n\t\t\t{showMap && !noEntities && <FilterCommute className=\"hc-mt-6\" />}\n\t\t\t{showMap && !noEntities && (\n\t\t\t\t<FilterPointsOfInterest\n\t\t\t\t\tclassName=\"hc-mt-4\"\n\t\t\t\t\tpointsOfInterest={pointsOfInterest}\n\t\t\t\t\tsetDefaultValue={setDefaultValue}\n\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</FilterLocation>\n\t);\n};\n\nexport default FilterLocationContainer;\n"],"names":["FilterLocationContainer","_ref","className","defaultValue","setDefaultValue","_ref$showMap","showMap","setLocation","setSelectedListItem","_useMapList","useMapList","setSelectedFilters","selectedFilters","filterOptions","noEntities","locations","pointsOfInterest","React","createElement","FilterLocation","FilterCommute","FilterPointsOfInterest"],"mappings":";;;;;;AAMA,IAAMA,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAAC,IAAA,EAOvB;AAAA,EAAA,IANLC,SAAS,
|
|
1
|
+
{"version":3,"file":"location-container.js","sources":["../../../../src/components/containers/filter/location-container.js"],"sourcesContent":["import React from 'react';\nimport FilterLocation from '~/components/modules/filter/location';\nimport FilterCommute from '~/components/containers/filter/commute-container';\nimport FilterPointsOfInterest from '~/components/containers/filter/points-of-interest-container';\nimport { useMapList } from '~/contexts/mapListContext';\n\nconst FilterLocationContainer = ({\n\tclassName,\n\tdefaultValue,\n\tsetDefaultValue,\n\tshowMap = false,\n\tsetLocation,\n\tsetSelectedListItem\n}) => {\n\tconst { setSelectedFilters, selectedFilters, filterOptions, noEntities, siteConfig } = useMapList();\n\n\tconst locations = filterOptions?.locations;\n\tconst pointsOfInterest = filterOptions?.pointsOfInterest;\n\tconst showAtZoomLevel = siteConfig?.pointsOfInterestConfig?.showAtZoomLevel ?? 12;\n\n\treturn (\n\t\t<FilterLocation\n\t\t\tclassName={className}\n\t\t\tdefaultValue={defaultValue}\n\t\t\tsetDefaultValue={setDefaultValue}\n\t\t\tshowMap={showMap}\n\t\t\tsetLocation={setLocation}\n\t\t\tsetSelectedListItem={setSelectedListItem}\n\t\t\tlocations={locations}\n\t\t\tsetSelectedFilters={setSelectedFilters}\n\t\t\tselectedFilters={selectedFilters}\n\t\t>\n\t\t\t{showMap && !noEntities && <FilterCommute className=\"hc-mt-6\" />}\n\t\t\t{showMap && !noEntities && (\n\t\t\t\t<FilterPointsOfInterest\n\t\t\t\t\tclassName=\"hc-mt-4\"\n\t\t\t\t\tpointsOfInterest={pointsOfInterest}\n\t\t\t\t\tsetDefaultValue={setDefaultValue}\n\t\t\t\t\tdefaultValue={defaultValue}\n\t\t\t\t\tshowAtZoomLevel={showAtZoomLevel}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</FilterLocation>\n\t);\n};\n\nexport default FilterLocationContainer;\n"],"names":["FilterLocationContainer","_ref","_siteConfig$pointsOfI","_siteConfig$pointsOfI2","className","defaultValue","setDefaultValue","_ref$showMap","showMap","setLocation","setSelectedListItem","_useMapList","useMapList","setSelectedFilters","selectedFilters","filterOptions","noEntities","siteConfig","locations","pointsOfInterest","showAtZoomLevel","pointsOfInterestConfig","React","createElement","FilterLocation","FilterCommute","FilterPointsOfInterest"],"mappings":";;;;;;AAMA,IAAMA,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAAC,IAAA,EAOvB;EAAA,IAAAC,qBAAA,EAAAC,sBAAA,CAAA;AAAA,EAAA,IANLC,SAAS,GAAAH,IAAA,CAATG,SAAS;IACTC,YAAY,GAAAJ,IAAA,CAAZI,YAAY;IACZC,eAAe,GAAAL,IAAA,CAAfK,eAAe;IAAAC,YAAA,GAAAN,IAAA,C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AAW,EAAEA,WAAY;AACzBC,IAAAA,mBAAmB,EAAEA,mBAAoB;AACzCQ,IAAAA,SAAS,EAAEA,SAAU;AACrBL,IAAAA,kBAAkB,EAAEA,kBAAmB;AACvCC,IAAAA,eAAe,EAAEA,eAAAA;GAEhBN,EAAAA,OAAO,IAAI,CAACQ,UAAU,iBAAIM,KAAA,CAAAC,aAAA,CAACE,sBAAa,EAAA;AAACrB,IAAAA,SAAS,EAAC,SAAA;GAAW,CAAC,EAC/DI,OAAO,IAAI,CAACQ,UAAU,iBACtBM,KAAA,CAAAC,aAAA,CAACG,+BAAsB,EAAA;AACtBtB,IAAAA,SAAS,EAAC,SAAS;AACnBe,IAAAA,gBAAgB,EAAEA,gBAAiB;AACnCb,IAAAA,eAAe,EAAEA,eAAgB;AACjCD,IAAAA,YAAY,EAAEA,YAAa;AAC3Be,IAAAA,eAAe,EAAEA,eAAAA;AAAgB,GACjC,CAEa,CAAC,CAAA;AAEnB;;;;"}
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import Accordion from '../../modules/accordions/default.js';
|
|
3
3
|
import AccordionFilterItem from '../../modules/accordions/filterItem.js';
|
|
4
4
|
import RadioItemContainer from './points-of-interest-radio-item-container.js';
|
|
5
|
+
import { usePlaces } from '../../../contexts/placesContext.js';
|
|
5
6
|
|
|
6
7
|
var FilterPointsOfInterestContainer = function FilterPointsOfInterestContainer(_ref) {
|
|
7
8
|
var _ref$title = _ref.title,
|
|
@@ -9,7 +10,16 @@ var FilterPointsOfInterestContainer = function FilterPointsOfInterestContainer(_
|
|
|
9
10
|
pointsOfInterest = _ref.pointsOfInterest,
|
|
10
11
|
setDefaultValue = _ref.setDefaultValue,
|
|
11
12
|
className = _ref.className,
|
|
12
|
-
defaultValue = _ref.defaultValue
|
|
13
|
+
defaultValue = _ref.defaultValue,
|
|
14
|
+
_ref$showAtZoomLevel = _ref.showAtZoomLevel,
|
|
15
|
+
showAtZoomLevel = _ref$showAtZoomLevel === void 0 ? 12 : _ref$showAtZoomLevel;
|
|
16
|
+
var _usePlaces = usePlaces(),
|
|
17
|
+
currentZoom = _usePlaces.currentZoom;
|
|
18
|
+
|
|
19
|
+
// Don't render if zoom level is below threshold
|
|
20
|
+
if (currentZoom < showAtZoomLevel) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
13
23
|
var renderRadioItem = function renderRadioItem(item, index) {
|
|
14
24
|
return /*#__PURE__*/React.createElement(RadioItemContainer, {
|
|
15
25
|
key: item.key + index,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"points-of-interest-container.js","sources":["../../../../src/components/containers/filter/points-of-interest-container.js"],"sourcesContent":["import React from 'react';\nimport Accordion from '~/components/modules/accordions/default';\nimport AccordionFilterItem from '~/components/modules/accordions/filterItem';\nimport RadioItemContainer from '~/components/containers/filter/points-of-interest-radio-item-container';\n\nconst FilterPointsOfInterestContainer = ({\n\ttitle = \"Points of interest\",\n\tpointsOfInterest,\n\tsetDefaultValue,\n\tclassName,\n\tdefaultValue\n}) => {\n\tconst renderRadioItem = (item, index) => (\n\t\t<RadioItemContainer key={item.key + index} item={item} field={item.id} />\n\t);\n\n\tconst body = pointsOfInterest.items.map((item, index) => renderRadioItem(item, index));\n\n\treturn (\n\t\t<div className={`hc-relative ${className ?? \"\"}`}>\n\t\t\t<Accordion defaultValue={defaultValue} className=\"hc-space-y-4\">\n\t\t\t\t<AccordionFilterItem\n\t\t\t\t\tid=\"points-of-interest\"\n\t\t\t\t\tsetDefaultValue={setDefaultValue}\n\t\t\t\t\theader={title}\n\t\t\t\t\tbody={body}\n\t\t\t\t/>\n\t\t\t</Accordion>\n\t\t</div>\n\t);\n};\n\nexport default FilterPointsOfInterestContainer;\n"],"names":["FilterPointsOfInterestContainer","_ref","_ref$title","title","pointsOfInterest","setDefaultValue","className","defaultValue","renderRadioItem","item","index","React","createElement","RadioItemContainer","key","field","id","body","items","map","concat","Accordion","AccordionFilterItem","header"],"mappings":"
|
|
1
|
+
{"version":3,"file":"points-of-interest-container.js","sources":["../../../../src/components/containers/filter/points-of-interest-container.js"],"sourcesContent":["import React from 'react';\nimport Accordion from '~/components/modules/accordions/default';\nimport AccordionFilterItem from '~/components/modules/accordions/filterItem';\nimport RadioItemContainer from '~/components/containers/filter/points-of-interest-radio-item-container';\nimport { usePlaces } from '~/contexts/placesContext';\n\nconst FilterPointsOfInterestContainer = ({\n\ttitle = \"Points of interest\",\n\tpointsOfInterest,\n\tsetDefaultValue,\n\tclassName,\n\tdefaultValue,\n\tshowAtZoomLevel = 12\n}) => {\n\tconst { currentZoom } = usePlaces();\n\t\n\t// Don't render if zoom level is below threshold\n\tif (currentZoom < showAtZoomLevel) {\n\t\treturn null;\n\t}\n\n\tconst renderRadioItem = (item, index) => (\n\t\t<RadioItemContainer key={item.key + index} item={item} field={item.id} />\n\t);\n\n\tconst body = pointsOfInterest.items.map((item, index) => renderRadioItem(item, index));\n\n\treturn (\n\t\t<div className={`hc-relative ${className ?? \"\"}`}>\n\t\t\t<Accordion defaultValue={defaultValue} className=\"hc-space-y-4\">\n\t\t\t\t<AccordionFilterItem\n\t\t\t\t\tid=\"points-of-interest\"\n\t\t\t\t\tsetDefaultValue={setDefaultValue}\n\t\t\t\t\theader={title}\n\t\t\t\t\tbody={body}\n\t\t\t\t/>\n\t\t\t</Accordion>\n\t\t</div>\n\t);\n};\n\nexport default FilterPointsOfInterestContainer;\n"],"names":["FilterPointsOfInterestContainer","_ref","_ref$title","title","pointsOfInterest","setDefaultValue","className","defaultValue","_ref$showAtZoomLevel","showAtZoomLevel","_usePlaces","usePlaces","currentZoom","renderRadioItem","item","index","React","createElement","RadioItemContainer","key","field","id","body","items","map","concat","Accordion","AccordionFilterItem","header"],"mappings":";;;;;;AAMA,IAAMA,+BAA+B,GAAG,SAAlCA,+BAA+BA,CAAAC,IAAA,EAO/B;AAAA,EAAA,IAAAC,UAAA,GAAAD,IAAA,CANLE,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAG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A,YAAY,EAAEA,YAAa;AAACD,IAAAA,SAAS,EAAC,cAAA;AAAc,GAAA,eAC9DU,KAAA,CAAAC,aAAA,CAACU,mBAAmB,EAAA;AACnBN,IAAAA,EAAE,EAAC,oBAAoB;AACvBhB,IAAAA,eAAe,EAAEA,eAAgB;AACjCuB,IAAAA,MAAM,EAAEzB,KAAM;AACdmB,IAAAA,IAAI,EAAEA,IAAAA;GACN,CACS,CACP,CAAC,CAAA;AAER;;;;"}
|
|
@@ -154,19 +154,23 @@ var MapContainer = function MapContainer(_ref) {
|
|
|
154
154
|
fitBounds(mapRef.current, true);
|
|
155
155
|
}
|
|
156
156
|
if (mapRef.current && !mapInteracted) {
|
|
157
|
+
var _siteConfig$jobPinZoo;
|
|
158
|
+
var jobPinZoomLevel = (_siteConfig$jobPinZoo = siteConfig === null || siteConfig === void 0 ? void 0 : siteConfig.jobPinZoomLevel) !== null && _siteConfig$jobPinZoo !== void 0 ? _siteConfig$jobPinZoo : 12;
|
|
157
159
|
var currZoom = mapRef.current.zoom;
|
|
158
|
-
var setZoomVal = currZoom <
|
|
160
|
+
var setZoomVal = currZoom < jobPinZoomLevel + 1 ? currZoom : jobPinZoomLevel;
|
|
159
161
|
mapRef.current.setZoom(setZoomVal);
|
|
160
162
|
}
|
|
161
|
-
}, [filteredListings]);
|
|
163
|
+
}, [filteredListings, siteConfig]);
|
|
162
164
|
useEffect(function () {
|
|
165
|
+
var _siteConfig$jobPinZoo2;
|
|
163
166
|
if (!mapRef.current || !location || mapInteracted) return;
|
|
167
|
+
var jobPinZoomLevel = (_siteConfig$jobPinZoo2 = siteConfig === null || siteConfig === void 0 ? void 0 : siteConfig.jobPinZoomLevel) !== null && _siteConfig$jobPinZoo2 !== void 0 ? _siteConfig$jobPinZoo2 : 12;
|
|
164
168
|
mapRef.current.panTo(new google.maps.LatLng(location.latitude, location.longitude));
|
|
165
169
|
if (mapRef.current) {
|
|
166
|
-
var setZoomVal = zoom <
|
|
170
|
+
var setZoomVal = zoom < jobPinZoomLevel + 1 ? zoom : jobPinZoomLevel;
|
|
167
171
|
mapRef.current.setZoom(setZoomVal);
|
|
168
172
|
}
|
|
169
|
-
}, [location, zoom,
|
|
173
|
+
}, [location, zoom, siteConfig]);
|
|
170
174
|
var fitBounds = function fitBounds(map) {
|
|
171
175
|
var overload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
172
176
|
if ((mapInteracted === false || overload) && mapItems != null) {
|
|
@@ -201,6 +205,15 @@ var MapContainer = function MapContainer(_ref) {
|
|
|
201
205
|
setMapInteracted(true);
|
|
202
206
|
setMarkersToHideFromBounds([]);
|
|
203
207
|
selectLocationEntity(mapLocation);
|
|
208
|
+
var jobPinZoomLevel = siteConfig === null || siteConfig === void 0 ? void 0 : siteConfig.jobPinZoomLevel;
|
|
209
|
+
if (jobPinZoomLevel !== undefined && mapRef.current) {
|
|
210
|
+
setTimeout(function () {
|
|
211
|
+
if (mapRef.current) {
|
|
212
|
+
mapRef.current.panTo(new google.maps.LatLng(mapLocation.latitude, mapLocation.longitude));
|
|
213
|
+
mapRef.current.setZoom(jobPinZoomLevel);
|
|
214
|
+
}
|
|
215
|
+
}, 300);
|
|
216
|
+
}
|
|
204
217
|
};
|
|
205
218
|
var onLoad = function onLoad(map) {
|
|
206
219
|
if (!location || location === null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-container.js","sources":["../../../../src/components/containers/maps/map-container.js"],"sourcesContent":["\"use client\";\n\nimport React, { useEffect, useRef, useState } from \"react\";\n\nimport MapMarker from \"~/components/containers/maps/map-marker-container\";\nimport PlaceMarker from \"~/components/modules/maps/place-marker\";\n\nimport { usePlaces } from \"~/contexts/placesContext\";\nimport { useMap } from \"~/contexts/mapContext\";\nimport { useMapList } from \"~/contexts/mapListContext\";\n\nimport { markerIconSelected, markerIcon, pinIcon } from \"~/util/mapIconUtil\";\n\nimport Map from \"~/components/modules/maps/map\";\nimport { MarkerClustererF, Marker } from \"@react-google-maps/api\";\nimport { clusterOptions } from \"~/util/mapUtil\";\nimport { BallTriangle } from 'react-loader-spinner';\n\nconst MapContainer = ({ markerConfigs, infoWindowClasses, clusterGridSize = 60 }) => {\n\tconst [isGoogleMapsReady, setIsGoogleMapsReady] = useState(false);\n\n\t// Check if Google Maps is loaded\n\tuseEffect(() => {\n\t\tif (typeof window !== 'undefined' && window.google && window.google.maps && window.google.maps.Map) {\n\t\t\tconsole.log('Google Maps already loaded');\n\t\t\tsetIsGoogleMapsReady(true);\n\t\t\treturn;\n\t\t}\n\n\t\tconsole.log('Waiting for Google Maps to load...');\n\t\tlet attempts = 0;\n\t\tconst maxAttempts = 50; // 5 seconds max\n\t\t\n\t\t// Poll for Google Maps to become available\n\t\tconst checkInterval = setInterval(() => {\n\t\t\tattempts++;\n\t\t\tif (typeof window !== 'undefined' && window.google && window.google.maps && window.google.maps.Map) {\n\t\t\t\tconsole.log('Google Maps loaded after', attempts * 100, 'ms');\n\t\t\t\tsetIsGoogleMapsReady(true);\n\t\t\t\tclearInterval(checkInterval);\n\t\t\t} else if (attempts >= maxAttempts) {\n\t\t\t\tconsole.error('Google Maps failed to load after 5 seconds');\n\t\t\t\tclearInterval(checkInterval);\n\t\t\t}\n\t\t}, 100);\n\n\t\treturn () => clearInterval(checkInterval);\n\t}, []);\n\n\tconst {\n\t\tlocation,\n\t\tzoom,\n\t\tcenter,\n\t\tselectLocationEntity,\n\t\tsetLocation,\n\t\tmapInteracted,\n\t\tsetMapInteracted,\n\t\tdefaultZoomOverride\n\t} = useMap();\n\n\tconst {\n\t\tmapItems: oldMapItems,\n\t\tfilteredListings,\n\t\tselectedFilters,\n\t\tsetSelectedFilters,\n\t\tsetQuery,\n\t\tsiteConfig\n\t} = useMapList();\n\tconst [mapItems, setMapItems] = useState(null);\n\tconst [markersToHideFromBounds, setMarkersToHideFromBounds] = useState([]);\n\n\tconst mapRef = useRef();\n\tconst markerRefs = useRef({});\n\tconst mapContainerRef = useRef(null);\n\tconst {\n\t\tpoiMarkers,\n\t\tsetCurrentCenter,\n\t\tcurrentCenter,\n\t\tsetCurrentZoom,\n\t\tcurrentZoom,\n\t\tselectedPlaceMarker,\n\t\tsetSelectedPlaceMarker,\n\t\tplacesWindow,\n\t\tsetPlacesWindow,\n\t\tadditionalMapMarkers\n\t} = usePlaces();\n\n\tconst onIdle = () => {\n\t\tif (!currentCenter || !mapRef.current) return;\n\t\tconst newCenter = mapRef.current.getCenter().toJSON();\n\t\tconst newZoom = mapRef.current.zoom;\n\t\tsetCurrentCenter(newCenter);\n\n\t\tif (newZoom !== currentZoom) {\n\t\t\tsetCurrentZoom(newZoom);\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tif (!oldMapItems || oldMapItems.length === 0) return;\n\n\t\tif (!siteConfig.defaultMapState || mapInteracted || selectedFilters?.state || selectedFilters?.city) {\n\t\t\tsetMapItems(oldMapItems);\n\t\t\tsetMarkersToHideFromBounds([]);\n\t\t\treturn;\n\t\t}\n\n\t\tconst markersToHide = oldMapItems\n\t\t\t.filter(x => x.address.state !== siteConfig.defaultMapState)\n\t\t\t.map(item => item.id);\n\n\t\tsetMarkersToHideFromBounds(markersToHide);\n\t\tsetMapItems(oldMapItems);\n\t}, [oldMapItems, selectedFilters, siteConfig, mapInteracted]);\n\n\tuseEffect(() => {\n\t\tif (mapContainerRef.current) {\n\t\t\tconst handleScroll = () => {\n\t\t\t\tsetMapInteracted(true);\n\t\t\t};\n\t\t\tvar mapContainerRefCurrent = mapContainerRef.current;\n\t\t\tmapContainerRef.current.addEventListener(\"wheel\", handleScroll);\n\t\t\treturn () => mapContainerRefCurrent.removeEventListener(\"wheel\", handleScroll);\n\t\t}\n\t}, [mapContainerRef.current]);\n\n\tuseEffect(() => {\n\t\tif (mapRef.current && defaultZoomOverride && !mapInteracted && !location) {\n\t\t\tmapRef.current.setZoom(defaultZoomOverride);\n\t\t}\n\t}, [mapInteracted]);\n\n\tuseEffect(() => {\n\t\tif (mapRef.current) {\n\t\t\tconst mapInstance = mapRef.current;\n\t\t\tconst dragStartListener = mapInstance.addListener(\"dragstart\", () => {\n\t\t\t\tsetMapInteracted(true);\n\t\t\t\tsetMarkersToHideFromBounds([]);\n\t\t\t});\n\t\t\tconst mouseDownListener = mapInstance.addListener(\"mousedown\", () => {\n\t\t\t\tsetMapInteracted(true);\n\t\t\t\tsetMarkersToHideFromBounds([]);\n\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tgoogle.maps.event.removeListener(dragStartListener);\n\t\t\t\tgoogle.maps.event.removeListener(mouseDownListener);\n\t\t\t};\n\t\t}\n\t}, [mapRef.current, mapContainerRef.current]);\n\n\tuseEffect(() => {\n\t\tif (((mapItems && mapItems.length > 0) || poiMarkers.length > 0) && mapRef.current && !mapInteracted) {\n\t\t\tfitBounds(mapRef.current);\n\t\t}\n\t}, [mapItems, mapRef.current, location]);\n\n\tuseEffect(() => {\n\t\tif (((mapItems && mapItems.length > 0) || poiMarkers.length > 0) && mapRef.current && !mapInteracted) {\n\t\t\tfitBounds(mapRef.current, true);\n\t\t}\n\t\tif (mapRef.current && !mapInteracted) {\n\t\t\tconst currZoom = mapRef.current.zoom;\n\t\t\tconst setZoomVal = currZoom < 13 ? currZoom : 12;\n\t\t\tmapRef.current.setZoom(setZoomVal);\n\t\t}\n\t}, [filteredListings]);\n\n\tuseEffect(() => {\n\t\tif (!mapRef.current || !location || mapInteracted) return;\n\t\tmapRef.current.panTo(new google.maps.LatLng(location.latitude, location.longitude));\n\t\tif (mapRef.current) {\n\t\t\tconst setZoomVal = zoom < 13 ? zoom : 12;\n\t\t\tmapRef.current.setZoom(setZoomVal);\n\t\t}\n\t}, [location, zoom, mapRef.current]);\n\n\tconst fitBounds = (map, overload = false) => {\n\t\tif ((mapInteracted === false || overload) && mapItems != null) {\n\t\t\tif (typeof window === 'undefined' || !window.google) return;\n\t\t\tconst bounds = new window.google.maps.LatLngBounds();\n\n\t\t\tmapItems.forEach(item => {\n\t\t\t\tif (!mapInteracted && markersToHideFromBounds.includes(item.id)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tbounds.extend(new google.maps.LatLng(item.latitude, item.longitude));\n\t\t\t});\n\n\t\t\tif (siteConfig.optionalShowLocationClusterConfig) {\n\t\t\t\tconst configLocation = new google.maps.LatLng(\n\t\t\t\t\tsiteConfig.optionalShowLocationClusterConfig.latitude,\n\t\t\t\t\tsiteConfig.optionalShowLocationClusterConfig.longitude\n\t\t\t\t);\n\t\t\t\tmap.panTo(configLocation);\n\t\t\t\tbounds.extend(\n\t\t\t\t\tnew google.maps.LatLng(\n\t\t\t\t\t\tsiteConfig.optionalShowLocationClusterConfig.latitude,\n\t\t\t\t\t\tsiteConfig.optionalShowLocationClusterConfig.longitude\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (!map) return;\n\t\t\tconst currentCenter = map.getCenter();\n\t\t\tmap.fitBounds(bounds);\n\t\t\tconst newCenter = bounds.getCenter();\n\t\t\tif (currentCenter && newCenter) {\n\t\t\t\tmap.panTo(newCenter);\n\t\t\t}\n\t\t}\n\t\tif (defaultZoomOverride && !mapInteracted && !location) {\n\t\t\tmapRef.current.setZoom(defaultZoomOverride);\n\t\t} else if (mapRef.current.zoom > 17) {\n\t\t\tmapRef.current.setZoom(16);\n\t\t}\n\t};\n\n\tconst markerClickHandler = mapLocation => {\n\t\tsetMapInteracted(true);\n\t\tsetMarkersToHideFromBounds([]);\n\t\tselectLocationEntity(mapLocation);\n\t};\n\n\tconst onLoad = map => {\n\t\tif (!location || location === null) {\n\t\t\tmapRef.current = map;\n\t\t\tfitBounds(map, true);\n\t\t\treturn;\n\t\t}\n\t\tmapRef.current = map;\n\n\t\tif (mapInteracted === false) {\n\t\t\tmapRef.current.panTo(new google.maps.LatLng(location.latitude, location.longitude));\n\n\t\t\tmapRef.current.setZoom(zoom);\n\t\t}\n\t};\n\n\tconst pinIconUrl = pinIcon({\n\t\tfillColor: markerConfigs.fillColor,\n\t\tstrokeColor: markerConfigs.strokeColor\n\t});\n\n\tconst onClusterClick = cluster => {\n\t\tif (\n\t\t\t!siteConfig.optionalShowLocationClusterConfig ||\n mapRef.current.zoom > siteConfig.optionalShowLocationClusterConfig.showForZoomLevelLessThan\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!cluster || typeof cluster.getMarkers !== \"function\") {\n\t\t\tconsole.error(\"Cluster object or getMarkers method not available.\");\n\t\t\treturn;\n\t\t}\n\n\t\tconst markers = cluster.getMarkers();\n\n\t\tif (!markers || markers.length === 0) {\n\t\t\tconsole.error(\"No markers found in the cluster.\");\n\t\t\treturn;\n\t\t}\n\n\t\tsetTimeout(() => {\n\t\t\tif (typeof window === 'undefined' || !window.google) return;\n\t\t\tconst bounds = new window.google.maps.LatLngBounds();\n\n\t\t\tmarkers.forEach(marker => {\n\t\t\t\tbounds.extend(marker.getPosition());\n\t\t\t});\n\t\t\tconst clusterCenter = bounds.getCenter();\n\n\t\t\tconst configLat = siteConfig.optionalShowLocationClusterConfig.latitude;\n\t\t\tconst configLng = siteConfig.optionalShowLocationClusterConfig.longitude;\n\n\t\t\tconst latDiff = clusterCenter.lat() - configLat;\n\t\t\tconst lngDiff = clusterCenter.lng() - configLng;\n\t\t\tconst distance = Math.sqrt(latDiff * latDiff + lngDiff * lngDiff);\n\n\t\t\tconst distanceThreshold = 1;\n\t\t\tif (distance <= distanceThreshold) {\n\t\t\t\tbounds.extend(new google.maps.LatLng(configLat, configLng));\n\t\t\t}\n\n\t\t\tif (mapRef.current) {\n\t\t\t\tmapRef.current.fitBounds(bounds);\n\t\t\t}\n\t\t}, 300);\n\t};\n\tif (!isGoogleMapsReady) {\n\t\treturn (\n\t\t\t<div className=\"hc-w-full hc-h-full hc-bg-gray-100 hc-flex hc-items-center hc-justify-center hc-min-h-[400px]\">\n\t\t\t\t<BallTriangle\n\t\t\t\t\theight={80}\n\t\t\t\t\twidth={80}\n\t\t\t\t\tradius={5}\n\t\t\t\t\tcolor=\"#2563eb\"\n\t\t\t\t\tariaLabel=\"ball-triangle-loading\"\n\t\t\t\t\twrapperStyle={{}}\n\t\t\t\t\twrapperClass=\"\"\n\t\t\t\t\tvisible={true}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Ensure mapItems is an array\n\tconst mapItemsArray = Array.isArray(mapItems) ? mapItems : [];\n\t\n\tif (!mapItemsArray || mapItemsArray.length === 0) {\n\t\treturn (\n\t\t\t<div className=\"hc-w-full hc-h-full hc-bg-gray-100 hc-flex hc-items-center hc-justify-center\">\n\t\t\t\t<div className=\"hc-text-gray-600\">No locations to display</div>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst mapItemsKey = mapItemsArray.map(item => item.id).join(\"-\");\n\n\n\treturn (\n\t\t<Map\n\t\t\tzoom={zoom}\n\t\t\tcenter={center}\n\t\t\tmapContainerRef={mapContainerRef}\n\t\t\tonLoad={onLoad}\n\t\t\tonIdle={onIdle}\n\t\t\tmapInteracted={mapInteracted}\n\t\t\tpinIconUrl={pinIconUrl}\n\t\t\tsetMapInteracted={setMapInteracted}\n\t\t\tfitBounds={fitBounds}\n\t\t\tmapRef={mapRef}\n\t\t\tsetQuery={setQuery}\n\t\t\tfilteredListingsLength={filteredListings.length}\n\t\t\tsetSelectedFilters={setSelectedFilters}\n\t\t>\n\t\t\t<MarkerClustererF\n\t\t\t\tkey={mapItemsKey}\n\t\t\t\tcalculator={markers => {\n\t\t\t\t\tconst totalCount = markers.reduce((sum, marker) => sum + (marker.get(\"count\") || 1), 0);\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttext: totalCount.toString(),\n\t\t\t\t\t\tindex: Math.min(5, Math.floor(totalCount / 10))\n\t\t\t\t\t};\n\t\t\t\t}}\n\t\t\t\toptions={{\n\t\t\t\t\t...clusterOptions(clusterGridSize, markerConfigs.fillColor)\n\t\t\t\t}}\n\t\t\t\tonClick={onClusterClick}\n\t\t\t>\n\t\t\t\t{clusterer => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{mapItemsArray.map(item => {\n\t\t\t\t\t\t\tconst markerCount = Object.values(item.items).length;\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<MapMarker\n\t\t\t\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t\t\t\titem={item}\n\t\t\t\t\t\t\t\t\tselectedLocation={location}\n\t\t\t\t\t\t\t\t\tmarkerRefs={markerRefs}\n\t\t\t\t\t\t\t\t\tinfoWindowClasses={infoWindowClasses}\n\t\t\t\t\t\t\t\t\tsetSelectedLocation={setLocation}\n\t\t\t\t\t\t\t\t\tmarkerClickHandler={markerClickHandler}\n\t\t\t\t\t\t\t\t\tclusterer={clusterer}\n\t\t\t\t\t\t\t\t\tmarkerIcon={markerIcon(markerConfigs, markerCount)}\n\t\t\t\t\t\t\t\t\tmarkerIconSelected={markerIconSelected(markerConfigs, markerCount)}\n\t\t\t\t\t\t\t\t\tsetMapInteracted={setMapInteracted}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\n\t\t\t\t\t\t{additionalMapMarkers &&\n additionalMapMarkers.map(\n \t(marker, index) =>\n \t\tcurrentZoom >= marker.minZoom &&\n currentZoom <= marker.maxZoom && (\n \t\t\t<Marker\n \t\t\t\tkey={`marker-${marker.title}-${index}`}\n \t\t\t\tposition={marker.position}\n \t\t\t\ttitle={marker.title}\n \t\t\t\ticon={{\n \t\t\t\t\turl: marker.iconUrl,\n \t\t\t\t\tscaledSize: new window.google.maps.Size(40, 40)\n \t\t\t\t}}\n \t\t\t/>\n \t\t)\n )}\n\n\t\t\t\t\t\t{poiMarkers &&\n poiMarkers.markers.map((marker, index) => (\n \t<PlaceMarker\n \t\tkey={`marker-${marker.title}-${index}`}\n \t\tmarker={marker}\n \t\tindex={index}\n \t\tselectedPlaceMarker={selectedPlaceMarker}\n \t\tplacesWindow={placesWindow}\n \t\tsetPlacesWindow={setPlacesWindow}\n \t\tsetSelectedPlaceMarker={setSelectedPlaceMarker}\n \t/>\n ))}\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</MarkerClustererF>\n\t\t</Map>\n\t);\n};\n\nexport default MapContainer;\n\n"],"names":["MapContainer","_ref","markerConfigs","infoWindowClasses","_ref$clusterGridSize","clusterGridSize","_useState","useState","_useState2","_slicedToArray","isGoogleMapsReady","setIsGoogleMapsReady","useEffect","window","google","maps","Map","console","log","attempts","maxAttempts","checkInterval","setInterval","clearInterval","error","_useMap","useMap","location","zoom","center","selectLocationEntity","setLocation","mapInteracted","setMapInteracted","defaultZoomOverride","_useMapList","useMapList","oldMapItems","mapItems","filteredListings","selectedFilters","setSelectedFilters","setQuery","siteConfig","_useState3","_useState4","setMapItems","_useState5","_useState6","markersToHideFromBounds","setMarkersToHideFromBounds","mapRef","useRef","markerRefs","mapContainerRef","_usePlaces","usePlaces","poiMarkers","setCurrentCenter","currentCenter","setCurrentZoom","currentZoom","selectedPlaceMarker","setSelectedPlaceMarker","placesWindow","setPlacesWindow","additionalMapMarkers","onIdle","current","newCenter","getCenter","toJSON","newZoom","length","defaultMapState","state","city","markersToHide","filter","x","address","map","item","id","handleScroll","mapContainerRefCurrent","addEventListener","removeEventListener","setZoom","mapInstance","dragStartListener","addListener","mouseDownListener","event","removeListener","fitBounds","currZoom","setZoomVal","panTo","LatLng","latitude","longitude","overload","arguments","undefined","bounds","LatLngBounds","forEach","includes","extend","optionalShowLocationClusterConfig","configLocation","markerClickHandler","mapLocation","onLoad","pinIconUrl","pinIcon","fillColor","strokeColor","onClusterClick","cluster","showForZoomLevelLessThan","getMarkers","markers","setTimeout","marker","getPosition","clusterCenter","configLat","configLng","latDiff","lat","lngDiff","lng","distance","Math","sqrt","distanceThreshold","React","createElement","className","BallTriangle","height","width","radius","color","ariaLabel","wrapperStyle","wrapperClass","visible","mapItemsArray","Array","isArray","mapItemsKey","join","filteredListingsLength","MarkerClustererF","key","calculator","totalCount","reduce","sum","get","text","toString","index","min","floor","options","_objectSpread","clusterOptions","onClick","clusterer","Fragment","markerCount","Object","values","items","MapMarker","selectedLocation","setSelectedLocation","markerIcon","markerIconSelected","minZoom","maxZoom","Marker","concat","title","position","icon","url","iconUrl","scaledSize","Size","PlaceMarker"],"mappings":";;;;;;;;;;;;;AAkBA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAAmE;AAAA,EAAA,IAA7DC,aAAa,GAAAD,IAAA,CAAbC,aAAa;IAAEC,iBAAiB,GAAAF,IAAA,CAAjBE,iBAAiB;IAAAC,oBAAA,GAAAH,IAAA,CAAEI,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,oBAAA,CAAA;AAC7E,EAAA,IAAAE,SAAA,GAAkDC,QAAQ,CAAC,KAAK,CAAC;IAAAC,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAA1DI,IAAAA,iBAAiB,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,oBAAoB,GAAAH,UAAA,CAAA,CAAA,CAAA,CAAA;;AAE9C;AACAI,EAAAA,SAAS,CAAC,YAAM;IACf,IAAI,OAAOC,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,MAAM,IAAID,MAAM,CAACC,MAAM,CAACC,IAAI,IAAIF,MAAM,CAACC,MAAM,CAACC,IAAI,CAACC,GAAG,EAAE;AACnGC,MAAAA,OAAO,CAACC,GAAG,CAAC,4BAA4B,CAAC,CAAA;MACzCP,oBAAoB,CAAC,IAAI,CAAC,CAAA;AAC1B,MAAA,OAAA;AACD,KAAA;AAEAM,IAAAA,OAAO,CAACC,GAAG,CAAC,oCAAoC,CAAC,CAAA;IACjD,IAAIC,QAAQ,GAAG,CAAC,CAAA;AAChB,IAAA,IAAMC,WAAW,GAAG,EAAE,CAAC;;AAEvB;AACA,IAAA,IAAMC,aAAa,GAAGC,WAAW,CAAC,YAAM;AACvCH,MAAAA,QAAQ,EAAE,CAAA;MACV,IAAI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map-container.js","sources":["../../../../src/components/containers/maps/map-container.js"],"sourcesContent":["\"use client\";\n\nimport React, { useEffect, useRef, useState } from \"react\";\n\nimport MapMarker from \"~/components/containers/maps/map-marker-container\";\nimport PlaceMarker from \"~/components/modules/maps/place-marker\";\n\nimport { usePlaces } from \"~/contexts/placesContext\";\nimport { useMap } from \"~/contexts/mapContext\";\nimport { useMapList } from \"~/contexts/mapListContext\";\n\nimport { markerIconSelected, markerIcon, pinIcon } from \"~/util/mapIconUtil\";\n\nimport Map from \"~/components/modules/maps/map\";\nimport { MarkerClustererF, Marker } from \"@react-google-maps/api\";\nimport { clusterOptions } from \"~/util/mapUtil\";\nimport { BallTriangle } from 'react-loader-spinner';\n\nconst MapContainer = ({ markerConfigs, infoWindowClasses, clusterGridSize = 60 }) => {\n\tconst [isGoogleMapsReady, setIsGoogleMapsReady] = useState(false);\n\n\t// Check if Google Maps is loaded\n\tuseEffect(() => {\n\t\tif (typeof window !== 'undefined' && window.google && window.google.maps && window.google.maps.Map) {\n\t\t\tconsole.log('Google Maps already loaded');\n\t\t\tsetIsGoogleMapsReady(true);\n\t\t\treturn;\n\t\t}\n\n\t\tconsole.log('Waiting for Google Maps to load...');\n\t\tlet attempts = 0;\n\t\tconst maxAttempts = 50; // 5 seconds max\n\t\t\n\t\t// Poll for Google Maps to become available\n\t\tconst checkInterval = setInterval(() => {\n\t\t\tattempts++;\n\t\t\tif (typeof window !== 'undefined' && window.google && window.google.maps && window.google.maps.Map) {\n\t\t\t\tconsole.log('Google Maps loaded after', attempts * 100, 'ms');\n\t\t\t\tsetIsGoogleMapsReady(true);\n\t\t\t\tclearInterval(checkInterval);\n\t\t\t} else if (attempts >= maxAttempts) {\n\t\t\t\tconsole.error('Google Maps failed to load after 5 seconds');\n\t\t\t\tclearInterval(checkInterval);\n\t\t\t}\n\t\t}, 100);\n\n\t\treturn () => clearInterval(checkInterval);\n\t}, []);\n\n\tconst {\n\t\tlocation,\n\t\tzoom,\n\t\tcenter,\n\t\tselectLocationEntity,\n\t\tsetLocation,\n\t\tmapInteracted,\n\t\tsetMapInteracted,\n\t\tdefaultZoomOverride\n\t} = useMap();\n\n\tconst {\n\t\tmapItems: oldMapItems,\n\t\tfilteredListings,\n\t\tselectedFilters,\n\t\tsetSelectedFilters,\n\t\tsetQuery,\n\t\tsiteConfig\n\t} = useMapList();\n\tconst [mapItems, setMapItems] = useState(null);\n\tconst [markersToHideFromBounds, setMarkersToHideFromBounds] = useState([]);\n\n\tconst mapRef = useRef();\n\tconst markerRefs = useRef({});\n\tconst mapContainerRef = useRef(null);\n\tconst {\n\t\tpoiMarkers,\n\t\tsetCurrentCenter,\n\t\tcurrentCenter,\n\t\tsetCurrentZoom,\n\t\tcurrentZoom,\n\t\tselectedPlaceMarker,\n\t\tsetSelectedPlaceMarker,\n\t\tplacesWindow,\n\t\tsetPlacesWindow,\n\t\tadditionalMapMarkers\n\t} = usePlaces();\n\n\tconst onIdle = () => {\n\t\tif (!currentCenter || !mapRef.current) return;\n\t\tconst newCenter = mapRef.current.getCenter().toJSON();\n\t\tconst newZoom = mapRef.current.zoom;\n\t\tsetCurrentCenter(newCenter);\n\n\t\tif (newZoom !== currentZoom) {\n\t\t\tsetCurrentZoom(newZoom);\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tif (!oldMapItems || oldMapItems.length === 0) return;\n\n\t\tif (!siteConfig.defaultMapState || mapInteracted || selectedFilters?.state || selectedFilters?.city) {\n\t\t\tsetMapItems(oldMapItems);\n\t\t\tsetMarkersToHideFromBounds([]);\n\t\t\treturn;\n\t\t}\n\n\t\tconst markersToHide = oldMapItems\n\t\t\t.filter(x => x.address.state !== siteConfig.defaultMapState)\n\t\t\t.map(item => item.id);\n\n\t\tsetMarkersToHideFromBounds(markersToHide);\n\t\tsetMapItems(oldMapItems);\n\t}, [oldMapItems, selectedFilters, siteConfig, mapInteracted]);\n\n\tuseEffect(() => {\n\t\tif (mapContainerRef.current) {\n\t\t\tconst handleScroll = () => {\n\t\t\t\tsetMapInteracted(true);\n\t\t\t};\n\t\t\tvar mapContainerRefCurrent = mapContainerRef.current;\n\t\t\tmapContainerRef.current.addEventListener(\"wheel\", handleScroll);\n\t\t\treturn () => mapContainerRefCurrent.removeEventListener(\"wheel\", handleScroll);\n\t\t}\n\t}, [mapContainerRef.current]);\n\n\tuseEffect(() => {\n\t\tif (mapRef.current && defaultZoomOverride && !mapInteracted && !location) {\n\t\t\tmapRef.current.setZoom(defaultZoomOverride);\n\t\t}\n\t}, [mapInteracted]);\n\n\tuseEffect(() => {\n\t\tif (mapRef.current) {\n\t\t\tconst mapInstance = mapRef.current;\n\t\t\tconst dragStartListener = mapInstance.addListener(\"dragstart\", () => {\n\t\t\t\tsetMapInteracted(true);\n\t\t\t\tsetMarkersToHideFromBounds([]);\n\t\t\t});\n\t\t\tconst mouseDownListener = mapInstance.addListener(\"mousedown\", () => {\n\t\t\t\tsetMapInteracted(true);\n\t\t\t\tsetMarkersToHideFromBounds([]);\n\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tgoogle.maps.event.removeListener(dragStartListener);\n\t\t\t\tgoogle.maps.event.removeListener(mouseDownListener);\n\t\t\t};\n\t\t}\n\t}, [mapRef.current, mapContainerRef.current]);\n\n\tuseEffect(() => {\n\t\tif (((mapItems && mapItems.length > 0) || poiMarkers.length > 0) && mapRef.current && !mapInteracted) {\n\t\t\tfitBounds(mapRef.current);\n\t\t}\n\t}, [mapItems, mapRef.current, location]);\n\n\tuseEffect(() => {\n\t\tif (((mapItems && mapItems.length > 0) || poiMarkers.length > 0) && mapRef.current && !mapInteracted) {\n\t\t\tfitBounds(mapRef.current, true);\n\t\t}\n\t\tif (mapRef.current && !mapInteracted) {\n\t\t\tconst jobPinZoomLevel = siteConfig?.jobPinZoomLevel ?? 12;\n\t\t\tconst currZoom = mapRef.current.zoom;\n\t\t\tconst setZoomVal = currZoom < (jobPinZoomLevel + 1) ? currZoom : jobPinZoomLevel;\n\t\t\tmapRef.current.setZoom(setZoomVal);\n\t\t}\n\t}, [filteredListings, siteConfig]);\n\n\tuseEffect(() => {\n\t\tif (!mapRef.current || !location || mapInteracted) return;\n\t\tconst jobPinZoomLevel = siteConfig?.jobPinZoomLevel ?? 12;\n\t\tmapRef.current.panTo(new google.maps.LatLng(location.latitude, location.longitude));\n\t\tif (mapRef.current) {\n\t\t\tconst setZoomVal = zoom < (jobPinZoomLevel + 1) ? zoom : jobPinZoomLevel;\n\t\t\tmapRef.current.setZoom(setZoomVal);\n\t\t}\n\t}, [location, zoom, siteConfig]);\n\n\tconst fitBounds = (map, overload = false) => {\n\t\tif ((mapInteracted === false || overload) && mapItems != null) {\n\t\t\tif (typeof window === 'undefined' || !window.google) return;\n\t\t\tconst bounds = new window.google.maps.LatLngBounds();\n\n\t\t\tmapItems.forEach(item => {\n\t\t\t\tif (!mapInteracted && markersToHideFromBounds.includes(item.id)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tbounds.extend(new google.maps.LatLng(item.latitude, item.longitude));\n\t\t\t});\n\n\t\t\tif (siteConfig.optionalShowLocationClusterConfig) {\n\t\t\t\tconst configLocation = new google.maps.LatLng(\n\t\t\t\t\tsiteConfig.optionalShowLocationClusterConfig.latitude,\n\t\t\t\t\tsiteConfig.optionalShowLocationClusterConfig.longitude\n\t\t\t\t);\n\t\t\t\tmap.panTo(configLocation);\n\t\t\t\tbounds.extend(\n\t\t\t\t\tnew google.maps.LatLng(\n\t\t\t\t\t\tsiteConfig.optionalShowLocationClusterConfig.latitude,\n\t\t\t\t\t\tsiteConfig.optionalShowLocationClusterConfig.longitude\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (!map) return;\n\t\t\tconst currentCenter = map.getCenter();\n\t\t\tmap.fitBounds(bounds);\n\t\t\tconst newCenter = bounds.getCenter();\n\t\t\tif (currentCenter && newCenter) {\n\t\t\t\tmap.panTo(newCenter);\n\t\t\t}\n\t\t}\n\t\tif (defaultZoomOverride && !mapInteracted && !location) {\n\t\t\tmapRef.current.setZoom(defaultZoomOverride);\n\t\t} else if (mapRef.current.zoom > 17) {\n\t\t\tmapRef.current.setZoom(16);\n\t\t}\n\t};\n\n\tconst markerClickHandler = mapLocation => {\n\t\tsetMapInteracted(true);\n\t\tsetMarkersToHideFromBounds([]);\n\t\tselectLocationEntity(mapLocation);\n\t\tconst jobPinZoomLevel = siteConfig?.jobPinZoomLevel;\n\t\tif (jobPinZoomLevel !== undefined && mapRef.current) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (mapRef.current) {\n\t\t\t\t\tmapRef.current.panTo(new google.maps.LatLng(mapLocation.latitude, mapLocation.longitude));\n\t\t\t\t\tmapRef.current.setZoom(jobPinZoomLevel);\n\t\t\t\t}\n\t\t\t}, 300);\n\t\t}\n\t};\n\n\tconst onLoad = map => {\n\t\tif (!location || location === null) {\n\t\t\tmapRef.current = map;\n\t\t\tfitBounds(map, true);\n\t\t\treturn;\n\t\t}\n\t\tmapRef.current = map;\n\n\t\tif (mapInteracted === false) {\n\t\t\tmapRef.current.panTo(new google.maps.LatLng(location.latitude, location.longitude));\n\n\t\t\tmapRef.current.setZoom(zoom);\n\t\t}\n\t};\n\n\tconst pinIconUrl = pinIcon({\n\t\tfillColor: markerConfigs.fillColor,\n\t\tstrokeColor: markerConfigs.strokeColor\n\t});\n\n\tconst onClusterClick = cluster => {\n\t\tif (\n\t\t\t!siteConfig.optionalShowLocationClusterConfig ||\n mapRef.current.zoom > siteConfig.optionalShowLocationClusterConfig.showForZoomLevelLessThan\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!cluster || typeof cluster.getMarkers !== \"function\") {\n\t\t\tconsole.error(\"Cluster object or getMarkers method not available.\");\n\t\t\treturn;\n\t\t}\n\n\t\tconst markers = cluster.getMarkers();\n\n\t\tif (!markers || markers.length === 0) {\n\t\t\tconsole.error(\"No markers found in the cluster.\");\n\t\t\treturn;\n\t\t}\n\n\t\tsetTimeout(() => {\n\t\t\tif (typeof window === 'undefined' || !window.google) return;\n\t\t\tconst bounds = new window.google.maps.LatLngBounds();\n\n\t\t\tmarkers.forEach(marker => {\n\t\t\t\tbounds.extend(marker.getPosition());\n\t\t\t});\n\t\t\tconst clusterCenter = bounds.getCenter();\n\n\t\t\tconst configLat = siteConfig.optionalShowLocationClusterConfig.latitude;\n\t\t\tconst configLng = siteConfig.optionalShowLocationClusterConfig.longitude;\n\n\t\t\tconst latDiff = clusterCenter.lat() - configLat;\n\t\t\tconst lngDiff = clusterCenter.lng() - configLng;\n\t\t\tconst distance = Math.sqrt(latDiff * latDiff + lngDiff * lngDiff);\n\n\t\t\tconst distanceThreshold = 1;\n\t\t\tif (distance <= distanceThreshold) {\n\t\t\t\tbounds.extend(new google.maps.LatLng(configLat, configLng));\n\t\t\t}\n\n\t\t\tif (mapRef.current) {\n\t\t\t\tmapRef.current.fitBounds(bounds);\n\t\t\t}\n\t\t}, 300);\n\t};\n\tif (!isGoogleMapsReady) {\n\t\treturn (\n\t\t\t<div className=\"hc-w-full hc-h-full hc-bg-gray-100 hc-flex hc-items-center hc-justify-center hc-min-h-[400px]\">\n\t\t\t\t<BallTriangle\n\t\t\t\t\theight={80}\n\t\t\t\t\twidth={80}\n\t\t\t\t\tradius={5}\n\t\t\t\t\tcolor=\"#2563eb\"\n\t\t\t\t\tariaLabel=\"ball-triangle-loading\"\n\t\t\t\t\twrapperStyle={{}}\n\t\t\t\t\twrapperClass=\"\"\n\t\t\t\t\tvisible={true}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Ensure mapItems is an array\n\tconst mapItemsArray = Array.isArray(mapItems) ? mapItems : [];\n\t\n\tif (!mapItemsArray || mapItemsArray.length === 0) {\n\t\treturn (\n\t\t\t<div className=\"hc-w-full hc-h-full hc-bg-gray-100 hc-flex hc-items-center hc-justify-center\">\n\t\t\t\t<div className=\"hc-text-gray-600\">No locations to display</div>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst mapItemsKey = mapItemsArray.map(item => item.id).join(\"-\");\n\n\n\treturn (\n\t\t<Map\n\t\t\tzoom={zoom}\n\t\t\tcenter={center}\n\t\t\tmapContainerRef={mapContainerRef}\n\t\t\tonLoad={onLoad}\n\t\t\tonIdle={onIdle}\n\t\t\tmapInteracted={mapInteracted}\n\t\t\tpinIconUrl={pinIconUrl}\n\t\t\tsetMapInteracted={setMapInteracted}\n\t\t\tfitBounds={fitBounds}\n\t\t\tmapRef={mapRef}\n\t\t\tsetQuery={setQuery}\n\t\t\tfilteredListingsLength={filteredListings.length}\n\t\t\tsetSelectedFilters={setSelectedFilters}\n\t\t>\n\t\t\t<MarkerClustererF\n\t\t\t\tkey={mapItemsKey}\n\t\t\t\tcalculator={markers => {\n\t\t\t\t\tconst totalCount = markers.reduce((sum, marker) => sum + (marker.get(\"count\") || 1), 0);\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttext: totalCount.toString(),\n\t\t\t\t\t\tindex: Math.min(5, Math.floor(totalCount / 10))\n\t\t\t\t\t};\n\t\t\t\t}}\n\t\t\t\toptions={{\n\t\t\t\t\t...clusterOptions(clusterGridSize, markerConfigs.fillColor)\n\t\t\t\t}}\n\t\t\t\tonClick={onClusterClick}\n\t\t\t>\n\t\t\t\t{clusterer => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{mapItemsArray.map(item => {\n\t\t\t\t\t\t\tconst markerCount = Object.values(item.items).length;\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<MapMarker\n\t\t\t\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t\t\t\titem={item}\n\t\t\t\t\t\t\t\t\tselectedLocation={location}\n\t\t\t\t\t\t\t\t\tmarkerRefs={markerRefs}\n\t\t\t\t\t\t\t\t\tinfoWindowClasses={infoWindowClasses}\n\t\t\t\t\t\t\t\t\tsetSelectedLocation={setLocation}\n\t\t\t\t\t\t\t\t\tmarkerClickHandler={markerClickHandler}\n\t\t\t\t\t\t\t\t\tclusterer={clusterer}\n\t\t\t\t\t\t\t\t\tmarkerIcon={markerIcon(markerConfigs, markerCount)}\n\t\t\t\t\t\t\t\t\tmarkerIconSelected={markerIconSelected(markerConfigs, markerCount)}\n\t\t\t\t\t\t\t\t\tsetMapInteracted={setMapInteracted}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\n\t\t\t\t\t\t{additionalMapMarkers &&\n additionalMapMarkers.map(\n \t(marker, index) =>\n \t\tcurrentZoom >= marker.minZoom &&\n currentZoom <= marker.maxZoom && (\n \t\t\t<Marker\n \t\t\t\tkey={`marker-${marker.title}-${index}`}\n \t\t\t\tposition={marker.position}\n \t\t\t\ttitle={marker.title}\n \t\t\t\ticon={{\n \t\t\t\t\turl: marker.iconUrl,\n \t\t\t\t\tscaledSize: new window.google.maps.Size(40, 40)\n \t\t\t\t}}\n \t\t\t/>\n \t\t)\n )}\n\n\t\t\t\t\t\t{poiMarkers &&\n poiMarkers.markers.map((marker, index) => (\n \t<PlaceMarker\n \t\tkey={`marker-${marker.title}-${index}`}\n \t\tmarker={marker}\n \t\tindex={index}\n \t\tselectedPlaceMarker={selectedPlaceMarker}\n \t\tplacesWindow={placesWindow}\n \t\tsetPlacesWindow={setPlacesWindow}\n \t\tsetSelectedPlaceMarker={setSelectedPlaceMarker}\n \t/>\n ))}\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</MarkerClustererF>\n\t\t</Map>\n\t);\n};\n\nexport default MapContainer;\n\n"],"names":["MapContainer","_ref","markerConfigs","infoWindowClasses","_ref$clusterGridSize","clusterGridSize","_useState","useState","_useState2","_slicedToArray","isGoogleMapsReady","setIsGoogleMapsReady","useEffect","window","google","maps","Map","console","log","attempts","maxAttempts","checkInterval","setInterval","clearInterval","error","_useMap","useMap","location","zoom","center","selectLocationEntity","setLocation","mapInteracted","setMapInteracted","defaultZoomOverride","_useMapList","useMapList","oldMapItems","mapItems","filteredListings","selectedFilters","setSelectedFilters","setQuery","siteConfig","_useState3","_useState4","setMapItems","_useState5","_useState6","markersToHideFromBounds","setMarkersToHideFromBounds","mapRef","useRef","markerRefs","mapContainerRef","_usePlaces","usePlaces","poiMarkers","setCurrentCenter","currentCenter","setCurrentZoom","currentZoom","selectedPlaceMarker","setSelectedPlaceMarker","placesWindow","setPlacesWindow","additionalMapMarkers","onIdle","current","newCenter","getCenter","toJSON","newZoom","length","defaultMapState","state","city","markersToHide","filter","x","address","map","item","id","handleScroll","mapContainerRefCurrent","addEventListener","removeEventListener","setZoom","mapInstance","dragStartListener","addListener","mouseDownListener","event","removeListener","fitBounds","_siteConfig$jobPinZoo","jobPinZoomLevel","currZoom","setZoomVal","_siteConfig$jobPinZoo2","panTo","LatLng","latitude","longitude","overload","arguments","undefined","bounds","LatLngBounds","forEach","includes","extend","optionalShowLocationClusterConfig","configLocation","markerClickHandler","mapLocation","setTimeout","onLoad","pinIconUrl","pinIcon","fillColor","strokeColor","onClusterClick","cluster","showForZoomLevelLessThan","getMarkers","markers","marker","getPosition","clusterCenter","configLat","configLng","latDiff","lat","lngDiff","lng","distance","Math","sqrt","distanceThreshold","React","createElement","className","BallTriangle","height","width","radius","color","ariaLabel","wrapperStyle","wrapperClass","visible","mapItemsArray","Array","isArray","mapItemsKey","join","filteredListingsLength","MarkerClustererF","key","calculator","totalCount","reduce","sum","get","text","toString","index","min","floor","options","_objectSpread","clusterOptions","onClick","clusterer","Fragment","markerCount","Object","values","items","MapMarker","selectedLocation","setSelectedLocation","markerIcon","markerIconSelected","minZoom","maxZoom","Marker","concat","title","position","icon","url","iconUrl","scaledSize","Size","PlaceMarker"],"mappings":";;;;;;;;;;;;;AAkBA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAAmE;AAAA,EAAA,IAA7DC,aAAa,GAAAD,IAAA,CAAbC,aAAa;IAAEC,iBAAiB,GAAAF,IAAA,CAAjBE,iBAAiB;IAAAC,oBAAA,GAAAH,IAAA,CAAEI,eAAe;AAAfA,IAAAA,eAAe,GAAAD,o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CAACC,IAAI,CAACqL,IAAI,CAAC,EAAE,EAAE,EAAE,CAAA;AAC/C,SAAA;AAAE,OACF,CACD,CAAA;AAAA,KACH,CAAC,EAER3I,UAAU,IACHA,UAAU,CAACsE,OAAO,CAAC9C,GAAG,CAAC,UAAC+C,MAAM,EAAEwC,KAAK,EAAA;AAAA,MAAA,oBACpC3B,KAAA,CAAAC,aAAA,CAACuD,WAAW,EAAA;QACXrC,GAAG,EAAA,SAAA,CAAA6B,MAAA,CAAY7D,MAAM,CAAC8D,KAAK,EAAAD,GAAAA,CAAAA,CAAAA,MAAA,CAAIrB,KAAK,CAAG;AACvCxC,QAAAA,MAAM,EAAEA,MAAO;AACfwC,QAAAA,KAAK,EAAEA,KAAM;AACb1G,QAAAA,mBAAmB,EAAEA,mBAAoB;AACzCE,QAAAA,YAAY,EAAEA,YAAa;AAC3BC,QAAAA,eAAe,EAAEA,eAAgB;AACjCF,QAAAA,sBAAsB,EAAEA,sBAAAA;AAAuB,OAC/C,CAAC,CAAA;AAAA,KACF,CACR,CAAC,CAAA;AAAA,GAEa,CACd,CAAC,CAAA;AAER;;;;"}
|
|
@@ -13,7 +13,9 @@ var PlacesProvider = function PlacesProvider(_ref) {
|
|
|
13
13
|
placeMappings = _ref.placeMappings,
|
|
14
14
|
markerColors = _ref.markerColors,
|
|
15
15
|
additionalMapMarkers = _ref.additionalMapMarkers,
|
|
16
|
-
googleMapsApiKey = _ref.googleMapsApiKey
|
|
16
|
+
googleMapsApiKey = _ref.googleMapsApiKey,
|
|
17
|
+
_ref$showAtZoomLevel = _ref.showAtZoomLevel,
|
|
18
|
+
showAtZoomLevel = _ref$showAtZoomLevel === void 0 ? 12 : _ref$showAtZoomLevel;
|
|
17
19
|
var _useMap = useMap(),
|
|
18
20
|
selectedPlaces = _useMap.selectedPlaces,
|
|
19
21
|
zoom = _useMap.zoom,
|
|
@@ -52,7 +54,7 @@ var PlacesProvider = function PlacesProvider(_ref) {
|
|
|
52
54
|
return radius;
|
|
53
55
|
}, [currentZoom]);
|
|
54
56
|
useEffect(function () {
|
|
55
|
-
if (!selectedPlaces ||
|
|
57
|
+
if (!selectedPlaces || selectedPlaces.length === 0 || !center || currentZoom < showAtZoomLevel) {
|
|
56
58
|
setPoiMarkers({
|
|
57
59
|
markers: [],
|
|
58
60
|
icon: null
|
|
@@ -134,7 +136,7 @@ var PlacesProvider = function PlacesProvider(_ref) {
|
|
|
134
136
|
};
|
|
135
137
|
}();
|
|
136
138
|
fetchPlaces();
|
|
137
|
-
}, [selectedPlaces, currentZoom, currentCenter, placeMappings, markerColors.placeMarkers, googleMapsApiKey, getRadiusForZoom, center]);
|
|
139
|
+
}, [selectedPlaces, currentZoom, currentCenter, placeMappings, markerColors.placeMarkers, googleMapsApiKey, getRadiusForZoom, center, showAtZoomLevel]);
|
|
138
140
|
return /*#__PURE__*/React.createElement(PlacesContext.Provider, {
|
|
139
141
|
value: {
|
|
140
142
|
poiMarkers: poiMarkers,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"placesContext.js","sources":["../../src/contexts/placesContext.js"],"sourcesContent":["import React, { createContext, useContext, useEffect, useState, useCallback } from 'react';\n\nimport { markerIconProps } from '~/util/mapIconUtil';\n\nimport { useMap } from '~/contexts/mapContext';\n\nimport { searchNearbyPlaces } from '~/services/googlePlacesNearbyService';\n\nconst PlacesContext = createContext();\n\nexport const usePlaces = () => useContext(PlacesContext);\n\nexport const PlacesProvider = ({ children, placeMappings, markerColors, additionalMapMarkers, googleMapsApiKey }) => {\n\tconst { selectedPlaces, zoom, center } = useMap();\n\tconst [poiMarkers, setPoiMarkers] = useState({ markers: [], icon: null });\n\tconst [currentCenter, setCurrentCenter] = useState(center);\n\tconst [currentZoom, setCurrentZoom] = useState(zoom);\n\tconst [placesWindow, setPlacesWindow] = useState(false);\n\tconst [selectedPlaceMarker, setSelectedPlaceMarker] = useState(null);\n\n\tconst getRadiusForZoom = useCallback(() => {\n\t\tif (currentZoom >= 18) return 1000;\n\t\tif (currentZoom <= 10) return 0;\n\n\t\tlet tempZoom = Math.pow(19 - currentZoom, 4.85);\n\t\tlet radius = tempZoom;\n\t\tlet minRadius = 1500;\n\t\tlet maxRadius = 800000;\n\n\t\tif (radius < minRadius) radius = minRadius;\n\t\telse if (radius > maxRadius) radius = maxRadius;\n\n\t\treturn radius;\n\t}, [currentZoom]);\n\n\tuseEffect(() => {\n\t\tif (!selectedPlaces || (!selectedPlaces.length > 0) || !center || currentZoom < 12) {\n\t\t\tsetPoiMarkers({ markers: [], icon: null });\n\t\t\treturn;\n\t\t}\n\t\tconst fetchPlaces = async () => {\n\t\t\tlet poiTypes = [];\n\t\t\tconst selectedPOICategories = selectedPlaces;\n\t\t\tselectedPOICategories.forEach(pointOfInterest => {\n\t\t\t\tpoiTypes = poiTypes.concat(placeMappings[pointOfInterest]);\n\t\t\t});\n\n\t\t\tconst radius = getRadiusForZoom();\n\t\t\tconst location = { latitude: currentCenter.lat, longitude: currentCenter.lng };\n\n\t\t\ttry {\n\t\t\t\tconst response = await searchNearbyPlaces(poiTypes, location, radius, googleMapsApiKey || process.env.GOOGLE_MAPS_API_KEY);\n\t\t\t\tconst newMarkers = response.places.map(place => {\n\t\t\t\t\tconst getParentCategory = types => {\n\t\t\t\t\t\tconst selectedTypes = selectedPOICategories.reduce((acc, category) => {\n\t\t\t\t\t\t\treturn acc.concat(placeMappings[category]);\n\t\t\t\t\t\t}, []);\n\n\t\t\t\t\t\tfor (const type of types) {\n\t\t\t\t\t\t\tif (!selectedTypes.includes(type)) continue;\n\t\t\t\t\t\t\tfor (const category in placeMappings) {\n\t\t\t\t\t\t\t\tif (placeMappings[category].includes(type)) {\n\t\t\t\t\t\t\t\t\treturn category;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\tconst icon = markerIconProps(markerColors.placeMarkers, getParentCategory(place.types));\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tposition: { lat: place.location.latitude, lng: place.location.longitude },\n\t\t\t\t\t\ttitle: place.displayName.text,\n\t\t\t\t\t\ticon: icon\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t\tsetPoiMarkers({ markers: newMarkers, icon: null });\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Failed to fetch places:', error);\n\t\t\t}\n\t\t};\n\n\t\tfetchPlaces();\n\t}, [selectedPlaces, currentZoom, currentCenter, placeMappings, markerColors.placeMarkers, googleMapsApiKey, getRadiusForZoom, center]);\n\n\treturn (\n\t\t<PlacesContext.Provider value={{\n\t\t\tpoiMarkers,\n\t\t\tsetCurrentCenter,\n\t\t\tcurrentCenter,\n\t\t\tsetCurrentZoom,\n\t\t\tcurrentZoom,\n\t\t\tplacesWindow,\n\t\t\tsetPlacesWindow,\n\t\t\tselectedPlaceMarker,\n\t\t\tsetSelectedPlaceMarker,\n\t\t\tadditionalMapMarkers\n\t\t}}>\n\t\t\t{children}\n\t\t</PlacesContext.Provider>\n\t);\n};\n"],"names":["PlacesContext","createContext","usePlaces","useContext","PlacesProvider","_ref","children","placeMappings","markerColors","additionalMapMarkers","googleMapsApiKey","_useMap","useMap","selectedPlaces","zoom","center","_useState","useState","markers","icon","_useState2","_slicedToArray","poiMarkers","setPoiMarkers","_useState3","_useState4","currentCenter","setCurrentCenter","_useState5","_useState6","currentZoom","setCurrentZoom","_useState7","_useState8","placesWindow","setPlacesWindow","_useState9","_useState10","selectedPlaceMarker","setSelectedPlaceMarker","getRadiusForZoom","useCallback","tempZoom","Math","pow","radius","minRadius","maxRadius","useEffect","length","fetchPlaces","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","poiTypes","selectedPOICategories","location","response","newMarkers","wrap","_callee$","_context","prev","next","forEach","pointOfInterest","concat","latitude","lat","longitude","lng","searchNearbyPlaces","process","env","GOOGLE_MAPS_API_KEY","sent","places","map","place","getParentCategory","types","selectedTypes","reduce","acc","category","_iterator","_createForOfIteratorHelper","_step","s","n","done","type","value","includes","err","e","f","markerIconProps","placeMarkers","position","title","displayName","text","t0","console","error","stop","apply","arguments","React","createElement","Provider"],"mappings":";;;;;;AAQA,IAAMA,aAAa,gBAAGC,aAAa,EAAE,CAAA;AAExBC,IAAAA,SAAS,GAAG,SAAZA,SAASA,GAAA;EAAA,OAASC,UAAU,CAACH,aAAa,CAAC,CAAA;AAAA,EAAA;IAE3CI,cAAc,GAAG,SAAjBA,cAAcA,CAAAC,IAAA,EAA0F;AAAA,EAAA,IAApFC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,aAAa,GAAAF,IAAA,CAAbE,aAAa;IAAEC,YAAY,GAAAH,IAAA,CAAZG,YAAY;IAAEC,oBAAoB,GAAAJ,IAAA,CAApBI,oBAAoB;IAAEC,gBAAgB,GAAAL,IAAA,CAAhBK,gBAAgB,CAAA;AAC7G,EAAA,IAAAC,OAAA,GAAyCC,MAAM,EAAE;IAAzCC,cAAc,GAAAF,OAAA,CAAdE,cAAc;IAAEC,IAAI,GAAAH,OAAA,CAAJG,IAAI;IAAEC,MAAM,GAAAJ,OAAA,CAANI,MAAM,CAAA;EACpC,IAAAC,SAAA,GAAoCC,QAAQ,CAAC;AAAEC,MAAAA,OAAO,EAAE,EAAE;AAAEC,MAAAA,IAAI,EAAE,IAAA;AAAK,KAAC,CAAC;IAAAC,UAAA,GAAAC,cAAA,CAAAL,SAAA,EAAA,CAAA,CAAA;AAAlEM,IAAAA,UAAU,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,aAAa,GAAAH,UAAA,CAAA,CAAA,CAAA,CAAA;AAChC,EAAA,IAAAI,UAAA,GAA0CP,QAAQ,CAACF,MAAM,CAAC;IAAAU,UAAA,GAAAJ,cAAA,CAAAG,UAAA,EAAA,CAAA,CAAA;AAAnDE,IAAAA,aAAa,GAAAD,UAAA,CAAA,CAAA,CAAA;AAAEE,IAAAA,gBAAgB,GAAAF,UAAA,CAAA,CAAA,CAAA,CAAA;AACtC,EAAA,I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CAAA;OAEjD,CAAA,CAAA,CAAA;AAAA,MAAA,OAAA,SAzCKL,WAAWA,GAAA;AAAA,QAAA,OAAAC,KAAA,CAAA0D,KAAA,CAAA,IAAA,EAAAC,SAAA,CAAA,CAAA;AAAA,OAAA,CAAA;KAyChB,EAAA,CAAA;AAED5D,IAAAA,WAAW,EAAE,CAAA;GACb,EAAE,CAACrC,cAAc,EAAEiB,WAAW,EAAEJ,aAAa,EAAEnB,aAAa,EAAEC,YAAY,CAAC4F,YAAY,EAAE1F,gBAAgB,EAAE8B,gBAAgB,EAAEzB,MAAM,CAAC,CAAC,CAAA;AAEtI,EAAA,oBACCgG,KAAA,CAAAC,aAAA,CAAChH,aAAa,CAACiH,QAAQ,EAAA;AAACnB,IAAAA,KAAK,EAAE;AAC9BxE,MAAAA,UAAU,EAAVA,UAAU;AACVK,MAAAA,gBAAgB,EAAhBA,gBAAgB;AAChBD,MAAAA,aAAa,EAAbA,aAAa;AACbK,MAAAA,cAAc,EAAdA,cAAc;AACdD,MAAAA,WAAW,EAAXA,WAAW;AACXI,MAAAA,YAAY,EAAZA,YAAY;AACZC,MAAAA,eAAe,EAAfA,eAAe;AACfG,MAAAA,mBAAmB,EAAnBA,mBAAmB;AACnBC,MAAAA,sBAAsB,EAAtBA,sBAAsB;AACtB9B,MAAAA,oBAAoB,EAApBA,oBAAAA;AACD,KAAA;AAAE,GAAA,EACAH,QACsB,CAAC,CAAA;AAE3B;;;;"}
|
|
1
|
+
{"version":3,"file":"placesContext.js","sources":["../../src/contexts/placesContext.js"],"sourcesContent":["import React, { createContext, useContext, useEffect, useState, useCallback } from 'react';\n\nimport { markerIconProps } from '~/util/mapIconUtil';\n\nimport { useMap } from '~/contexts/mapContext';\n\nimport { searchNearbyPlaces } from '~/services/googlePlacesNearbyService';\n\nconst PlacesContext = createContext();\n\nexport const usePlaces = () => useContext(PlacesContext);\n\nexport const PlacesProvider = ({ children, placeMappings, markerColors, additionalMapMarkers, googleMapsApiKey, showAtZoomLevel = 12 }) => {\n\tconst { selectedPlaces, zoom, center } = useMap();\n\tconst [poiMarkers, setPoiMarkers] = useState({ markers: [], icon: null });\n\tconst [currentCenter, setCurrentCenter] = useState(center);\n\tconst [currentZoom, setCurrentZoom] = useState(zoom);\n\tconst [placesWindow, setPlacesWindow] = useState(false);\n\tconst [selectedPlaceMarker, setSelectedPlaceMarker] = useState(null);\n\n\tconst getRadiusForZoom = useCallback(() => {\n\t\tif (currentZoom >= 18) return 1000;\n\t\tif (currentZoom <= 10) return 0;\n\n\t\tlet tempZoom = Math.pow(19 - currentZoom, 4.85);\n\t\tlet radius = tempZoom;\n\t\tlet minRadius = 1500;\n\t\tlet maxRadius = 800000;\n\n\t\tif (radius < minRadius) radius = minRadius;\n\t\telse if (radius > maxRadius) radius = maxRadius;\n\n\t\treturn radius;\n\t}, [currentZoom]);\n\n\tuseEffect(() => {\n\t\tif (!selectedPlaces || selectedPlaces.length === 0 || !center || currentZoom < showAtZoomLevel) {\n\t\t\tsetPoiMarkers({ markers: [], icon: null });\n\t\t\treturn;\n\t\t}\n\t\tconst fetchPlaces = async () => {\n\t\t\tlet poiTypes = [];\n\t\t\tconst selectedPOICategories = selectedPlaces;\n\t\t\tselectedPOICategories.forEach(pointOfInterest => {\n\t\t\t\tpoiTypes = poiTypes.concat(placeMappings[pointOfInterest]);\n\t\t\t});\n\n\t\t\tconst radius = getRadiusForZoom();\n\t\t\tconst location = { latitude: currentCenter.lat, longitude: currentCenter.lng };\n\n\t\t\ttry {\n\t\t\t\tconst response = await searchNearbyPlaces(poiTypes, location, radius, googleMapsApiKey || process.env.GOOGLE_MAPS_API_KEY);\n\t\t\t\tconst newMarkers = response.places.map(place => {\n\t\t\t\t\tconst getParentCategory = types => {\n\t\t\t\t\t\tconst selectedTypes = selectedPOICategories.reduce((acc, category) => {\n\t\t\t\t\t\t\treturn acc.concat(placeMappings[category]);\n\t\t\t\t\t\t}, []);\n\n\t\t\t\t\t\tfor (const type of types) {\n\t\t\t\t\t\t\tif (!selectedTypes.includes(type)) continue;\n\t\t\t\t\t\t\tfor (const category in placeMappings) {\n\t\t\t\t\t\t\t\tif (placeMappings[category].includes(type)) {\n\t\t\t\t\t\t\t\t\treturn category;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\tconst icon = markerIconProps(markerColors.placeMarkers, getParentCategory(place.types));\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tposition: { lat: place.location.latitude, lng: place.location.longitude },\n\t\t\t\t\t\ttitle: place.displayName.text,\n\t\t\t\t\t\ticon: icon\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t\tsetPoiMarkers({ markers: newMarkers, icon: null });\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('Failed to fetch places:', error);\n\t\t\t}\n\t\t};\n\n\t\tfetchPlaces();\n\t}, [selectedPlaces, currentZoom, currentCenter, placeMappings, markerColors.placeMarkers, googleMapsApiKey, getRadiusForZoom, center, showAtZoomLevel]);\n\n\treturn (\n\t\t<PlacesContext.Provider value={{\n\t\t\tpoiMarkers,\n\t\t\tsetCurrentCenter,\n\t\t\tcurrentCenter,\n\t\t\tsetCurrentZoom,\n\t\t\tcurrentZoom,\n\t\t\tplacesWindow,\n\t\t\tsetPlacesWindow,\n\t\t\tselectedPlaceMarker,\n\t\t\tsetSelectedPlaceMarker,\n\t\t\tadditionalMapMarkers\n\t\t}}>\n\t\t\t{children}\n\t\t</PlacesContext.Provider>\n\t);\n};\n"],"names":["PlacesContext","createContext","usePlaces","useContext","PlacesProvider","_ref","children","placeMappings","markerColors","additionalMapMarkers","googleMapsApiKey","_ref$showAtZoomLevel","showAtZoomLevel","_useMap","useMap","selectedPlaces","zoom","center","_useState","useState","markers","icon","_useState2","_slicedToArray","poiMarkers","setPoiMarkers","_useState3","_useState4","currentCenter","setCurrentCenter","_useState5","_useState6","currentZoom","setCurrentZoom","_useState7","_useState8","placesWindow","setPlacesWindow","_useState9","_useState10","selectedPlaceMarker","setSelectedPlaceMarker","getRadiusForZoom","useCallback","tempZoom","Math","pow","radius","minRadius","maxRadius","useEffect","length","fetchPlaces","_ref2","_asyncToGenerator","_regeneratorRuntime","mark","_callee","poiTypes","selectedPOICategories","location","response","newMarkers","wrap","_callee$","_context","prev","next","forEach","pointOfInterest","concat","latitude","lat","longitude","lng","searchNearbyPlaces","process","env","GOOGLE_MAPS_API_KEY","sent","places","map","place","getParentCategory","types","selectedTypes","reduce","acc","category","_iterator","_createForOfIteratorHelper","_step","s","n","done","type","value","includes","err","e","f","markerIconProps","placeMarkers","position","title","displayName","text","t0","console","error","stop","apply","arguments","React","createElement","Provider"],"mappings":";;;;;;AAQA,IAAMA,aAAa,gBAAGC,aAAa,EAAE,CAAA;AAExBC,IAAAA,SAAS,GAAG,SAAZA,SAASA,GAAA;EAAA,OAASC,UAAU,CAACH,aAAa,CAAC,CAAA;AAAA,EAAA;IAE3CI,cAAc,GAAG,SAAjBA,cAAcA,CAAAC,IAAA,EAAgH;AAAA,EAAA,IAA1GC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,aAAa,GAAAF,IAAA,CAAbE,aAAa;IAAEC,YAAY,GAAAH,IAAA,CAAZG,YAAY;IAAEC,oBAAoB,GAAAJ,IAAA,CAApBI,oBAAoB;IAAEC,gBAAgB,GAAAL,IAAA,CAAhBK,gBAAgB;IAAAC,oBAAA,GAAAN,IAAA,CAAEO,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,oBAAA,CAAA;AACnI,EAAA,IAAAE,OAAA,GAAyCC,MAAM,EAAE;IAAzCC,cAAc,GAAAF,OAAA,CAAdE,cAAc;IAAEC,IAAI,GAAAH,OAAA,CAAJG,IAAI;IAAEC,MAAM,GAAAJ,OAAA,CAANI,MAAM,CAAA;EACpC,IAAAC,SAAA,GAAoCC,QAAQ,CAAC;AAAEC,MAAAA,OAAO,EAAE,E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B;AACnBC,MAAAA,sBAAsB,EAAtBA,sBAAsB;AACtBhC,MAAAA,oBAAoB,EAApBA,oBAAAA;AACD,KAAA;AAAE,GAAA,EACAH,QACsB,CAAC,CAAA;AAE3B;;;;"}
|
package/package.json
CHANGED
|
@@ -36,6 +36,7 @@ const ContextProviders = ({ children, siteConfig, trackEvent, googleMapsApiKey,
|
|
|
36
36
|
placeMappings={siteConfig.pointsOfInterestConfig.placeMappings ?? {}}
|
|
37
37
|
additionalMapMarkers={mapListProps.additionalMapMarkers}
|
|
38
38
|
googleMapsApiKey={googleMapsApiKey}
|
|
39
|
+
showAtZoomLevel={siteConfig.pointsOfInterestConfig.showAtZoomLevel ?? 12}
|
|
39
40
|
markerColors={{
|
|
40
41
|
fillColor: siteConfig.colors.primary,
|
|
41
42
|
strokeColor: siteConfig.colors.primaryDark,
|
|
@@ -15,9 +15,10 @@ const MapAccordionItemContainer = ({
|
|
|
15
15
|
specialFeatures,
|
|
16
16
|
isActive
|
|
17
17
|
}) => {
|
|
18
|
-
const { mapItems, recruiters } = useMapList();
|
|
18
|
+
const { mapItems, recruiters, siteConfig } = useMapList();
|
|
19
19
|
const { selectItem } = useMap();
|
|
20
20
|
const { trackEvent, eventTypes } = useTrackEvent();
|
|
21
|
+
const jobPinZoomLevel = siteConfig?.jobPinZoomLevel ?? 12;
|
|
21
22
|
|
|
22
23
|
const setSelectedItemAndZoomMap = (item, isActive) => {
|
|
23
24
|
if (isActive) {
|
|
@@ -32,7 +33,7 @@ const MapAccordionItemContainer = ({
|
|
|
32
33
|
console.log('the item in questions is',item);
|
|
33
34
|
const location = mapItems.find(x => x.entityKey?.toLowerCase() === item.fields.entityKey?.toLowerCase()) || null;
|
|
34
35
|
console.log('location is', location);
|
|
35
|
-
selectItem(item, location,
|
|
36
|
+
selectItem(item, location, jobPinZoomLevel, {
|
|
36
37
|
lat: location?.latitude,
|
|
37
38
|
lng: location?.longitude
|
|
38
39
|
});
|
|
@@ -12,10 +12,11 @@ const FilterLocationContainer = ({
|
|
|
12
12
|
setLocation,
|
|
13
13
|
setSelectedListItem
|
|
14
14
|
}) => {
|
|
15
|
-
const { setSelectedFilters, selectedFilters, filterOptions, noEntities } = useMapList();
|
|
15
|
+
const { setSelectedFilters, selectedFilters, filterOptions, noEntities, siteConfig } = useMapList();
|
|
16
16
|
|
|
17
17
|
const locations = filterOptions?.locations;
|
|
18
18
|
const pointsOfInterest = filterOptions?.pointsOfInterest;
|
|
19
|
+
const showAtZoomLevel = siteConfig?.pointsOfInterestConfig?.showAtZoomLevel ?? 12;
|
|
19
20
|
|
|
20
21
|
return (
|
|
21
22
|
<FilterLocation
|
|
@@ -36,6 +37,7 @@ const FilterLocationContainer = ({
|
|
|
36
37
|
pointsOfInterest={pointsOfInterest}
|
|
37
38
|
setDefaultValue={setDefaultValue}
|
|
38
39
|
defaultValue={defaultValue}
|
|
40
|
+
showAtZoomLevel={showAtZoomLevel}
|
|
39
41
|
/>
|
|
40
42
|
)}
|
|
41
43
|
</FilterLocation>
|
|
@@ -2,14 +2,23 @@ import React from 'react';
|
|
|
2
2
|
import Accordion from '~/components/modules/accordions/default';
|
|
3
3
|
import AccordionFilterItem from '~/components/modules/accordions/filterItem';
|
|
4
4
|
import RadioItemContainer from '~/components/containers/filter/points-of-interest-radio-item-container';
|
|
5
|
+
import { usePlaces } from '~/contexts/placesContext';
|
|
5
6
|
|
|
6
7
|
const FilterPointsOfInterestContainer = ({
|
|
7
8
|
title = "Points of interest",
|
|
8
9
|
pointsOfInterest,
|
|
9
10
|
setDefaultValue,
|
|
10
11
|
className,
|
|
11
|
-
defaultValue
|
|
12
|
+
defaultValue,
|
|
13
|
+
showAtZoomLevel = 12
|
|
12
14
|
}) => {
|
|
15
|
+
const { currentZoom } = usePlaces();
|
|
16
|
+
|
|
17
|
+
// Don't render if zoom level is below threshold
|
|
18
|
+
if (currentZoom < showAtZoomLevel) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
13
22
|
const renderRadioItem = (item, index) => (
|
|
14
23
|
<RadioItemContainer key={item.key + index} item={item} field={item.id} />
|
|
15
24
|
);
|
|
@@ -159,20 +159,22 @@ const MapContainer = ({ markerConfigs, infoWindowClasses, clusterGridSize = 60 }
|
|
|
159
159
|
fitBounds(mapRef.current, true);
|
|
160
160
|
}
|
|
161
161
|
if (mapRef.current && !mapInteracted) {
|
|
162
|
+
const jobPinZoomLevel = siteConfig?.jobPinZoomLevel ?? 12;
|
|
162
163
|
const currZoom = mapRef.current.zoom;
|
|
163
|
-
const setZoomVal = currZoom <
|
|
164
|
+
const setZoomVal = currZoom < (jobPinZoomLevel + 1) ? currZoom : jobPinZoomLevel;
|
|
164
165
|
mapRef.current.setZoom(setZoomVal);
|
|
165
166
|
}
|
|
166
|
-
}, [filteredListings]);
|
|
167
|
+
}, [filteredListings, siteConfig]);
|
|
167
168
|
|
|
168
169
|
useEffect(() => {
|
|
169
170
|
if (!mapRef.current || !location || mapInteracted) return;
|
|
171
|
+
const jobPinZoomLevel = siteConfig?.jobPinZoomLevel ?? 12;
|
|
170
172
|
mapRef.current.panTo(new google.maps.LatLng(location.latitude, location.longitude));
|
|
171
173
|
if (mapRef.current) {
|
|
172
|
-
const setZoomVal = zoom <
|
|
174
|
+
const setZoomVal = zoom < (jobPinZoomLevel + 1) ? zoom : jobPinZoomLevel;
|
|
173
175
|
mapRef.current.setZoom(setZoomVal);
|
|
174
176
|
}
|
|
175
|
-
}, [location, zoom,
|
|
177
|
+
}, [location, zoom, siteConfig]);
|
|
176
178
|
|
|
177
179
|
const fitBounds = (map, overload = false) => {
|
|
178
180
|
if ((mapInteracted === false || overload) && mapItems != null) {
|
|
@@ -218,6 +220,15 @@ const MapContainer = ({ markerConfigs, infoWindowClasses, clusterGridSize = 60 }
|
|
|
218
220
|
setMapInteracted(true);
|
|
219
221
|
setMarkersToHideFromBounds([]);
|
|
220
222
|
selectLocationEntity(mapLocation);
|
|
223
|
+
const jobPinZoomLevel = siteConfig?.jobPinZoomLevel;
|
|
224
|
+
if (jobPinZoomLevel !== undefined && mapRef.current) {
|
|
225
|
+
setTimeout(() => {
|
|
226
|
+
if (mapRef.current) {
|
|
227
|
+
mapRef.current.panTo(new google.maps.LatLng(mapLocation.latitude, mapLocation.longitude));
|
|
228
|
+
mapRef.current.setZoom(jobPinZoomLevel);
|
|
229
|
+
}
|
|
230
|
+
}, 300);
|
|
231
|
+
}
|
|
221
232
|
};
|
|
222
233
|
|
|
223
234
|
const onLoad = map => {
|
|
@@ -10,7 +10,7 @@ const PlacesContext = createContext();
|
|
|
10
10
|
|
|
11
11
|
export const usePlaces = () => useContext(PlacesContext);
|
|
12
12
|
|
|
13
|
-
export const PlacesProvider = ({ children, placeMappings, markerColors, additionalMapMarkers, googleMapsApiKey }) => {
|
|
13
|
+
export const PlacesProvider = ({ children, placeMappings, markerColors, additionalMapMarkers, googleMapsApiKey, showAtZoomLevel = 12 }) => {
|
|
14
14
|
const { selectedPlaces, zoom, center } = useMap();
|
|
15
15
|
const [poiMarkers, setPoiMarkers] = useState({ markers: [], icon: null });
|
|
16
16
|
const [currentCenter, setCurrentCenter] = useState(center);
|
|
@@ -34,7 +34,7 @@ export const PlacesProvider = ({ children, placeMappings, markerColors, addition
|
|
|
34
34
|
}, [currentZoom]);
|
|
35
35
|
|
|
36
36
|
useEffect(() => {
|
|
37
|
-
if (!selectedPlaces ||
|
|
37
|
+
if (!selectedPlaces || selectedPlaces.length === 0 || !center || currentZoom < showAtZoomLevel) {
|
|
38
38
|
setPoiMarkers({ markers: [], icon: null });
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
@@ -82,7 +82,7 @@ export const PlacesProvider = ({ children, placeMappings, markerColors, addition
|
|
|
82
82
|
};
|
|
83
83
|
|
|
84
84
|
fetchPlaces();
|
|
85
|
-
}, [selectedPlaces, currentZoom, currentCenter, placeMappings, markerColors.placeMarkers, googleMapsApiKey, getRadiusForZoom, center]);
|
|
85
|
+
}, [selectedPlaces, currentZoom, currentCenter, placeMappings, markerColors.placeMarkers, googleMapsApiKey, getRadiusForZoom, center, showAtZoomLevel]);
|
|
86
86
|
|
|
87
87
|
return (
|
|
88
88
|
<PlacesContext.Provider value={{
|