Add pedestrian paths to entrance-layer, fix rendering in location-input element, fallback to OSM if map layer is not available

This commit is contained in:
pietervdvn 2021-12-09 01:22:57 +01:00
parent fc2ede2259
commit f29c62ab19
7 changed files with 64 additions and 4 deletions

View file

@ -2,7 +2,7 @@ import {Utils} from "../Utils";
export default class Constants {
public static vNumber = "0.13.0-alpha-3";
public static vNumber = "0.13.0-alpha-4";
public static ImgurApiKey = '7070e7167f0a25a'
public static readonly mapillary_client_token_v4 = "MLY|4441509239301885|b40ad2d3ea105435bd40c7e76993ae85"

View file

@ -186,7 +186,8 @@ export default class BackgroundMapSwitch extends Combine {
currentBackground: currentBackground,
notAvailable: activatePrevious
})
activatePrevious = button.activate
// Fall back to the first option: OSM
activatePrevious = activatePrevious ?? button.activate
if (category === preferredCategory) {
button.activate()
}

View file

@ -192,6 +192,7 @@ export default class LocationInput extends InputElement<Loc> implements MinimapO
if (this._snapTo !== undefined) {
// Show the lines to snap to
console.log("Constructing the snap-to layer", this._snapTo)
new ShowDataMultiLayer({
features: new StaticFeatureSource(this._snapTo, true),
enablePopups: false,

View file

@ -12,8 +12,9 @@ export default class ShowDataMultiLayer {
new PerLayerFeatureSourceSplitter(options.layers, (perLayer => {
const newOptions = {
...options,
layerToShow: perLayer.layer.layerDef,
...options
features: perLayer
}
new ShowDataLayer(newOptions)
}),

View file

@ -152,6 +152,13 @@
"nl": "Een tourniquet-deur (draaideur) die in een cylinder rond een centrale as draait"
}
},
{
"if": "door=sliding",
"then": {
"en": "A sliding door where the door slides sidewards, typically parallel with a wall",
"nl": "Een schuifdeur or roldeur die bij het openen en sluiten zijwaarts beweegt"
}
},
{
"if": "door=overhead",
"then": {
@ -266,7 +273,7 @@
"title": "entrance",
"preciseInput": {
"preferredBackground": "photo",
"snapToLayer": "walls_and_buildings"
"snapToLayer": ["walls_and_buildings","pedestrian_path"]
},
"tags": [
"entrance=yes"

View file

@ -0,0 +1,35 @@
{
"id": "pedestrian_path",
"name": {
"en": "Pedestrain paths"
},
"minzoom": 18,
"source": {
"osmTags": {
"or": [
"highway=footway",
"highway=path",
"highway=corridor",
"highway=steps"
]
}
},
"title": {},
"description": {
"en": "Pedestrian footpaths, especially used for indoor navigation and snapping entrances to this layer"
},
"mapRendering": [
{
"icon": "./assets/svg/bug.svg",
"location": [
"point"
]
},
{
"color": "#b33",
"width": 4,
"dashArray": "12 6"
}
]
}

View file

@ -84,6 +84,21 @@
}]
}
},
{
"id": "wrong_postal_code",
"source": {
"osmTags": {
"and": ["boundary~*","addr:postcode~*"]
}
},
"title": "Boundary relation with addr:postcode={addr:postcode}",
"mapRendering": [
{
"color": "#f00",
"width": 1
}
]
},
{
"id": "town_hall",
"name": {