OsmObjects can now be used as featureSource, load selected object immediately, zoom to selected object on open; fix #191

This commit is contained in:
Pieter Vander Vennet 2021-05-06 01:33:09 +02:00
parent 5ce4140510
commit a0c1bc2137
13 changed files with 205 additions and 98 deletions

View file

@ -1,4 +1,3 @@
import {VerticalCombine} from "../Base/VerticalCombine";
import {UIElement} from "../UIElement";
import {VariableUiElement} from "../Base/VariableUIElement";
import LayoutConfig from "../../Customizations/JSON/LayoutConfig";
@ -53,15 +52,17 @@ export default class MoreScreen extends UIElement {
if(path === ""){
path = "."
}
const params = `z=${currentLocation.zoom ?? 1}&lat=${currentLocation.lat ?? 0}&lon=${currentLocation.lon ?? 0}`
let linkText =
`${path}/${layout.id.toLowerCase()}?z=${currentLocation.zoom}&lat=${currentLocation.lat}&lon=${currentLocation.lon}`
`${path}/${layout.id.toLowerCase()}?${params}`
if (location.hostname === "localhost" || location.hostname === "127.0.0.1") {
linkText = `${path}/index.html?layout=${layout.id}&z=${currentLocation.zoom}&lat=${currentLocation.lat}&lon=${currentLocation.lon}`
linkText = `${path}/index.html?layout=${layout.id}&${params}`
}
if (customThemeDefinition) {
linkText = `${path}/?userlayout=${layout.id}&z=${currentLocation.zoom}&lat=${currentLocation.lat}&lon=${currentLocation.lon}#${customThemeDefinition}`
linkText = `${path}/?userlayout=${layout.id}&${params}#${customThemeDefinition}`
}