Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
aeharding committed Oct 7, 2024
1 parent d3129f3 commit 7bf4bea
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/services/position.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,9 @@ export function getPosition(
): Promise<GeolocationPosition> {
return new Promise((resolve, reject) =>
navigator.geolocation.getCurrentPosition(
(pos) => resolve(objectify(pos)),
(pos) => resolve(pos.toJSON()),
reject,
options,
),
);
}

function objectify(geoposition: GeolocationPosition): GeolocationPosition {
return {
timestamp: geoposition.timestamp,
coords: {
accuracy: geoposition.coords.accuracy,
altitude: geoposition.coords.altitude,
altitudeAccuracy: geoposition.coords.altitudeAccuracy,
heading: geoposition.coords.heading,
latitude: geoposition.coords.latitude,
longitude: geoposition.coords.longitude,
speed: geoposition.coords.speed,
},
};
}

0 comments on commit 7bf4bea

Please sign in to comment.