@abcagency/hc-ui-components 1.3.46 → 1.3.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/components/HireControlMap.js +1 -0
  2. package/dist/components/HireControlMap.js.map +1 -1
  3. package/dist/components/containers/accordions/filter-item-container.js +1 -0
  4. package/dist/components/containers/accordions/filter-item-container.js.map +1 -1
  5. package/dist/components/containers/filter/filter-item-container.js +3 -0
  6. package/dist/components/containers/filter/filter-item-container.js.map +1 -1
  7. package/dist/components/containers/maps/info-window-content-container.js +3 -3
  8. package/dist/components/containers/maps/info-window-content-container.js.map +1 -1
  9. package/dist/components/containers/maps/map-container.js +34 -2
  10. package/dist/components/containers/maps/map-container.js.map +1 -1
  11. package/dist/components/containers/maps/map-list-container.js +4 -2
  12. package/dist/components/containers/maps/map-list-container.js.map +1 -1
  13. package/dist/components/modules/buttons/show-all-button.js +1 -2
  14. package/dist/components/modules/buttons/show-all-button.js.map +1 -1
  15. package/dist/components/modules/filter/location.js +3 -0
  16. package/dist/components/modules/filter/location.js.map +1 -1
  17. package/dist/components/modules/maps/map-list.js +3 -2
  18. package/dist/components/modules/maps/map-list.js.map +1 -1
  19. package/dist/components/modules/maps/map.js.map +1 -1
  20. package/dist/util/filterUtil.js +16 -0
  21. package/dist/util/filterUtil.js.map +1 -1
  22. package/package.json +1 -1
  23. package/src/components/HireControlMap.js +1 -0
  24. package/src/components/containers/accordions/filter-item-container.js +1 -0
  25. package/src/components/containers/filter/filter-item-container.js +80 -77
  26. package/src/components/containers/maps/info-window-content-container.js +2 -2
  27. package/src/components/containers/maps/map-container.js +245 -206
  28. package/src/components/containers/maps/map-list-container.js +3 -1
  29. package/src/components/modules/buttons/show-all-button.js +2 -3
  30. package/src/components/modules/filter/location.js +7 -4
  31. package/src/components/modules/maps/map-list.js +13 -3
  32. package/src/components/modules/maps/map.js +64 -64
  33. package/src/util/filterUtil.js +17 -0
