mirror of
https://gitlab.com/wheres-the-tp/ui-mobile.git
synced 2026-01-25 07:24:56 -06:00
27 lines
552 B
JavaScript
27 lines
552 B
JavaScript
// @flow
|
|
import { emitter } from '../streams/LocationStream';
|
|
|
|
export const getCurrentPosition = () => {
|
|
// $FlowFixMe: maximumAge not found on object literal
|
|
navigator.geolocation.getCurrentPosition(
|
|
(pos: Position) => emitter(pos),
|
|
err => {
|
|
throw err;
|
|
},
|
|
{
|
|
enableHighAccuracy: false,
|
|
timeout: 2000,
|
|
}
|
|
);
|
|
};
|
|
|
|
// TODO actually implement geolocation for zipcode into lat/lng
|
|
export const getPositionFromZip = () => {
|
|
const dummyPos: any = {
|
|
coords: {
|
|
latitude: 30.267,
|
|
longitude: -97.7485,
|
|
},
|
|
};
|
|
emitter(dummyPos);
|
|
};
|