From f94bb4470652d819df0821daf9446189e0790eb2 Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero <94913521+arielcostas@users.noreply.github.com> Date: Tue, 4 Mar 2025 00:17:11 +0100 Subject: Add location button to map --- src/controls/LocateControl.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/controls/LocateControl.ts (limited to 'src/controls') diff --git a/src/controls/LocateControl.ts b/src/controls/LocateControl.ts new file mode 100644 index 0000000..4ef8243 --- /dev/null +++ b/src/controls/LocateControl.ts @@ -0,0 +1,7 @@ +import {createControlComponent} from '@react-leaflet/core'; +import {LocateControl as LeafletLocateControl} from 'leaflet.locatecontrol'; +import "leaflet.locatecontrol/dist/L.Control.Locate.min.css"; + +export const LocateControl = createControlComponent( + (props) => new LeafletLocateControl(props) +); \ No newline at end of file -- cgit v1.3