@@ -6,19 +6,16 @@ import {
66 MATOMO_TRACKING_CATEGORY_MAP ,
77 DownloadMapModal ,
88 getMapFeaturesFromRecResource ,
9- getSitePointFeatureFromRecResource ,
109 getLayerStyleForRecResource ,
1110 StyleContext ,
12- webMercatorXToLon ,
13- webMercatorYToLat ,
1411} from '@shared/components/recreation-resource-map' ;
1512import { RecreationResourceDetailModel } from '@/service/custom-models' ;
1613import { trackEvent } from '@shared/utils' ;
1714import { IconButton } from '@shared/components/icon-button' ;
1815import { SearchMapFocusModes } from '@/components/search-map/constants' ;
1916import { ROUTE_PATHS } from '@/routes/constants' ;
2017import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' ;
21- import { faExternalLink , faMap } from '@fortawesome/free-solid-svg-icons' ;
18+ import { faMap } from '@fortawesome/free-solid-svg-icons' ;
2219import { getRecResourceDetailPageUrl } from '@/utils/recreationResourceUtils' ;
2320import DownloadIcon from '@shared/assets/icons/download.svg' ;
2421
@@ -99,27 +96,30 @@ export const RecreationResourceMap = ({
9996 setIsDownloadModalOpen ( true ) ;
10097 } , [ recResourceName , recResource ?. rec_resource_id ] ) ;
10198
102- const handleGoogleMapsLink = useCallback ( ( ) => {
103- trackEvent ( {
104- category : MATOMO_TRACKING_CATEGORY_MAP ,
105- action : TRACKING_ACTIONS . OPEN_GOOGLE_MAPS ,
106- name : `${ recResourceName } -${ recResource ?. rec_resource_id } -${ TRACKING_ACTIONS . OPEN_GOOGLE_MAPS } ` ,
107- } ) ;
108- const map = getSitePointFeatureFromRecResource ( recResource ) ;
109- if ( map ) {
110- const geometry = map . getGeometry ( ) ;
111- const coordinates = geometry ?. getCoordinates ( ) ;
112- if ( coordinates ) {
113- const lat = webMercatorYToLat ( coordinates [ 1 ] ) ;
114- const lon = webMercatorXToLon ( coordinates [ 0 ] ) ;
115- console . log ( lat , lon ) ;
116- window . open (
117- `https://www.google.com/maps/search/?api=1&query=${ lat } ,${ lon } ` ,
118- '_blank' ,
119- ) ;
120- }
121- }
122- } , [ recResource , recResourceName ] ) ;
99+ /*
100+ * Hide temporaly google maps link until we come with a proper warning/disclaimer //NOSONAR
101+ * const handleGoogleMapsLink = useCallback(() => {
102+ * trackEvent({
103+ * category: MATOMO_TRACKING_CATEGORY_MAP,
104+ * action: TRACKING_ACTIONS.OPEN_GOOGLE_MAPS,
105+ * name: `${recResourceName}-${recResource?.rec_resource_id}-${TRACKING_ACTIONS.OPEN_GOOGLE_MAPS}`,
106+ * });
107+ * const map = getSitePointFeatureFromRecResource(recResource);
108+ * if (map) {
109+ * const geometry = map.getGeometry();
110+ * const coordinates = geometry?.getCoordinates();
111+ * if (coordinates) {
112+ * const lat = webMercatorYToLat(coordinates[1]);
113+ * const lon = webMercatorXToLon(coordinates[0]);
114+ * console.log(lat, lon);
115+ * window.open(
116+ * `https://www.google.com/maps/search/?api=1&query=${lat},${lon}`,
117+ * '_blank',
118+ * );
119+ * }
120+ * }
121+ *}, [recResource, recResourceName]);
122+ */
123123
124124 if ( ! downloadStyledFeatures . length ) {
125125 return null ;
@@ -154,19 +154,19 @@ export const RecreationResourceMap = ({
154154 </ IconButton >
155155 </ Link >
156156 </ Col >
157-
158- < Col xs = { 12 } md = "auto" >
159- < IconButton
160- data-testid = "google-maps"
161- variant = "outline"
162- onClick = { handleGoogleMapsLink }
163- aria-label = { `Google maps view for ${ recResourceName } ` }
164- leftIcon = { < FontAwesomeIcon icon = { faExternalLink } /> }
165- >
166- Google Maps
167- </ IconButton >
168- </ Col >
169-
157+ { /* Hide temporaly google maps link until we come with a proper warning/disclaimer //NOSONAR
158+ *{ <Col xs={12} md="auto">
159+ * <IconButton
160+ * data-testid="google-maps"
161+ * variant="outline"
162+ * onClick={handleGoogleMapsLink}
163+ * aria-label={`Google maps view for ${recResourceName}`}
164+ * leftIcon={<FontAwesomeIcon icon={faExternalLink} />}
165+ * >
166+ * Google Maps
167+ * </IconButton>
168+ * </Col>}
169+ */ }
170170 < Col xs = { 12 } md = "auto" >
171171 < IconButton
172172 data-testid = "download-button"
0 commit comments