Merge develop

This commit is contained in:
Pieter Vander Vennet 2021-10-08 04:40:33 +02:00
commit 38dcf3578c
26 changed files with 20512 additions and 86 deletions

View file

@ -28,6 +28,7 @@ To develop and build MapComplete, you
0. Make a fork and clone the repository.
0. Install the nodejs version specified in [.tool-versions](./.tool-versions)
- On linux: install npm first `sudo apt install npm`, then install `n` using npm: ` npm install -g n`, which can then install node with `n install <node-version>`
- You can [use asdf to manage your runtime versions](https://asdf-vm.com/).
0. Install `npm`. Linux: `sudo apt install npm` (or your favourite package manager), Windows: install
nodeJS: https://nodejs.org/en/download/

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 KiB

After

Width:  |  Height:  |  Size: 280 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 KiB

After

Width:  |  Height:  |  Size: 228 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 507 KiB

After

Width:  |  Height:  |  Size: 513 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 531 KiB

After

Width:  |  Height:  |  Size: 534 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 623 KiB

After

Width:  |  Height:  |  Size: 676 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 718 KiB

After

Width:  |  Height:  |  Size: 719 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 394 KiB

After

Width:  |  Height:  |  Size: 429 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 449 KiB

After

Width:  |  Height:  |  Size: 453 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 KiB

After

Width:  |  Height:  |  Size: 411 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 443 KiB

After

Width:  |  Height:  |  Size: 476 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 138 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 146 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 125 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 147 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

After

Width:  |  Height:  |  Size: 123 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Before After
Before After

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -8,6 +8,9 @@ import {FeatureSourceForLayer, Tiled} from "../FeatureSource";
import {Tiles} from "../../../Models/TileRange";
import {BBox} from "../../BBox";
import {OsmConnection} from "../../Osm/OsmConnection";
import LayoutConfig from "../../../Models/ThemeConfig/LayoutConfig";
import {Or} from "../../Tags/Or";
import {TagsFilter} from "../../Tags/TagsFilter";
export default class OsmFeatureSource {
private readonly _backend: string;
@ -26,6 +29,7 @@ export default class OsmFeatureSource {
markTileVisited?: (tileId: number) => void
};
private readonly downloadedTiles = new Set<number>()
private readonly allowedTags: TagsFilter;
constructor(options: {
handleTile: (tile: FeatureSourceForLayer & Tiled) => void;
@ -34,6 +38,7 @@ export default class OsmFeatureSource {
state: {
readonly filteredLayers: UIEventSource<FilteredLayer[]>;
readonly osmConnection: OsmConnection;
readonly layoutToUse: LayoutConfig
},
markTileVisited?: (tileId: number) => void
}) {
@ -64,6 +69,12 @@ export default class OsmFeatureSource {
}
self.isRunning.setData(false)
})
const neededLayers = options.state.layoutToUse.layers
.filter( layer => !layer.doNotDownload )
.filter(layer => layer.source.geojsonSource === undefined || layer.source.isOsmCacheLayer)
this.allowedTags = new Or(neededLayers.map(l => l.source.osmTags))
}
private async LoadTile(z, x, y): Promise<void> {
@ -85,6 +96,12 @@ export default class OsmFeatureSource {
{
flatProperties: true
});
// The geojson contains _all_ features at the given location
// We only keep what is needed
geojson.features = geojson.features.filter(feature => this.allowedTags.matchesProperties(feature.properties))
console.log("Tile geojson:", z, x, y, "is", geojson)
const index = Tiles.tile_index(z, x, y);
new PerLayerFeatureSourceSplitter(this.filteredLayers,

View file

@ -57,6 +57,19 @@ export default class ImportButton extends Toggle {
new Combine([button, appliedTags]).SetClass("flex flex-col"),
State.state.featurePipeline.runningQuery
)
super(t.hasBeenImported, withLoadingCheck, isImported)
const importButton = new Toggle(t.hasBeenImported, withLoadingCheck, isImported)
const pleaseLoginButton =
new Toggle(t.pleaseLogin.Clone()
.onClick(() => State.state.osmConnection.AttemptLogin())
.SetClass("login-button-friendly"),
undefined,
State.state.featureSwitchUserbadge)
super(importButton,
pleaseLoginButton,
State.state.osmConnection.isLoggedIn
)
}
}

View file

@ -127,4 +127,4 @@
"https://thenounproject.com/term/usb-port/94768/"
]
}
]
]

