forked from MapComplete/MapComplete
Make sure an initial GPS-fix is passed along as well
This commit is contained in:
parent
4de76136de
commit
dff270fc13
1 changed files with 2 additions and 7 deletions
|
@ -117,19 +117,14 @@ export default class GeoLocationHandler {
|
||||||
|
|
||||||
private CopyGeolocationIntoMapstate() {
|
private CopyGeolocationIntoMapstate() {
|
||||||
const state = this._state
|
const state = this._state
|
||||||
this.geolocationState.currentGPSLocation.addCallback((location) => {
|
this.geolocationState.currentGPSLocation.addCallbackAndRunD((location) => {
|
||||||
const feature = {
|
const feature = {
|
||||||
type: "Feature",
|
type: "Feature",
|
||||||
properties: <GeoLocationPointProperties>{
|
properties: <GeoLocationPointProperties>{
|
||||||
id: "gps",
|
id: "gps",
|
||||||
"user:location": "yes",
|
"user:location": "yes",
|
||||||
date: new Date().toISOString(),
|
date: new Date().toISOString(),
|
||||||
latitude: location.latitude,
|
...location,
|
||||||
longitude: location.longitude,
|
|
||||||
speed: location.speed,
|
|
||||||
accuracy: location.accuracy,
|
|
||||||
heading: location.heading,
|
|
||||||
altitude: location.altitude,
|
|
||||||
},
|
},
|
||||||
geometry: {
|
geometry: {
|
||||||
type: "Point",
|
type: "Point",
|
||||||
|
|
Loading…
Reference in a new issue