Add gps track line, add documentation

This commit is contained in:
Pieter Vander Vennet 2021-11-08 14:18:45 +01:00
parent 7b7076168f
commit d3d51af667
18 changed files with 278 additions and 145 deletions

View file

@ -184,13 +184,19 @@ export default class GeoLocationHandler extends VariableUiElement {
this.currentLocation = state.currentUserLocation
this._currentGPSLocation.addCallback((location) => {
self._previousLocationGrant.setData("granted");
console.log("Location is", location,)
const feature = {
"type": "Feature",
properties: {
id: "gps",
"user:location": "yes",
...location
"date": new Date().toISOString(),
"latitude": location.latitude,
"longitude": location.longitude,
"speed": location.speed,
"accuracy": location.accuracy,
"heading": location.heading,
"altitude": location.altitude
},
geometry: {
type: "Point",

View file

@ -28,7 +28,7 @@ export default class TitleHandler {
continue;
}
if (layer.source.osmTags.matchesProperties(tags)) {
const tagsSource = state.allElements.getEventSourceById(tags.id)
const tagsSource = state.allElements.getEventSourceById(tags.id) ?? new UIEventSource<any>(tags)
const title = new TagRenderingAnswer(tagsSource, layer.title)
return new Combine([defaultTitle, " | ", title]).ConstructElement()?.innerText ?? defaultTitle;
}