diff --git a/Layers/CommonTagMappings.ts b/Layers/CommonTagMappings.ts
index 6417bfc40..f64b163fb 100644
--- a/Layers/CommonTagMappings.ts
+++ b/Layers/CommonTagMappings.ts
@@ -27,10 +27,34 @@ export class CommonTagMappings {
public static osmLink = new TagMappingOptions({
key: "id",
mapping: {
- "node/-1": "Over enkele momenten sturen we je punt naar OpenStreetMap"
+ "node/-1": ""
},
template: "" +
Img.osmAbstractLogo +
""
- })
+ });
+
+ public static wikipediaLink = new TagMappingOptions({
+ key: "wikipedia",
+ missing: "",
+ freeform: (value: string) => {
+ let link = "";
+ // @ts-ignore
+ if (value.startsWith("https")) {
+ link = value;
+ } else {
+
+ const splitted = value.split(":");
+ const language = splitted[0];
+ splitted.shift();
+ const page = splitted.join(":");
+ link = 'https://' + language + '.wikipedia.org/wiki/' + page;
+
+ }
+ return "" +
+ "" +
+ "";
+ }
+ });
}
\ No newline at end of file
diff --git a/Layers/KnownSet.ts b/Layers/KnownSet.ts
index 580e06582..5deeb1ebb 100644
--- a/Layers/KnownSet.ts
+++ b/Layers/KnownSet.ts
@@ -65,8 +65,8 @@ export class KnownSet {
"\n" +
"
De data komt van OpenStreetMap en je antwoorden worden daar ook opgeslaan. " +
"Omdat iedereen aan deze data bijdraagt, kunnen we geen garantie op correctheid bieden en heeft deze data geen juridische waarde
\n" +
- "
Je privacy is belangrijk. We tellen wel hoeveel personen de website bezoeken. Om je niet dubbel te tellen wordt er één coockie bijgehouden waar geen persoonlijke informatie in staat. " +
- "Als je inlogt, komt er een tweede coockie bij met je inloggegevens.
\n",
+ "
Je privacy is belangrijk. We tellen wel hoeveel personen de website bezoeken. Om je niet dubbel te tellen wordt er één cookie bijgehouden waar geen persoonlijke informatie in staat. " +
+ "Als je inlogt, komt er een tweede cookie bij met je inloggegevens.
\n",
"
Wil je meehelpen? \n" +
" Begin dan met een account\n" +
" te maken of\n" +
diff --git a/Layers/Park.ts b/Layers/Park.ts
index dbdb24402..7263961b3 100644
--- a/Layers/Park.ts
+++ b/Layers/Park.ts
@@ -3,7 +3,7 @@ import {Quests} from "../Quests";
import {TagMappingOptions} from "../UI/TagMapping";
import L from "leaflet"
import {CommonTagMappings} from "./CommonTagMappings";
-import {Tag} from "../Logic/TagsFilter";
+import {Or, Tag} from "../Logic/TagsFilter";
export class Park extends LayerDefinition {
@@ -11,7 +11,8 @@ export class Park extends LayerDefinition {
super();
this.name = "park";
this.icon = "./assets/tree_white_background.svg";
- this.overpassFilter = new Tag("leisure","park");
+ this.overpassFilter =
+ new Or([new Tag("leisure","park"), new Tag("landuse","village_green")]);
this.newElementTags = [new Tag("leisure", "park"),
new Tag("fixme", "Toegevoegd met MapComplete, geometry nog uit te tekenen")];
this.removeTouchingElements = true;
diff --git a/Logic/Basemap.ts b/Logic/Basemap.ts
index db53e4830..0f4f3e6a0 100644
--- a/Logic/Basemap.ts
+++ b/Logic/Basemap.ts
@@ -62,22 +62,21 @@ export class Basemap {
center: [location.data.lat, location.data.lon],
zoom: location.data.zoom,
layers: [this.osmLayer],
- attributionControl: false
});
- L.control.attribution({
- position: 'bottomleft'
- }).addTo(this.map);
this.Location = location;
const layerControl = L.control.layers(this.baseLayers, null,
{
- position: 'bottomleft',
+ position: 'bottomright',
hideSingleBase: true
})
layerControl.addTo(this.map);
+
+
+
- this.map.zoomControl.setPosition("bottomleft");
+ this.map.zoomControl.setPosition("bottomright");
const self = this;
this.map.on("moveend", function () {
diff --git a/Logic/ImageSearcher.ts b/Logic/ImageSearcher.ts
index 84f3335bc..08a630e37 100644
--- a/Logic/ImageSearcher.ts
+++ b/Logic/ImageSearcher.ts
@@ -15,7 +15,7 @@ export class ImageSearcher extends UIEventSource {
private readonly _wdItem = new UIEventSource("");
private readonly _commons = new UIEventSource("");
private _activated: boolean = false;
-
+
constructor(tags: UIEventSource) {
super([]);
diff --git a/Logic/Imgur.ts b/Logic/Imgur.ts
index 5785a114b..71118e586 100644
--- a/Logic/Imgur.ts
+++ b/Logic/Imgur.ts
@@ -60,6 +60,8 @@ export class Imgur {
$.ajax(settings).done(function (response) {
response = JSON.parse(response);
handleSuccessfullUpload(response.data.link);
+ }).fail((reason) => {
+ console.log("Uploading to IMGUR failed", reason)
});
}
diff --git a/Logic/OsmConnection.ts b/Logic/OsmConnection.ts
index 076ec664e..078f4f44a 100644
--- a/Logic/OsmConnection.ts
+++ b/Logic/OsmConnection.ts
@@ -90,12 +90,13 @@ export class OsmConnection {
*/
registerActivateOsmAUthenticationClass() {
+ const self = this;
const authElements = document.getElementsByClassName("activate-osm-authentication");
for (let i = 0; i < authElements.length; i++) {
let element = authElements.item(i);
// @ts-ignore
element.onclick = function () {
- this.AttemptLogin();
+ self.AttemptLogin();
}
}
}
diff --git a/Logic/OsmImageUploadHandler.ts b/Logic/OsmImageUploadHandler.ts
index bf6212cff..51a07761a 100644
--- a/Logic/OsmImageUploadHandler.ts
+++ b/Logic/OsmImageUploadHandler.ts
@@ -5,16 +5,20 @@ import {UIEventSource} from "../UI/UIEventSource";
import {ImageUploadFlow} from "../UI/ImageUploadFlow";
import {Changes} from "./Changes";
import {UserDetails} from "./OsmConnection";
+import {SlideShow} from "../UI/SlideShow";
export class OsmImageUploadHandler {
private _tags: UIEventSource;
private _changeHandler: Changes;
private _userdetails: UIEventSource;
+ private _slideShow: SlideShow;
constructor(tags: UIEventSource,
userdetails: UIEventSource,
- changeHandler: Changes
+ changeHandler: Changes,
+ slideShow : SlideShow
) {
+ this._slideShow = slideShow; // To move the slideshow (if any) to the last, just added element
if (tags === undefined || userdetails === undefined || changeHandler === undefined) {
throw "Something is undefined"
}
@@ -25,6 +29,7 @@ export class OsmImageUploadHandler {
private generateOptions(license: string) {
const tags = this._tags.data;
+ const self = this;
const title = tags.name ?? "Unknown area";
const description = [
@@ -46,6 +51,7 @@ export class OsmImageUploadHandler {
}
console.log("Adding image:" + freeIndex, url);
changes.addChange(tags.id, "image:" + freeIndex, url);
+ self._slideShow.MoveTo(-1); // set the last (thus newly added) image) to view
},
allDone: function () {
changes.uploadAll(function () {
diff --git a/Quests.ts b/Quests.ts
index 5b559937b..e649fe055 100644
--- a/Quests.ts
+++ b/Quests.ts
@@ -55,7 +55,7 @@ export class Quests {
static nameOf(name: string) : QuestionDefinition {
return QuestionDefinition.noNameOrNameQuestion("Wat is de officiële naam van dit " + name + "? " +
- "Gelieve geen naam uit te vinden",
+ "Veel gebieden hebben geen naam. Duid dit dan ook zo aan.",
"Dit " + name + " heeft geen naam", 20);
}
@@ -66,7 +66,7 @@ export class Quests {
"operator",
[{text: "Natuurpunt", value: "Natuurpunt"},
{text: "Het Agenschap voor Natuur en Bos", value: "Agentschap Natuur en Bos"},
- {text: "Een prive-eigenaar beheert dit", value: "private"}
+ {text: "Een prive-eigenaar", value: "private"}
]
).addUnrequiredTag("access", "private")
.addUnrequiredTag("access", "no");
diff --git a/README.md b/README.md
index 3d22e6e3a..59de3a0ae 100644
--- a/README.md
+++ b/README.md
@@ -56,4 +56,14 @@ Images are fetched from:
Images are uplaoded to imgur, as their API was way easier to handle. The URL is written into the changes
-The idea is that one in a while, the images are transfered to wikipedia
\ No newline at end of file
+The idea is that one in a while, the images are transfered to wikipedia
+
+
+
+
+# Attributions:
+
+Data from OpenStreetMap
+Images from Wikipedia/Wikimedia
+
+https://commons.wikimedia.org/wiki/File:Camera_font_awesome.svg
diff --git a/UI/DropDownUI.ts b/UI/DropDownUI.ts
new file mode 100644
index 000000000..b551eea00
--- /dev/null
+++ b/UI/DropDownUI.ts
@@ -0,0 +1,47 @@
+import {UIElement} from "./UIElement";
+import {UIEventSource} from "./UIEventSource";
+
+export class DropDownUI extends UIElement {
+
+ selectedElement: UIEventSource
+ private _label: string;
+ private _values: { value: string; shown: string }[];
+
+ constructor(label: string, values: { value: string, shown: string }[]) {
+ super(undefined);
+ this._label = label;
+ this._values = values;
+ this.selectedElement = new UIEventSource(values[0].value);
+
+ }
+
+
+ protected InnerRender(): string {
+
+ let options = "";
+ for (const value of this._values) {
+ options += ""
+ }
+
+ return "";
+ }
+
+ InnerUpdate(htmlElement: HTMLElement) {
+ super.InnerUpdate(htmlElement);
+
+ const self = this;
+ const e = document.getElementById("dropdown-" + this.id);
+ e.onchange = function () {
+ // @ts-ignore
+ const selectedValue = e.options[e.selectedIndex].value;
+
+ self.selectedElement.setData(selectedValue);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/UI/FeatureInfoBox.ts b/UI/FeatureInfoBox.ts
index 1431da52b..4444fa74e 100644
--- a/UI/FeatureInfoBox.ts
+++ b/UI/FeatureInfoBox.ts
@@ -11,6 +11,7 @@ import {UserDetails} from "../Logic/OsmConnection";
import {Img} from "./Img";
import {CommonTagMappings} from "../Layers/CommonTagMappings";
import {Tag} from "../Logic/TagsFilter";
+import {ImageUploadFlow} from "./ImageUploadFlow";
export class FeatureInfoBox extends UIElement {
@@ -27,6 +28,8 @@ export class FeatureInfoBox extends UIElement {
private _changes: Changes;
private _userDetails: UIEventSource;
private _imageElement: ImageCarousel;
+ private _pictureUploader: UIElement;
+ private _wikipedialink: UIElement;
constructor(
@@ -66,27 +69,37 @@ export class FeatureInfoBox extends UIElement {
this._infoElements = infoboxes;
this._osmLink = new TagMapping(CommonTagMappings.osmLink, this._tagsES);
+ this._wikipedialink = new TagMapping(CommonTagMappings.wikipediaLink, this._tagsES);
+ this._pictureUploader = new OsmImageUploadHandler(tagsES, userDetails, changes, this._imageElement.slideshow).getUI();
}
InnerRender(): string {
+ let questions = "";
+
+ if (this._userDetails.data.loggedIn) {
+ questions = this._questions.HideOnEmpty(true).Render();
+ }
return "
Loading... If this message persists, check if javascript is enabled and if no extension (uMatrix) is blocking it.
+ Loading... If this message persists, check if javascript is enabled and if no extension (uMatrix) is blocking it.
diff --git a/index.ts b/index.ts
index 8fa5aa562..5d5ba0823 100644
--- a/index.ts
+++ b/index.ts
@@ -26,7 +26,7 @@ if (location.hostname === "localhost" || location.hostname === "127.0.0.1") {
dryRun = true;
// If you have a testfile somewhere, enable this to spoof overpass
// This should be hosted independantly, e.g. with `cd assets; webfsd -p 8080` + a CORS plugin to disable cors rules
- Overpass.testUrl = "http://127.0.0.1:8080/test.json";
+ // Overpass.testUrl = "http://127.0.0.1:8080/test.json";
}
@@ -124,7 +124,6 @@ addButton.Update();
* Show the questions and information for the selected element on the leftMessage
*/
selectedElement.addCallback((data) => {
- console.log("Got selection");
// Which is the applicable set?
for (const layer of questSetToRender.layers) {
diff --git a/test.html b/test.html
index e7381bacd..5b263e070 100644
--- a/test.html
+++ b/test.html
@@ -5,7 +5,7 @@
-