Skip to content

Commit

Permalink
feat: add geolocate control to /maps (#1186)
Browse files Browse the repository at this point in the history
  • Loading branch information
clintonlunn authored Oct 28, 2024
1 parent c36d151 commit 555d151
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/maps/GlobalMap.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'
import { useCallback, useState } from 'react'
import { Map, FullscreenControl, ScaleControl, NavigationControl, MapLayerMouseEvent, ViewStateChangeEvent } from 'react-map-gl/maplibre'
import { Map, FullscreenControl, ScaleControl, NavigationControl, MapLayerMouseEvent, ViewStateChangeEvent, GeolocateControl } from 'react-map-gl/maplibre'
import maplibregl, { MapLibreEvent } from 'maplibre-gl'
import dynamic from 'next/dynamic'

Expand Down Expand Up @@ -192,6 +192,7 @@ export const GlobalMap: React.FC<GlobalMapProps> = ({
<OBCustomLayers layersState={dataLayersDisplayState} />
{showFullscreenControl && <FullscreenControl />}
<NavigationControl showCompass={false} position='bottom-right' />
<GeolocateControl position='bottom-right' />
{clickInfo != null &&
<SelectedFeature feature={clickInfo} />}
<Drawer feature={clickInfo} />
Expand Down

0 comments on commit 555d151

Please sign in to comment.