@@ -1,206 +1,245 @@
1
- import React, { useEffect, useRef } from 'react';
2
-
3
- import MapMarker from "~/components/containers/maps/map-marker-container";
4
- import PlaceMarker from "~/components/modules/maps/place-marker";
5
-
6
- import { usePlaces } from "~/contexts/placesContext";
7
- import { useMap } from "~/contexts/mapContext";
8
- import { useMapList } from "~/contexts/mapListContext";
9
-
10
- import { markerIconSelected, markerIcon, pinIcon } from "~/util/mapIconUtil";
11
-
12
- import Map from "~/components/modules/maps/map";
13
- import { MarkerClustererF } from "@react-google-maps/api";
14
- import { clusterOptions } from "~/util/mapUtil";
15
-
16
- const MapContainer = ({
17
- markerConfigs,
18
- infoWindowClasses,
19
- clusterGridSize = 60
20
- }) => {
21
- const {
22
- location,
23
- zoom,
24
- center,
25
- selectLocationEntity,
26
- setLocation,
27
- mapInteracted,
28
- setMapInteracted
29
- } = useMap();
30
-
31
- const {
32
- mapItems, filteredListings, setSelectedFilters,
33
- setQuery
34
- } = useMapList();
35
-
36
- const mapRef = useRef();
37
- const markerRefs = useRef({});
38
- const mapContainerRef = useRef(null);
39
- const {
40
- poiMarkers,
41
- setCurrentCenter,
42
- currentCenter,
43
- setCurrentZoom,
44
- currentZoom,
45
- selectedPlaceMarker,
46
- setSelectedPlaceMarker,
47
- placesWindow,
48
- setPlacesWindow } = usePlaces();
49
-
50
- const onIdle = () => {
51
- if (!currentCenter || !mapRef.current) return;
52
- const newCenter = mapRef.current.getCenter().toJSON();
53
- const newZoom = mapRef.current.zoom;
54
-
55
- setCurrentCenter(newCenter);
56
-
57
- if (newZoom !== currentZoom) {
58
- setCurrentZoom(newZoom);
59
- }
60
- };
61
-
62
- useEffect(() => {
63
- if (mapContainerRef.current) {
64
- const handleScroll = () => {
65
- setMapInteracted(true);
66
- };
67
- var mapContainerRefCurrent = mapContainerRef.current;
68
- mapContainerRef.current.addEventListener('wheel', handleScroll);
69
- return () => mapContainerRefCurrent.removeEventListener('wheel', handleScroll);
70
- }
71
- }, [mapContainerRef.current]);
72
-
73
- useEffect(() => {
74
- if (mapRef.current) {
75
- const mapInstance = mapRef.current;
76
- const dragStartListener = mapInstance.addListener('dragstart', () => setMapInteracted(true));
77
- const mouseDownListener = mapInstance.addListener('mousedown', () => setMapInteracted(true));
78
- return () => {
79
- google.maps.event.removeListener(dragStartListener);
80
- google.maps.event.removeListener(mouseDownListener);
81
- };
82
- }
83
- }, [mapRef.current, mapContainerRef.current]);
84
-
85
- useEffect(() => {
86
- if ((mapItems && mapItems.length > 0 || poiMarkers.length > 0) && mapRef.current) {
87
- fitBounds(mapRef.current);
88
- }
89
- }, [mapItems, mapRef.current, location]);
90
-
91
- useEffect(() => {
92
- if ((mapItems && mapItems.length > 0 || poiMarkers.length > 0) && mapRef.current && mapInteracted) {
93
- fitBounds(mapRef.current, true);
94
- }
95
- if (mapRef.current) {
96
- let currZoom = mapRef.current.zoom;
97
- let setZoomVal = currZoom < 13 ? currZoom : 12;
98
- mapRef.current.setZoom(setZoomVal);
99
- }
100
- }, [filteredListings]);
101
-
102
- useEffect(() => {
103
- if (!mapRef.current || !location || mapInteracted) return;
104
- mapRef.current.panTo(
105
- new google.maps.LatLng(location.latitude, location.longitude)
106
- );
107
- if (mapRef.current) {
108
- let setZoomVal = zoom < 13 ? zoom : 12;
109
- mapRef.current.setZoom(setZoomVal);
110
- }
111
- }, [location, zoom, mapRef.current]);
112
-
113
- const fitBounds = (map, overload = false) => {
114
- if ((mapInteracted === false || overload) && mapItems != null) {
115
- const bounds = new window.google.maps.LatLngBounds();
116
- mapItems.forEach(item => {
117
- bounds.extend(new google.maps.LatLng(item.latitude, item.longitude));
118
- });
119
- if (!map) return;
120
- map.fitBounds(bounds);
121
- }
122
- if (mapRef.current.zoom > 17) {
123
- mapRef.current.setZoom(16);
124
- }
125
- };
126
-
127
- const markerClickHandler = mapLocation => {
128
- setMapInteracted(true);
129
- selectLocationEntity(mapLocation);
130
- };
131
-
132
- const onLoad = map => {
133
- if (!location || location === null) {
134
- mapRef.current = map;
135
- fitBounds(map, true);
136
- return;
137
- }
138
- mapRef.current = map;
139
-
140
- if (mapInteracted === false) {
141
- mapRef.current.panTo(
142
- new google.maps.LatLng(location.latitude, location.longitude)
143
- );
144
-
145
- mapRef.current.setZoom(zoom);
146
- }
147
- };
148
-
149
- const pinIconUrl = pinIcon({
150
- fillColor: markerConfigs.fillColor,
151
- strokeColor: markerConfigs.strokeColor
152
- });
153
-
154
- return (
155
- <Map
156
- zoom={zoom}
157
- center={center}
158
- mapContainerRef={mapContainerRef}
159
- onLoad={onLoad}
160
- onIdle={onIdle}
161
- mapInteracted={mapInteracted}
162
- pinIconUrl={pinIconUrl}
163
- setMapInteracted={setMapInteracted}
164
- fitBounds={fitBounds}
165
- mapRef={mapRef}
166
- setQuery={setQuery}
167
- filteredListingsLength={filteredListings.length}
168
- setSelectedFilters={setSelectedFilters}
169
- >
170
- <MarkerClustererF options={clusterOptions(clusterGridSize, markerConfigs.fillColor)}>
171
- {clusterer => (
172
- <>
173
- {mapItems.map(item => (
174
- <MapMarker
175
- key={item.id}
176
- item={item}
177
- selectedLocation={location}
178
- markerRefs={markerRefs}
179
- infoWindowClasses={infoWindowClasses}
180
- setSelectedLocation={setLocation}
181
- markerClickHandler={markerClickHandler}
182
- clusterer={clusterer}
183
- markerIcon={markerIcon(markerConfigs)}
184
- markerIconSelected={markerIconSelected(markerConfigs)}
185
- setMapInteracted={setMapInteracted}
186
- />
187
- ))}
188
- {poiMarkers && poiMarkers.markers.map((marker, index) => (
189
- <PlaceMarker
190
- key={`marker-${marker.title}-${index}`}
191
- marker={marker}
192
- index={index}
193
- selectedPlaceMarker={selectedPlaceMarker}
194
- placesWindow={placesWindow}
195
- setPlacesWindow={setPlacesWindow}
196
- setSelectedPlaceMarker={setSelectedPlaceMarker}
197
- />
198
- ))}
199
- </>
200
- )}
201
- </MarkerClustererF>
202
- </Map>
203
- );
204
- };
205
-
206
- export default MapContainer;
1
+ import React, { useEffect, useRef, useState } from 'react';
2
+
3
+ import MapMarker from "~/components/containers/maps/map-marker-container";
4
+ import PlaceMarker from "~/components/modules/maps/place-marker";
5
+
6
+ import { usePlaces } from "~/contexts/placesContext";
7
+ import { useMap } from "~/contexts/mapContext";
8
+ import { useMapList } from "~/contexts/mapListContext";
9
+
10
+ import { markerIconSelected, markerIcon, pinIcon } from "~/util/mapIconUtil";
11
+
12
+ import Map from "~/components/modules/maps/map";
13
+ import { MarkerClustererF } from "@react-google-maps/api";
14
+ import { clusterOptions } from "~/util/mapUtil";
15
+
16
+ const MapContainer = ({
17
+ markerConfigs,
18
+ infoWindowClasses,
19
+ clusterGridSize = 60
20
+ }) => {
21
+ const {
22
+ location,
23
+ zoom,
24
+ center,
25
+ selectLocationEntity,
26
+ setLocation,
27
+ mapInteracted,
28
+ setMapInteracted
29
+ } = useMap();
30
+
31
+ const {
32
+ mapItems, filteredListings, setSelectedFilters,
33
+ setQuery,
34
+ siteConfig
35
+ } = useMapList();
36
+
37
+ const mapRef = useRef();
38
+ const markerRefs = useRef({});
39
+ const mapContainerRef = useRef(null);
40
+ const {
41
+ poiMarkers,
42
+ setCurrentCenter,
43
+ currentCenter,
44
+ setCurrentZoom,
45
+ currentZoom,
46
+ selectedPlaceMarker,
47
+ setSelectedPlaceMarker,
48
+ placesWindow,
49
+ setPlacesWindow } = usePlaces();
50
+
51
+ const onIdle = () => {
52
+ if (!currentCenter || !mapRef.current) return;
53
+ const newCenter = mapRef.current.getCenter().toJSON();
54
+ const newZoom = mapRef.current.zoom;
55
+
56
+ setCurrentCenter(newCenter);
57
+
58
+ if (newZoom !== currentZoom) {
59
+ setCurrentZoom(newZoom);
60
+ }
61
+ };
62
+
63
+ useEffect(() => {
64
+ if (mapContainerRef.current) {
65
+ const handleScroll = () => {
66
+ setMapInteracted(true);
67
+ };
68
+ var mapContainerRefCurrent = mapContainerRef.current;
69
+ mapContainerRef.current.addEventListener('wheel', handleScroll);
70
+ return () => mapContainerRefCurrent.removeEventListener('wheel', handleScroll);
71
+ }
72
+ }, [mapContainerRef.current]);
73
+
74
+ useEffect(() => {
75
+ if (mapRef.current) {
76
+ const mapInstance = mapRef.current;
77
+ const dragStartListener = mapInstance.addListener('dragstart', () => setMapInteracted(true));
78
+ const mouseDownListener = mapInstance.addListener('mousedown', () => setMapInteracted(true));
79
+ return () => {
80
+ google.maps.event.removeListener(dragStartListener);
81
+ google.maps.event.removeListener(mouseDownListener);
82
+ };
83
+ }
84
+ }, [mapRef.current, mapContainerRef.current]);
85
+
86
+ useEffect(() => {
87
+ if ((mapItems && mapItems.length > 0 || poiMarkers.length > 0) && mapRef.current) {
88
+ fitBounds(mapRef.current);
89
+ }
90
+ }, [mapItems, mapRef.current, location]);
91
+
92
+ useEffect(() => {
93
+ if ((mapItems && mapItems.length > 0 || poiMarkers.length > 0) && mapRef.current && mapInteracted) {
94
+ fitBounds(mapRef.current, true);
95
+ }
96
+ if (mapRef.current) {
97
+ let currZoom = mapRef.current.zoom;
98
+ let setZoomVal = currZoom < 13 ? currZoom : 12;
99
+ mapRef.current.setZoom(setZoomVal);
100
+ }
101
+ }, [filteredListings]);
102
+
103
+ useEffect(() => {
104
+ if (!mapRef.current || !location || mapInteracted) return;
105
+ mapRef.current.panTo(
106
+ new google.maps.LatLng(location.latitude, location.longitude)
107
+ );
108
+ if (mapRef.current) {
109
+ let setZoomVal = zoom < 13 ? zoom : 12;
110
+ mapRef.current.setZoom(setZoomVal);
111
+ }
112
+ }, [location, zoom, mapRef.current]);
113
+
114
+ const fitBounds = (map, overload = false) => {
115
+ if ((mapInteracted === false || overload) && mapItems != null) {
116
+ const bounds = new window.google.maps.LatLngBounds();
117
+ mapItems.forEach(item => {
118
+ bounds.extend(new google.maps.LatLng(item.latitude, item.longitude));
119
+ });
120
+
121
+ if (!map) return;
122
+ const currentCenter = map.getCenter();
123
+ map.fitBounds(bounds);
124
+ const newCenter = bounds.getCenter();
125
+ if (currentCenter && newCenter) {
126
+ map.panTo(newCenter);
127
+ }
128
+ }
129
+ if (mapRef.current.zoom > 17) {
130
+ mapRef.current.setZoom(16);
131
+ }
132
+ };
133
+
134
+ const markerClickHandler = mapLocation => {
135
+ setMapInteracted(true);
136
+ selectLocationEntity(mapLocation);
137
+ };
138
+
139
+ const onLoad = map => {
140
+ if (!location || location === null) {
141
+ mapRef.current = map;
142
+ fitBounds(map, true);
143
+ return;
144
+ }
145
+ mapRef.current = map;
146
+
147
+ if (mapInteracted === false) {
148
+ mapRef.current.panTo(
149
+ new google.maps.LatLng(location.latitude, location.longitude)
150
+ );
151
+
152
+ mapRef.current.setZoom(zoom);
153
+ }
154
+ };
155
+
156
+ const pinIconUrl = pinIcon({
157
+ fillColor: markerConfigs.fillColor,
158
+ strokeColor: markerConfigs.strokeColor
159
+ });
160
+
161
+ const onClusterClick = cluster => {
162
+ if(!siteConfig.optionalShowLocationClusterConfig || (mapRef.current.zoom > siteConfig.optionalShowLocationClusterConfig.showForZoomLevelLessThan)) {
163
+ console.log("should return");
164
+ return;
165
+ }
166
+ if (!cluster || typeof cluster.getMarkers !== 'function') {
167
+ console.error('Cluster object or getMarkers method not available.');
168
+ return;
169
+ }
170
+
171
+ const markers = cluster.getMarkers();
172
+
173
+ if (!markers || markers.length === 0) {
174
+ console.error('No markers found in the cluster.');
175
+ return;
176
+ }
177
+
178
+ setTimeout(() => {
179
+ const bounds = new window.google.maps.LatLngBounds();
180
+
181
+ markers.forEach(marker => {
182
+ bounds.extend(marker.getPosition());
183
+ });
184
+
185
+ bounds.extend(new google.maps.LatLng(siteConfig.optionalShowLocationClusterConfig.latitude, siteConfig.optionalShowLocationClusterConfig.longitude));
186
+
187
+ if (mapRef.current) {
188
+ mapRef.current.fitBounds(bounds);
189
+ }
190
+ }, 500);
191
+ };
192
+
193
+ return (
194
+ <Map
195
+ zoom={zoom}
196
+ center={center}
197
+ mapContainerRef={mapContainerRef}
198
+ onLoad={onLoad}
199
+ onIdle={onIdle}
200
+ mapInteracted={mapInteracted}
201
+ pinIconUrl={pinIconUrl}
202
+ setMapInteracted={setMapInteracted}
203
+ fitBounds={fitBounds}
204
+ mapRef={mapRef}
205
+ setQuery={setQuery}
206
+ filteredListingsLength={filteredListings.length}
207
+ setSelectedFilters={setSelectedFilters}
208
+ >
209
+ <MarkerClustererF options={clusterOptions(clusterGridSize, markerConfigs.fillColor)} onClick={onClusterClick}>
210
+ {clusterer => (
211
+ <>
212
+ {mapItems.map(item => (
213
+ <MapMarker
214
+ key={item.id}
215
+ item={item}
216
+ selectedLocation={location}
217
+ markerRefs={markerRefs}
218
+ infoWindowClasses={infoWindowClasses}
219
+ setSelectedLocation={setLocation}
220
+ markerClickHandler={markerClickHandler}
221
+ clusterer={clusterer}
222
+ markerIcon={markerIcon(markerConfigs)}
223
+ markerIconSelected={markerIconSelected(markerConfigs)}
224
+ setMapInteracted={setMapInteracted}
225
+ />
226
+ ))}
227
+ {poiMarkers && poiMarkers.markers.map((marker, index) => (
228
+ <PlaceMarker
229
+ key={`marker-${marker.title}-${index}`}
230
+ marker={marker}
231
+ index={index}
232
+ selectedPlaceMarker={selectedPlaceMarker}
233
+ placesWindow={placesWindow}
234
+ setPlacesWindow={setPlacesWindow}
235
+ setSelectedPlaceMarker={setSelectedPlaceMarker}
236
+ />
237
+ ))}
238
+ </>
239
+ )}
240
+ </MarkerClustererF>
241
+ </Map>
242
+ );
243
+ };
244
+
245
+ export default MapContainer;
@@ -14,7 +14,8 @@ const MapListContainer = ({
14
14
  specialFeatures,
15
15
  fieldNames,
16
16
  showMap,
17
- placeMappings
17
+ placeMappings,
18
+ mapPosition
18
19
  }) => {
19
20
 
20
21
  const listProps = {
@@ -41,6 +42,7 @@ const MapListContainer = ({
41
42
  list={<List {...listProps} />}
42
43
  map={<Map {...mapProps} />}
43
44
  filter={<Filter showMap={showMap} className="md:hc-hidden" />}
45
+ mapPosition={mapPosition}
44
46
  />
45
47
  );
46
48
  };
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
2
 
3
- const ShowAllButton = ({ mapInteracted, markerConfigs, setMapInteracted, fitBounds, mapRef, pinIconUrl, setSelectedFilters, setQuery, listingCount }) => {
4
- if (!mapInteracted || !markerConfigs) {
3
+ const ShowAllButton = ({ mapInteracted, setMapInteracted, fitBounds, mapRef, pinIconUrl, setSelectedFilters, setQuery, listingCount }) => {
4
+ if (!mapInteracted) {
5
5
  return null;
6
6
  }
7
-
8
7
  return (
9
8
  <button
10
9
  style={{ fontFamily: 'Roboto, Arial, sans-serif', fontSize: '14px', fontWeight: '500' }}
@@ -25,8 +25,11 @@ const FilterLocation = ({
25
25
  {!locations && <Loading />}
26
26
  {locations && (
27
27
  <Accordion defaultValue={defaultValue} className="hc-space-y-4">
28
- {locations?.map(filter => (
29
- <AccordionFilterItem
28
+ {locations?.map(filter => {
29
+ if(filter.id === 'entityName' && (!selectedFilters.cityState && !selectedFilters.state)){
30
+ return;
31
+ }
32
+ return(<AccordionFilterItem
30
33
  key={filter.id}
31
34
  filter={filter}
32
35
  setDefaultValue={setDefaultValue}
@@ -36,8 +39,8 @@ const FilterLocation = ({
36
39
  setLocation(null);
37
40
  setSelectedListItem(null);
38
41
  }}
39
- />
40
- ))}
42
+ />);
43
+ })}
41
44
  {children}
42
45
  </Accordion>
43
46
  )}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import Tabs from '~/components/modules/maps/tabs';
3
3
 
4
- const MapList = ({ showMap, loading, list, map, filter }) => {
4
+ const MapList = ({ showMap, loading, list, map, filter, mapPosition }) => {
5
5
  return (
6
6
  <>
7
7
  <div
@@ -10,8 +10,18 @@ const MapList = ({ showMap, loading, list, map, filter }) => {
10
10
  md:hc-grid md:hc-pt-4 hc-overflow-hidden hc-relative bg-gray-100
11
11
  `}
12
12
  >
13
- <div>{list}</div>
14
- <div>{showMap && map}</div>
13
+ {mapPosition && mapPosition === 'top' && showMap ? (
14
+ <>
15
+ <div>{map}</div>
16
+ <div>{list}</div>
17
+ </>
18
+ ) : (
19
+ <>
20
+ <div>{list}</div>
21
+ <div>{showMap && map}</div>
22
+ </>
23
+ )}
24
+
15
25
  </div>
16
26
  <div className="md:hc-hidden">
17
27
  <Tabs
@@ -1,64 +1,64 @@
1
- import React from 'react';
2
- import { GoogleMap } from "@react-google-maps/api";
3
- import ShowAllButton from "~/components/modules/buttons/show-all-button";
4
-
5
- const Map = ({
6
- zoom,
7
- center,
8
- mapContainerRef,
9
- onLoad,
10
- onIdle,
11
- mapInteracted,
12
- pinIconUrl,
13
- setMapInteracted,
14
- fitBounds,
15
- mapRef,
16
- setQuery,
17
- filteredListingsLength,
18
- setSelectedFilters,
19
- children
20
- }) => {
21
- return (
22
- <>
23
- {zoom && center && (
24
- <div ref={mapContainerRef} className="hc-h-full hc-relative">
25
- <GoogleMap
26
- zoom={zoom}
27
- onLoad={onLoad}
28
- onIdle={onIdle}
29
- center={center}
30
- mapContainerStyle={{
31
- width: "100%",
32
- height: "100%"
33
- }}
34
- options={{
35
- styles: [
36
- {
37
- featureType: "poi",
38
- elementType: "labels",
39
- stylers: [{ visibility: "off" }]
40
- }
41
- ]
42
- }}
43
- >
44
- {children}
45
- </GoogleMap>
46
- {mapInteracted && (
47
- <ShowAllButton
48
- mapInteracted={mapInteracted}
49
- setMapInteracted={setMapInteracted}
50
- fitBounds={fitBounds}
51
- mapRef={mapRef}
52
- pinIconUrl={pinIconUrl}
53
- setQuery={setQuery}
54
- listingCount={filteredListingsLength}
55
- setSelectedFilters={setSelectedFilters}
56
- />
57
- )}
58
- </div>
59
- )}
60
- </>
61
- );
62
- };
63
-
64
- export default Map;
1
+ import React from 'react';
2
+ import { GoogleMap } from "@react-google-maps/api";
3
+ import ShowAllButton from "~/components/modules/buttons/show-all-button";
4
+
5
+ const Map = ({
6
+ zoom,
7
+ center,
8
+ mapContainerRef,
9
+ onLoad,
10
+ onIdle,
11
+ mapInteracted,
12
+ pinIconUrl,
13
+ setMapInteracted,
14
+ fitBounds,
15
+ mapRef,
16
+ setQuery,
17
+ filteredListingsLength,
18
+ setSelectedFilters,
19
+ children
20
+ }) => {
21
+ return (
22
+ <>
23
+ {zoom && center && (
24
+ <div ref={mapContainerRef} className="hc-h-full hc-relative">
25
+ <GoogleMap
26
+ zoom={zoom}
27
+ onLoad={onLoad}
28
+ onIdle={onIdle}
29
+ center={center}
30
+ mapContainerStyle={{
31
+ width: "100%",
32
+ height: "100%"
33
+ }}
34
+ options={{
35
+ styles: [
36
+ {
37
+ featureType: "poi",
38
+ elementType: "labels",
39
+ stylers: [{ visibility: "off" }]
40
+ }
41
+ ]
42
+ }}
43
+ >
44
+ {children}
45
+ </GoogleMap>
46
+ {mapInteracted && (
47
+ <ShowAllButton
48
+ mapInteracted={mapInteracted}
49
+ setMapInteracted={setMapInteracted}
50
+ fitBounds={fitBounds}
51
+ mapRef={mapRef}
52
+ pinIconUrl={pinIconUrl}
53
+ setQuery={setQuery}
54
+ listingCount={filteredListingsLength}
55
+ setSelectedFilters={setSelectedFilters}
56
+ />
57
+ )}
58
+ </div>
59
+ )}
60
+ </>
61
+ );
62
+ };
63
+
64
+ export default Map;