deletions natuurpunt thema

This commit is contained in:
Ward 2021-07-28 14:50:22 +02:00
parent 6c6794e587
commit 40717af859
3 changed files with 307 additions and 258 deletions

View file

@ -15,7 +15,7 @@ import {LocalStorageSource} from "./Logic/Web/LocalStorageSource";
import { Utils } from "./Utils";
import Svg from "./Svg";
import Link from "./UI/Base/Link";
import * as personal from "./assets/themes/personal/personal.json"
import * as personal from "./assets/themes/personal/personal.json";
import LayoutConfig from "./Customizations/JSON/LayoutConfig";
import * as L from "leaflet";
import Img from "./UI/Base/Img";
@ -57,8 +57,7 @@ export class InitUiElements {
`Error: incorrect layout <i>${layoutName}</i><br/><a href='https://${window.location.host}/'>Go back</a>`
)
.AttachTo("centermessage")
.onClick(() => {
});
.onClick(() => {});
throw "Incorrect layout";
}
@ -158,16 +157,13 @@ export class InitUiElements {
InitUiElements.InitWelcomeMessage();
});
if (
(window != window.top && !State.state.featureSwitchWelcomeMessage.data) ||
State.state.featureSwitchIframe.data
) {
if (State.state.featureSwitchIframe.data) {
const currentLocation = State.state.locationControl;
const url = `${window.location.origin}${window.location.pathname}?z=${
currentLocation.data.zoom ?? 0
}&lat=${currentLocation.data.lat ?? 0}&lon=${
currentLocation.data.lon ?? 0
}`;
const url = `${window.location.origin}${
window.location.pathname
}?z=${currentLocation.data.zoom ?? 0}&lat=${
currentLocation.data.lat ?? 0
}&lon=${currentLocation.data.lon ?? 0}`;
new MapControlButton(
new Link(Svg.pop_out_img, url, true).SetClass(
"block w-full h-full p-1.5"
@ -182,7 +178,9 @@ export class InitUiElements {
"--subtle-detail-color"
);
const icon = L.icon({
iconUrl: Img.AsData(Svg.home_white_bg.replace(/#ffffff/g, color)),
iconUrl: Img.AsData(
Svg.home_white_bg.replace(/#ffffff/g, color)
),
iconSize: [30, 30],
iconAnchor: [15, 15],
});
@ -196,31 +194,26 @@ export class InitUiElements {
State.state.currentGPSLocation,
State.state.leafletMap,
State.state.layoutToUse
), {
dontStyle : true
),
{
dontStyle: true,
}
),
undefined,
State.state.featureSwitchGeolocation
);
const plus = new MapControlButton(
Svg.plus_zoom_svg()
).onClick(() => {
const plus = new MapControlButton(Svg.plus_zoom_svg()).onClick(() => {
State.state.locationControl.data.zoom++;
State.state.locationControl.ping();
});
const min = new MapControlButton(
Svg.min_zoom_svg()
).onClick(() => {
const min = new MapControlButton(Svg.min_zoom_svg()).onClick(() => {
State.state.locationControl.data.zoom--;
State.state.locationControl.ping();
});
new Combine(
[plus, min, geolocationButton]
)
new Combine([plus, min, geolocationButton])
.SetClass("flex flex-col")
.AttachTo("bottom-right");
@ -262,7 +255,9 @@ export class InitUiElements {
"last-loaded-user-layout"
);
if (hash.length < 10) {
hash = dedicatedHashFromLocalStorage.data ?? hashFromLocalStorage.data;
hash =
dedicatedHashFromLocalStorage.data ??
hashFromLocalStorage.data;
} else {
console.log("Saving hash to local storage");
hashFromLocalStorage.setData(hash);
@ -309,9 +304,11 @@ export class InitUiElements {
// ?-Button on Desktop, opens panel with close-X.
const help = new MapControlButton(Svg.help_svg());
help.onClick(() => isOpened.setData(true));
new Toggle(fullOptions.SetClass("welcomeMessage"), help, isOpened).AttachTo(
"messagesbox"
);
new Toggle(
fullOptions.SetClass("welcomeMessage"),
help,
isOpened
).AttachTo("messagesbox");
const openedTime = new Date().getTime();
State.state.locationControl.addCallback(() => {
if (new Date().getTime() - openedTime < 15 * 1000) {
@ -366,9 +363,7 @@ export class InitUiElements {
State.state.featureSwitchLayers
);
const filterView =
new ScrollableFullScreen(
const filterView = new ScrollableFullScreen(
() => Translations.t.general.layerSelection.title.Clone(),
() =>
new FilterView(State.state.filteredLayers).SetClass(
@ -378,10 +373,7 @@ export class InitUiElements {
State.state.filterIsOpened
);
const filterMapControlButton = new MapControlButton(
Svg.filter_svg()
);
const filterMapControlButton = new MapControlButton(Svg.filter_svg());
const filterButton = new Toggle(
filterView,
@ -497,7 +489,7 @@ export class InitUiElements {
const flayer = {
isDisplayed: isDisplayed,
layerDef: layer,
appliedFilters: new UIEventSource<TagsFilter>(undefined)
appliedFilters: new UIEventSource<TagsFilter>(undefined),
};
flayers.push(flayer);
}
@ -534,7 +526,9 @@ export class InitUiElements {
source,
State.state.osmApiFeatureSource
);
selectedFeatureHandler.zoomToSelectedFeature(State.state.locationControl);
selectedFeatureHandler.zoomToSelectedFeature(
State.state.locationControl
);
return source;
}

View file

@ -1,7 +1,7 @@
{
"id": "parking",
"name": {
"nl": "parking"
"nl": "Parking"
},
"minzoom": 12,
"source": {
@ -64,10 +64,7 @@
"mappings": [
{
"if": {
"and": [
"access=yes",
"fee="
]
"and": ["access=yes", "fee="]
},
"then": {
"nl": "Vrij toegankelijk"
@ -75,10 +72,7 @@
},
{
"if": {
"and": [
"access=no",
"fee="
]
"and": ["access=no", "fee="]
},
"then": {
"nl": "Niet toegankelijk"
@ -86,10 +80,7 @@
},
{
"if": {
"and": [
"access=private",
"fee="
]
"and": ["access=private", "fee="]
},
"then": {
"nl": "Niet toegankelijk, want privégebied"
@ -97,10 +88,7 @@
},
{
"if": {
"and": [
"access=permissive",
"fee="
]
"and": ["access=permissive", "fee="]
},
"then": {
"nl": "Toegankelijk, ondanks dat het privegebied is"
@ -108,10 +96,7 @@
},
{
"if": {
"and": [
"access=guided",
"fee="
]
"and": ["access=guided", "fee="]
},
"then": {
"nl": "Enkel toegankelijk met een gids of tijdens een activiteit"
@ -119,10 +104,7 @@
},
{
"if": {
"and": [
"access=yes",
"fee=yes"
]
"and": ["access=yes", "fee=yes"]
},
"then": {
"nl": "Toegankelijk mits betaling"
@ -144,9 +126,7 @@
"mappings": [
{
"if": {
"and": [
"operator=Natuurpunt"
]
"and": ["operator=Natuurpunt"]
},
"then": {
"nl": "<img src=\"./assets/themes/buurtnatuur/Natuurpunt.jpg\" style=\"width:1.5em\">Dit gebied wordt beheerd door Natuurpunt"
@ -154,9 +134,7 @@
},
{
"if": {
"and": [
"operator~(n|N)atuurpunt.*"
]
"and": ["operator~(n|N)atuurpunt.*"]
},
"then": {
"nl": "<img src=\"./assets/themes/buurtnatuur/Natuurpunt.jpg\" style=\"width:1.5em\">Dit gebied wordt beheerd door {operator}"

View file

@ -26,8 +26,7 @@
"widenFactor": 0.05,
"socialImage": "",
"defaultBackgroundId": "CartoDB.Positron",
"layers": [
{
"layers": [{
"#": "Nature reserve with geometry, z>=13",
"builtin": "nature_reserve",
"override": {
@ -46,6 +45,14 @@
"minzoomVisible": 0,
"icon": {
"render": "circle:#FE6F32;./assets/themes/natuurpunt/nature_reserve.svg"
},
"deletion": {
"hardDeletionTags": {
"and": [
"leisure=nature_reserve",
"boundary=protected_area"
]
}
}
}
},
@ -65,6 +72,14 @@
"minzoom": 1,
"icon": {
"render": "circle:#FE6F32;./assets/themes/natuurpunt/nature_reserve.svg"
},
"deletion": {
"hardDeletionTags": {
"and": [
"leisure=nature_reserve",
"boundary=protected_area"
]
}
}
}
},
@ -84,6 +99,14 @@
"minzoom": "10",
"icon": {
"render": "circle:#FE6F32;./assets/themes/natuurpunt/information.svg"
},
"deletion": {
"hardDeletionTags": {
"and": [
"information=visitor_centre",
"information=office"
]
}
}
}
},
@ -103,8 +126,7 @@
"minzoom": "13",
"icon": {
"render": "circle:#FE6F32;./assets/themes/natuurpunt/trail.svg",
"mappings": [
{
"mappings": [{
"if": "wheelchair=yes",
"then": "circle:#FE6F32;./assets/themes/natuurpunt/walk_wheelchair.svg"
},
@ -113,6 +135,15 @@
"then": "circle:#FE6F32;./assets/themes/natuurpunt/pushchair.svg"
}
]
},
"deletion": {
"hardDeletionTags": {
"and": [
"route=hiking",
"route=bycicle",
"route=horse"
]
}
}
}
},
@ -127,8 +158,7 @@
},
"icon": {
"render": "circle:#FE6F32;./assets/themes/natuurpunt/toilets.svg",
"mappings": [
{
"mappings": [{
"if": "wheelchair=yes",
"then": "circle:#FE6F32;./assets/themes/natuurpunt/wheelchair.svg"
},
@ -137,6 +167,9 @@
"then": "circle:#FE6F32;./assets/themes/natuurpunt/urinal.svg"
}
]
},
"deletion": {
"hardDeletionTags": "amenity=toilets"
}
}
},
@ -152,7 +185,30 @@
"icon": {
"render": "circle:#FE6F32;./assets/themes/natuurpunt/birdhide.svg",
"mappings": null
},
"deletion": [{
"if": "leisure=bird_hide",
"then": {
"hardDeletionTags": "leisure=bird_hide"
}
}, {
"if": {
"or": [
"building=yes",
"shelter=yes",
"amenity=shelter"
]
},
"then": {
"hardDeletionTags": {
"and": [
"building=yes",
"shelter=yes",
"amenity=shelter"
]
}
}
}]
}
},
{
@ -166,6 +222,9 @@
},
"icon": {
"render": "circle:#FE6F32;./assets/themes/natuurpunt/picnic_table.svg"
},
"deletion": {
"hardDeletionTags": "leisure=picnic_table"
}
}
},
@ -180,6 +239,9 @@
},
"icon": {
"render": "circle:#FE6F32;./assets/themes/natuurpunt/drips.svg"
},
"deletion": {
"hardDeletionTags": "amenity=drinking_water"
}
}
},
@ -189,15 +251,12 @@
"minzoom": "16",
"icon": {
"render": "circle:#FE6F32;./assets/themes/natuurpunt/parking.svg",
"mappings": [
{
"mappings": [{
"if": "amenity=bicycle_parking",
"then": "circle:#FE6F32;./assets/themes/natuurpunt/parkingbike.svg"
}
]
}]
},
"iconOverlays": [
{
"iconOverlays": [{
"if": "amenity=motorcycle_parking",
"then": "circle:#335D9F;./assets/themes/natuurpunt/parkingmotor.svg",
"badge": true
@ -207,8 +266,17 @@
"then": "circle:#335D9F;./assets/themes/natuurpunt/parkingwheels.svg",
"badge": true
}
],
"deletion": {
"hardDeletionTags": {
"and": [
"amenity=parking",
"amenity=motorcycle_parking",
"amenity=bicycle_parking"
]
}
}
}
},
{
"builtin": "information_board",
@ -221,6 +289,9 @@
},
"icon": {
"render": "circle:#FE6F32;./assets/themes/natuurpunt/information_board.svg"
},
"deletion": {
"hardDeletionTags": "information=board"
}
}
},
@ -235,6 +306,9 @@
},
"icon": {
"render": "circle:#FE6F32;./assets/themes/natuurpunt/bench.svg"
},
"deletion": {
"hardDeletionTags": "amenity=bench"
}
}
},
@ -249,6 +323,9 @@
},
"icon": {
"render": "circle:#FE6F32;./assets/themes/natuurpunt/watermill.svg"
},
"deletion": {
"hardDeletionTags": "man_made=watermill"
}
}
}