diff --git a/Customizations/JSON/LayerConfig.ts b/Customizations/JSON/LayerConfig.ts
index e1b2a64..61bd898 100644
--- a/Customizations/JSON/LayerConfig.ts
+++ b/Customizations/JSON/LayerConfig.ts
@@ -100,7 +100,7 @@ export default class LayerConfig {
}
this.tagRenderings = trs(json.tagRenderings).concat(roamingRenderings);
- this.titleIcons = trs(json.titleIcons ?? ["wikipedialink","osmlink", "sharelink"]);
+ this.titleIcons = trs(json.titleIcons ?? ["phonelink","wikipedialink","osmlink", "sharelink"]);
function tr(key, deflt) {
diff --git a/Customizations/JSON/LayerConfigJson.ts b/Customizations/JSON/LayerConfigJson.ts
index 98df035..ac1b338 100644
--- a/Customizations/JSON/LayerConfigJson.ts
+++ b/Customizations/JSON/LayerConfigJson.ts
@@ -121,6 +121,12 @@ export interface LayerConfigJson {
/**
* All the tag renderings.
* A tag rendering is a block that either shows the known value or asks a question.
+ *
+ * Refer to the class `TagRenderingConfigJson` to see the possibilities.
+ *
+ * Note that we can also use a string here - where the string refers to a tagrenering defined in `assets/questions/questions.json`,
+ * where a few very general questions are defined e.g. website, phone number, ...
+ *
*/
tagRenderings?: (string | TagRenderingConfigJson) []
}
\ No newline at end of file
diff --git a/InitUiElements.ts b/InitUiElements.ts
index e4ac702..ad04884 100644
--- a/InitUiElements.ts
+++ b/InitUiElements.ts
@@ -161,7 +161,7 @@ export class InitUiElements {
if (feature === undefined) {
State.state.fullScreenMessage.setData(undefined);
}
- if (feature?.properties === undefined) {
+ if (feature?.properties === undefined) {
return;
}
const data = feature.properties;
@@ -175,7 +175,7 @@ export class InitUiElements {
continue;
}
- if(layer.title === null && layer.tagRenderings.length === 0){
+ if((layer.title ?? null) === null && layer.tagRenderings.length === 0){
continue;
}
@@ -230,7 +230,6 @@ export class InitUiElements {
});
const marker = L.marker([home.lat, home.lon], {icon: icon})
marker.addTo(State.state.bm.map)
- console.log(marker)
});
new GeoLocationHandler()
diff --git a/Logic/FilteredLayer.ts b/Logic/FilteredLayer.ts
index c978185..a9f2302 100644
--- a/Logic/FilteredLayer.ts
+++ b/Logic/FilteredLayer.ts
@@ -184,7 +184,9 @@ export class FilteredLayer {
if (feature.properties.id.replace(/\//g, "_") === Hash.Get().data) {
const center = GeoOperations.centerpoint(feature).geometry.coordinates;
popup.setLatLng({lat: center[1], lng: center[0]});
- popup.openOn(State.state.bm.map)
+ popup.openOn(State.state.bm.map);
+ State.state.selectedElement.setData(feature);
+ uiElement.Update();
}
}
diff --git a/Logic/Leaflet/Basemap.ts b/Logic/Leaflet/Basemap.ts
index a1b09c9..e1139e7 100644
--- a/Logic/Leaflet/Basemap.ts
+++ b/Logic/Leaflet/Basemap.ts
@@ -42,6 +42,11 @@ export class Basemap {
layers: [this._previousLayer],
});
+ L.control.scale(
+ {
+ position: 'topright',
+ }
+ ).addTo(this.map)
// Users are not allowed to zoom to the 'copies' on the left and the right, stuff goes wrong then
// We give a bit of leeway for people on the edges
diff --git a/Logic/Leaflet/GeoLocationHandler.ts b/Logic/Leaflet/GeoLocationHandler.ts
index e94b23e..d91b2bd 100644
--- a/Logic/Leaflet/GeoLocationHandler.ts
+++ b/Logic/Leaflet/GeoLocationHandler.ts
@@ -17,6 +17,14 @@ export class GeoLocationHandler extends UIElement {
constructor() {
super(undefined);
this._hasLocation = State.state.currentGPSLocation.map((location) => location !== undefined);
+ var self = this;
+ import("../../vendor/Leaflet.AccuratePosition.js").then(() => {
+ self.init();
+ })
+ }
+
+
+ public init() {
this.ListenTo(this._hasLocation);
this.ListenTo(this._isActive);
this.ListenTo(this._permission);
@@ -25,14 +33,10 @@ export class GeoLocationHandler extends UIElement {
function onAccuratePositionProgress(e) {
- console.log(e.accuracy);
- console.log(e.latlng);
State.state.currentGPSLocation.setData({latlng: e.latlng, accuracy: e.accuracy});
}
function onAccuratePositionFound(e) {
- console.log(e.accuracy);
- console.log(e.latlng);
State.state.currentGPSLocation.setData({latlng: e.latlng, accuracy: e.accuracy});
}
@@ -106,7 +110,12 @@ export class GeoLocationHandler extends UIElement {
return "";
}
if (State.state.currentGPSLocation.data !== undefined) {
- map.flyTo(State.state.currentGPSLocation.data.latlng, 18);
+ State.state.bm.map.flyTo(
+ State.state.currentGPSLocation.data.latlng, 16,
+ {
+ duration: 0.25,
+ }
+ );
}
diff --git a/Logic/Osm/ChangesetHandler.ts b/Logic/Osm/ChangesetHandler.ts
index a432bc0..5c23ac5 100644
--- a/Logic/Osm/ChangesetHandler.ts
+++ b/Logic/Osm/ChangesetHandler.ts
@@ -1,3 +1,4 @@
+import escapeHtml from "escape-html";
import {OsmConnection, UserDetails} from "./OsmConnection";
import {UIEventSource} from "../UIEventSource";
import {ElementStorage} from "../ElementStorage";
@@ -105,7 +106,7 @@ export class ChangesetHandler {
``,
``,
surveySource,
- layout.maintainer !== undefined ? `` : "",
+ layout.maintainer !== undefined ? `` : "",
``].join("")
}, function (err, response) {
if (response === undefined) {
diff --git a/Svg.ts b/Svg.ts
index fbcbcdd..4fcddce 100644
--- a/Svg.ts
+++ b/Svg.ts
@@ -14,7 +14,7 @@ export default class Svg {
public static addSmall_svg() { return new FixedUiElement(Svg.addSmall);}
public static addSmall_ui() { return new FixedUiElement(Svg.addSmall_img);}
- public static ampersand = "e "
+ public static ampersand = " "
public static ampersand_img = Img.AsImageElement(Svg.ampersand)
public static ampersand_svg() { return new FixedUiElement(Svg.ampersand);}
public static ampersand_ui() { return new FixedUiElement(Svg.ampersand_img);}
@@ -174,6 +174,11 @@ export default class Svg {
public static pencil_svg() { return new FixedUiElement(Svg.pencil);}
public static pencil_ui() { return new FixedUiElement(Svg.pencil_img);}
+ public static phone = " "
+ public static phone_img = Img.AsImageElement(Svg.phone)
+ public static phone_svg() { return new FixedUiElement(Svg.phone);}
+ public static phone_ui() { return new FixedUiElement(Svg.phone_img);}
+
public static pop_out = " "
public static pop_out_img = Img.AsImageElement(Svg.pop_out)
public static pop_out_svg() { return new FixedUiElement(Svg.pop_out);}
@@ -219,4 +224,4 @@ export default class Svg {
public static wikipedia_svg() { return new FixedUiElement(Svg.wikipedia);}
public static wikipedia_ui() { return new FixedUiElement(Svg.wikipedia_img);}
-public static All = {"add.svg": Svg.add,"addSmall.svg": Svg.addSmall,"ampersand.svg": Svg.ampersand,"arrow-left-smooth.svg": Svg.arrow_left_smooth,"arrow-right-smooth.svg": Svg.arrow_right_smooth,"bug.svg": Svg.bug,"camera-plus.svg": Svg.camera_plus,"checkmark.svg": Svg.checkmark,"close.svg": Svg.close,"compass.svg": Svg.compass,"crosshair-blue-center.svg": Svg.crosshair_blue_center,"crosshair-blue.svg": Svg.crosshair_blue,"crosshair.svg": Svg.crosshair,"delete_icon.svg": Svg.delete_icon,"direction.svg": Svg.direction,"direction_gradient.svg": Svg.direction_gradient,"down.svg": Svg.down,"envelope.svg": Svg.envelope,"floppy.svg": Svg.floppy,"gear.svg": Svg.gear,"help.svg": Svg.help,"home.svg": Svg.home,"home_white_bg.svg": Svg.home_white_bg,"josm_logo.svg": Svg.josm_logo,"layers.svg": Svg.layers,"layersAdd.svg": Svg.layersAdd,"logo.svg": Svg.logo,"logout.svg": Svg.logout,"mapillary.svg": Svg.mapillary,"no_checkmark.svg": Svg.no_checkmark,"or.svg": Svg.or,"osm-logo-us.svg": Svg.osm_logo_us,"osm-logo.svg": Svg.osm_logo,"pencil.svg": Svg.pencil,"pop-out.svg": Svg.pop_out,"reload.svg": Svg.reload,"search.svg": Svg.search,"share.svg": Svg.share,"star.svg": Svg.star,"statistics.svg": Svg.statistics,"up.svg": Svg.up,"wikimedia-commons-white.svg": Svg.wikimedia_commons_white,"wikipedia.svg": Svg.wikipedia};}
+public static All = {"add.svg": Svg.add,"addSmall.svg": Svg.addSmall,"ampersand.svg": Svg.ampersand,"arrow-left-smooth.svg": Svg.arrow_left_smooth,"arrow-right-smooth.svg": Svg.arrow_right_smooth,"bug.svg": Svg.bug,"camera-plus.svg": Svg.camera_plus,"checkmark.svg": Svg.checkmark,"close.svg": Svg.close,"compass.svg": Svg.compass,"crosshair-blue-center.svg": Svg.crosshair_blue_center,"crosshair-blue.svg": Svg.crosshair_blue,"crosshair.svg": Svg.crosshair,"delete_icon.svg": Svg.delete_icon,"direction.svg": Svg.direction,"direction_gradient.svg": Svg.direction_gradient,"down.svg": Svg.down,"envelope.svg": Svg.envelope,"floppy.svg": Svg.floppy,"gear.svg": Svg.gear,"help.svg": Svg.help,"home.svg": Svg.home,"home_white_bg.svg": Svg.home_white_bg,"josm_logo.svg": Svg.josm_logo,"layers.svg": Svg.layers,"layersAdd.svg": Svg.layersAdd,"logo.svg": Svg.logo,"logout.svg": Svg.logout,"mapillary.svg": Svg.mapillary,"no_checkmark.svg": Svg.no_checkmark,"or.svg": Svg.or,"osm-logo-us.svg": Svg.osm_logo_us,"osm-logo.svg": Svg.osm_logo,"pencil.svg": Svg.pencil,"phone.svg": Svg.phone,"pop-out.svg": Svg.pop_out,"reload.svg": Svg.reload,"search.svg": Svg.search,"share.svg": Svg.share,"star.svg": Svg.star,"statistics.svg": Svg.statistics,"up.svg": Svg.up,"wikimedia-commons-white.svg": Svg.wikimedia_commons_white,"wikipedia.svg": Svg.wikipedia};}
diff --git a/UI/FullScreenMessageBoxHandler.ts b/UI/FullScreenMessageBoxHandler.ts
index 70d5d90..412d65a 100644
--- a/UI/FullScreenMessageBoxHandler.ts
+++ b/UI/FullScreenMessageBoxHandler.ts
@@ -45,10 +45,13 @@ export class FullScreenMessageBox extends UIElement {
return "";
}
this._content = State.state.fullScreenMessage.data;
- const uielement = new Combine([this._content]).SetStyle(
- "display:block;" +
+ const innerWrap = new Combine([this._content]).SetStyle(
+ "display: block;" +
"padding: 1em;" +
- "padding-bottom:6em;" +
+ "padding-bottom: 6em; "
+ );
+ const uielement = new Combine([innerWrap]).SetStyle(
+ "display:block;" +
`margin-bottom: var(--return-to-the-map-height);` +
"box-sizing:border-box;" +
`height:calc(100vh - var(--return-to-the-map-height));` +
diff --git a/UI/Popup/EditableTagRendering.ts b/UI/Popup/EditableTagRendering.ts
index ea61c89..0481eef 100644
--- a/UI/Popup/EditableTagRendering.ts
+++ b/UI/Popup/EditableTagRendering.ts
@@ -33,7 +33,7 @@ export default class EditableTagRendering extends UIElement {
this.dumbMode = false;
if (this._configuration.question !== undefined) {
- if (State.state.featureSwitchUserbadge.data) {
+ if (State.state?.featureSwitchUserbadge?.data) {
// 2.3em total width
const self = this;
this._editButton =
diff --git a/UI/Popup/FeatureInfoBox.ts b/UI/Popup/FeatureInfoBox.ts
index 9a669dc..7c1ac0b 100644
--- a/UI/Popup/FeatureInfoBox.ts
+++ b/UI/Popup/FeatureInfoBox.ts
@@ -44,9 +44,13 @@ export class FeatureInfoBox extends UIElement {
return new Combine([
new Combine([this._title, this._titleIcons])
.SetClass("featureinfobox-titlebar"),
- ...this._renderings,
- this._questionBox,
- ]).Render();
+ new Combine([
+ ...this._renderings,
+ this._questionBox
+ ]
+ ).SetClass("featureinfobox-content"),
+ ]).SetClass("featureinfobox")
+ .Render();
}
}
diff --git a/UI/UserBadge.ts b/UI/UserBadge.ts
index 04ffcd9..614c5c5 100644
--- a/UI/UserBadge.ts
+++ b/UI/UserBadge.ts
@@ -109,7 +109,7 @@ export class UserBadge extends UIElement {
const userName = new Link(
new FixedUiElement(user.name),
- `https://www.openstreetmap.org/user/${user.name}'`,
+ `https://www.openstreetmap.org/user/${user.name}`,
true);
diff --git a/assets/layers/bike_repair_station/bike_repair_station.json b/assets/layers/bike_repair_station/bike_repair_station.json
index 4089160..daa1e3d 100644
--- a/assets/layers/bike_repair_station/bike_repair_station.json
+++ b/assets/layers/bike_repair_station/bike_repair_station.json
@@ -89,6 +89,14 @@
}
]
},
+ "titleIcons": [
+ {
+ "render": "",
+ "condition": "operator=De Fietsambassade Gent"
+ },
+ "wikipedialink",
+ "osmlink"
+ ],
"tagRenderings": [
"images",
{
diff --git a/assets/layers/bike_shop/bike_shop.json b/assets/layers/bike_shop/bike_shop.json
index 613e5a6..1a93146 100644
--- a/assets/layers/bike_shop/bike_shop.json
+++ b/assets/layers/bike_shop/bike_shop.json
@@ -12,6 +12,13 @@
"#": "We select all bicycle shops, sport shops (but we try to weed out non-bicycle related shops), and any shop with a bicycle related tag",
"or": [
"shop=bicycle",
+ {
+ "#": "A bicycle rental with a network is something such as villo, bluebike, ... We don't want them",
+ "and": [
+ "amenity=bicycle_rental",
+ "network="
+ ]
+ },
{
"#": "if sport is defined and is not bicycle, it is retrackted; if bicycle retail/repair is marked as 'no', it is retracted too.",
"##": "There will be a few false-positives with this. They will get filtered out by people marking both 'not selling bikes' and 'not repairing bikes'. Furthermore, the OSMers will add a sports-subcategory on it",
@@ -68,7 +75,12 @@
}
},
{
- "if": "shop!~bicycle",
+ "if": {
+ "and": [
+ "shop!~bicycle",
+ "shop~*"
+ ]
+ },
"then": "Other shop"
},
{
@@ -127,6 +139,23 @@
"de": "Fahrradgeschäft"
}
},
+ {
+ "if": {
+ "and": [
+ "name~*",
+ {
+ "or": [
+ "service:bicycle:rental=yes",
+ "amenity=bicycle_rental"
+ ]
+ }
+ ]
+ },
+ "then": {
+ "nl": "Fietsverhuur {name}",
+ "en": "Bicycle rental {name}"
+ }
+ },
{
"if": "name~*",
"then": {
@@ -141,37 +170,34 @@
},
"titleIcons": [
{
- "mappings": [
- {
- "if": "service:bicycle:pump=yes",
- "then": ""
- }
- ]
+ "render": "",
+ "condition": "operator=De Fietsambassade Gent"
},
{
- "mappings": [
- {
- "if": "service:bicycle:diy=yes",
- "then": ""
- }
- ]
+ "condition": {
+ "or": [
+ "service:bicycle:pump=yes",
+ "service:bicycle:pump=seperate"
+ ]
+ },
+ "render": ""
},
{
- "mappings": [
- {
- "if": {
- "or": [
- "service:bicycle:cleaning=yes",
- "service:bicycle:cleaning=diy"
- ]
- },
- "then": ""
- }
- ]
+ "condition": "service:bicycle:diy=yes",
+ "render": ""
},
+ {
+ "condition": {
+ "or": [
+ "service:bicycle:cleaning=yes",
+ "service:bicycle:cleaning=diy"
+ ]
+ },
+ "render": ""
+ },
+ "phonelink",
"wikipedialink",
"osmlink"
-
],
"description": {
"en": "A shop specifically selling bicycles or related items",
@@ -182,6 +208,7 @@
{
"condition": {
"and": [
+ "shop~*",
"shop!~bicycle",
"shop!~sports"
]
@@ -257,6 +284,13 @@
"type": "opening_hours"
}
},
+ "description",
+ {
+ "render": "Enkel voor {access}",
+ "freeform": {
+ "key": "access"
+ }
+ },
{
"question": {
"en": "Does this shop sell bikes?",
@@ -439,6 +473,13 @@
"gl": "Esta tenda non ofrece unha bomba de ar para uso de calquera persoa",
"de": "Dieses Geschäft bietet für niemanden eine Fahrradpumpe an"
}
+ },
+ {
+ "if": "service:bicycle:pump=seperate",
+ "then": {
+ "en": "There is bicycle pump, it is shown as a seperate point ",
+ "nl": "Er is een fietspomp, deze is apart aangeduid"
+ }
}
]
},
@@ -470,6 +511,13 @@
"gl": "Non hai ferramentas aquí para arranxar a túa propia bicicleta",
"de": "Dieses Geschäft bietet keine Werkzeuge für Heimwerkerreparaturen an"
}
+ },
+ {
+ "if": "service:bicycle:diy=only_sold",
+ "then": {
+ "en": "Tools for DIY repair are only available if you bought/hire the bike in the shop",
+ "nl": "Het gereedschap aan om je fiets zelf te herstellen is enkel voor als je de fiets er kocht of huurt"
+ }
}
]
},
@@ -521,6 +569,10 @@
"icon": {
"render": "./assets/layers/bike_shop/repair_shop.svg",
"mappings": [
+ {
+ "if": "operator=De Fietsambassade Gent",
+ "then": "./assets/themes/cyclofix/fietsambassade_gent_logo_small.svg"
+ },
{
"if": "service:bicycle:retail=yes",
"then": "./assets/layers/bike_shop/shop.svg"
diff --git a/assets/layers/bike_shop/repair_station.svg b/assets/layers/bike_shop/tools.svg
similarity index 100%
rename from assets/layers/bike_shop/repair_station.svg
rename to assets/layers/bike_shop/tools.svg
diff --git a/assets/layers/cycling_themed_object/cycling_themed_objects.json b/assets/layers/cycling_themed_object/cycling_themed_objects.json
index 2f4be6e..7e57106 100644
--- a/assets/layers/cycling_themed_object/cycling_themed_objects.json
+++ b/assets/layers/cycling_themed_object/cycling_themed_objects.json
@@ -7,7 +7,7 @@
"de": "Mit Fahrrad zusammenhängendes Objekt"
},
"minzoom": 13,
- "overpassTags": "theme~cycling|bicycle",
+ "overpassTags": {"or": ["theme~cycling|bicycle", "sport=cycling"]},
"title": {
"render": {
"en": "Bike related object",
@@ -18,12 +18,13 @@
"mappings": [
{
"if": "name~*",
+ "then":"{name}"
+ },
+ {
+ "if": "leisure=track",
"then": {
- "en": "{name}",
- "nl": "{name}",
- "fr": "{name}",
- "gl": "{name}",
- "de": "{name}"
+ "nl": "Wielerpiste",
+ "en": "Cycle track"
}
}
]
diff --git a/assets/svg/ampersand.svg b/assets/svg/ampersand.svg
index f2df861..525a1ef 100644
--- a/assets/svg/ampersand.svg
+++ b/assets/svg/ampersand.svg
@@ -1,4 +1,4 @@
-e
+