forked from MapComplete/MapComplete
Add gps track line, add documentation
This commit is contained in:
parent
7b7076168f
commit
d3d51af667
18 changed files with 278 additions and 145 deletions
|
@ -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",
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue