We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ea9ba9 commit e72fd61Copy full SHA for e72fd61
src/app/floorplan/page.tsx
@@ -0,0 +1,24 @@
1
+"use client";
2
+import React, { useEffect, useState } from "react";
3
+
4
+export default function Page() {
5
+ const [position, setPosition] = useState<GeolocationPosition>();
6
7
+ useEffect(() => {
8
+ const watchID = navigator.geolocation.watchPosition(
9
+ (position) => {
10
+ setPosition(position);
11
+ },
12
+ () => { },
13
+ { enableHighAccuracy: true, timeout: 5000, maximumAge: 0 }
14
+ );
15
16
+ return () => {
17
+ navigator.geolocation.clearWatch(watchID);
18
+ }
19
+ }, [setPosition]);
20
21
+ return (<div>
22
+ {JSON.stringify(position)}
23
+ </div>);
24
+}
0 commit comments