View file

@ -284,6 +284,6 @@
}
],
"overrideAll": {
"allowSplit": true
"allowSplit": false
}
}

View file

@ -103,112 +103,61 @@
"presets": []
},
{
"id": "etymology_missing",
"id": "has_a_name",
"name": {
"en": "No etymology data yet",
"nl": "Zonder etymology"
"en": "Has etymolgy",
"nl": "Heeft etymology info"
},
"minzoom": 12,
"source": {
"osmTags": {
"and": [
"name~*",
{
"or": [
"highway~*",
"building~*",
"amenity=place_of_worship",
"man_made=bridge",
"heritage~*",
"leisure=park",
"leisure=nature_reserve",
"landuse=forest",
"natural=water"
]
},
{
"#": "We remove various features which often are too big and clutter the map",
"and": [
"healtcare=",
"shop=",
"school=",
"place=",
"landuse!=residential"
]
}
"or": [
"name:etymology:wikidata~*",
"name:etymology~*"
]
}
},
"minZoom": 16,
"title": {
"render": {
"*": "{name}"
}
},
"description": {
"en": "All objects which have an etymology known",
"nl": "Alle lagen met een gelinkt etymology"
},
"tagRenderings": [
{
"id": "name-origin-wikidata",
"question": {
"en": "What is the wikidata entry for the thing this feature is named after?",
"nl": "Wat is de wikidata-entry voor het object waarnaar dit vernoemd is?<br /><span class='subtle'>Plak hier de wikidata entry of sla over</span>"
},
"id": "simple etymology",
"render": {
"*": "{name:etymology:wikidata}"
},
"freeform": {
"key": "name:etymology:wikidata",
"type": "wikidata",
"helperArgs": [
"name",
{
"removePostfixes": [
"steenweg",
"heirbaan",
"baan",
"straat",
"street",
"weg",
"dreef",
"laan",
"boulevard",
"pad",
"path",
"plein",
"square",
"plaza",
"wegel",
"kerk",
"church",
"kaai"
]
}
]
}
},
{
"id": "name-origin",
"question": {
"en": "What is the origin of this name?",
"nl": "Naar wat is dit vernoemd?"
},
"render": {
"en": "<div class='subtle'>This feature is named after</div><br />{name:etymology{",
"nl": "<div class='subtle'>Dit is vernoemd naar</div><br />{name:etymology{"
"en": "Named after {name:etymology}",
"nl": "Vernoemd naar {name:etymology}"
},
"freeform": {
"key": "name:etymology"
},
"condition": "name:etymology:wikidata="
}
},
"wikipedia",
{
"id": "street-name-sign-image",
"id": "wikipedia-etymology",
"render": {
"en": "{image_carousel(image:streetsign)}<br/>{image_upload(image:streetsign, Add image of a street name sign)}",
"nl": "{image_carousel(image:streetsign)}<br/>{image_upload(image:streetsign, Voeg afbeelding van straatnaambordje toe)}"
"*": "{wikipedia(name:etymology:wikidata):max-height:20rem}"
}
}
],
"color": "#fcb35388"
"icon": {
"render": "./assets/svg/bug.svg"
},
"width": {
"render": "8"
},
"iconSize": {
"render": "40,40,center"
},
"color": {
"render": "#00f"
},
"presets": []
}
]
],
"hideFromOverview": true
}

View file

@ -20,6 +20,17 @@
"startZoom": 17,
"widenFactor": 1.01,
"socialImage": "",
"hideFromOverview": true,
"lockLocation": [
[
51.51818357322121,
-0.09293317794799805
],
[
51.52898437160955,
-0.08147478103637695
]
],
"clustering": {
"minNeededFeatures": 25,
"maxZoom": 17