Merge develop
|
@ -28,6 +28,7 @@ To develop and build MapComplete, you
|
||||||
|
|
||||||
0. Make a fork and clone the repository.
|
0. Make a fork and clone the repository.
|
||||||
0. Install the nodejs version specified in [.tool-versions](./.tool-versions)
|
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/).
|
- 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
|
0. Install `npm`. Linux: `sudo apt install npm` (or your favourite package manager), Windows: install
|
||||||
nodeJS: https://nodejs.org/en/download/
|
nodeJS: https://nodejs.org/en/download/
|
||||||
|
|
Before Width: | Height: | Size: 264 KiB After Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 216 KiB After Width: | Height: | Size: 228 KiB |
Before Width: | Height: | Size: 507 KiB After Width: | Height: | Size: 513 KiB |
Before Width: | Height: | Size: 531 KiB After Width: | Height: | Size: 534 KiB |
Before Width: | Height: | Size: 623 KiB After Width: | Height: | Size: 676 KiB |
Before Width: | Height: | Size: 718 KiB After Width: | Height: | Size: 719 KiB |
Before Width: | Height: | Size: 394 KiB After Width: | Height: | Size: 429 KiB |
Before Width: | Height: | Size: 449 KiB After Width: | Height: | Size: 453 KiB |
Before Width: | Height: | Size: 370 KiB After Width: | Height: | Size: 411 KiB |
Before Width: | Height: | Size: 443 KiB After Width: | Height: | Size: 476 KiB |
Before Width: | Height: | Size: 133 KiB After Width: | Height: | Size: 138 KiB |
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 146 KiB |
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 125 KiB |
Before Width: | Height: | Size: 148 KiB After Width: | Height: | Size: 147 KiB |
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 123 KiB |
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB |
2394
Docs/Tools/stats/stats.2021-10.json
Normal file
|
@ -8,6 +8,9 @@ import {FeatureSourceForLayer, Tiled} from "../FeatureSource";
|
||||||
import {Tiles} from "../../../Models/TileRange";
|
import {Tiles} from "../../../Models/TileRange";
|
||||||
import {BBox} from "../../BBox";
|
import {BBox} from "../../BBox";
|
||||||
import {OsmConnection} from "../../Osm/OsmConnection";
|
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 {
|
export default class OsmFeatureSource {
|
||||||
private readonly _backend: string;
|
private readonly _backend: string;
|
||||||
|
@ -26,6 +29,7 @@ export default class OsmFeatureSource {
|
||||||
markTileVisited?: (tileId: number) => void
|
markTileVisited?: (tileId: number) => void
|
||||||
};
|
};
|
||||||
private readonly downloadedTiles = new Set<number>()
|
private readonly downloadedTiles = new Set<number>()
|
||||||
|
private readonly allowedTags: TagsFilter;
|
||||||
|
|
||||||
constructor(options: {
|
constructor(options: {
|
||||||
handleTile: (tile: FeatureSourceForLayer & Tiled) => void;
|
handleTile: (tile: FeatureSourceForLayer & Tiled) => void;
|
||||||
|
@ -34,6 +38,7 @@ export default class OsmFeatureSource {
|
||||||
state: {
|
state: {
|
||||||
readonly filteredLayers: UIEventSource<FilteredLayer[]>;
|
readonly filteredLayers: UIEventSource<FilteredLayer[]>;
|
||||||
readonly osmConnection: OsmConnection;
|
readonly osmConnection: OsmConnection;
|
||||||
|
readonly layoutToUse: LayoutConfig
|
||||||
},
|
},
|
||||||
markTileVisited?: (tileId: number) => void
|
markTileVisited?: (tileId: number) => void
|
||||||
}) {
|
}) {
|
||||||
|
@ -64,6 +69,12 @@ export default class OsmFeatureSource {
|
||||||
}
|
}
|
||||||
self.isRunning.setData(false)
|
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> {
|
private async LoadTile(z, x, y): Promise<void> {
|
||||||
|
@ -85,6 +96,12 @@ export default class OsmFeatureSource {
|
||||||
{
|
{
|
||||||
flatProperties: true
|
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)
|
console.log("Tile geojson:", z, x, y, "is", geojson)
|
||||||
const index = Tiles.tile_index(z, x, y);
|
const index = Tiles.tile_index(z, x, y);
|
||||||
new PerLayerFeatureSourceSplitter(this.filteredLayers,
|
new PerLayerFeatureSourceSplitter(this.filteredLayers,
|
||||||
|
|
|
@ -57,6 +57,19 @@ export default class ImportButton extends Toggle {
|
||||||
new Combine([button, appliedTags]).SetClass("flex flex-col"),
|
new Combine([button, appliedTags]).SetClass("flex flex-col"),
|
||||||
State.state.featurePipeline.runningQuery
|
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
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -127,4 +127,4 @@
|
||||||
"https://thenounproject.com/term/usb-port/94768/"
|
"https://thenounproject.com/term/usb-port/94768/"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
|
@ -284,6 +284,6 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"overrideAll": {
|
"overrideAll": {
|
||||||
"allowSplit": true
|
"allowSplit": false
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -103,112 +103,61 @@
|
||||||
"presets": []
|
"presets": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "etymology_missing",
|
"id": "has_a_name",
|
||||||
"name": {
|
"name": {
|
||||||
"en": "No etymology data yet",
|
"en": "Has etymolgy",
|
||||||
"nl": "Zonder etymology"
|
"nl": "Heeft etymology info"
|
||||||
},
|
},
|
||||||
|
"minzoom": 12,
|
||||||
"source": {
|
"source": {
|
||||||
"osmTags": {
|
"osmTags": {
|
||||||
"and": [
|
"or": [
|
||||||
"name~*",
|
"name:etymology:wikidata~*",
|
||||||
{
|
"name:etymology~*"
|
||||||
"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"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minZoom": 16,
|
|
||||||
"title": {
|
"title": {
|
||||||
"render": {
|
"render": {
|
||||||
"*": "{name}"
|
"*": "{name}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"description": {
|
||||||
|
"en": "All objects which have an etymology known",
|
||||||
|
"nl": "Alle lagen met een gelinkt etymology"
|
||||||
|
},
|
||||||
"tagRenderings": [
|
"tagRenderings": [
|
||||||
{
|
{
|
||||||
"id": "name-origin-wikidata",
|
"id": "simple etymology",
|
||||||
"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>"
|
|
||||||
},
|
|
||||||
"render": {
|
"render": {
|
||||||
"*": "{name:etymology:wikidata}"
|
"en": "Named after {name:etymology}",
|
||||||
},
|
"nl": "Vernoemd naar {name:etymology}"
|
||||||
"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{"
|
|
||||||
},
|
},
|
||||||
"freeform": {
|
"freeform": {
|
||||||
"key": "name:etymology"
|
"key": "name:etymology"
|
||||||
},
|
}
|
||||||
"condition": "name:etymology:wikidata="
|
|
||||||
},
|
},
|
||||||
"wikipedia",
|
|
||||||
{
|
{
|
||||||
"id": "street-name-sign-image",
|
"id": "wikipedia-etymology",
|
||||||
"render": {
|
"render": {
|
||||||
"en": "{image_carousel(image:streetsign)}<br/>{image_upload(image:streetsign, Add image of a street name sign)}",
|
"*": "{wikipedia(name:etymology:wikidata):max-height:20rem}"
|
||||||
"nl": "{image_carousel(image:streetsign)}<br/>{image_upload(image:streetsign, Voeg afbeelding van straatnaambordje toe)}"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"color": "#fcb35388"
|
"icon": {
|
||||||
|
"render": "./assets/svg/bug.svg"
|
||||||
|
},
|
||||||
|
"width": {
|
||||||
|
"render": "8"
|
||||||
|
},
|
||||||
|
"iconSize": {
|
||||||
|
"render": "40,40,center"
|
||||||
|
},
|
||||||
|
"color": {
|
||||||
|
"render": "#00f"
|
||||||
|
},
|
||||||
|
"presets": []
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"hideFromOverview": true
|
||||||
}
|
}
|
|
@ -20,6 +20,17 @@
|
||||||
"startZoom": 17,
|
"startZoom": 17,
|
||||||
"widenFactor": 1.01,
|
"widenFactor": 1.01,
|
||||||
"socialImage": "",
|
"socialImage": "",
|
||||||
|
"hideFromOverview": true,
|
||||||
|
"lockLocation": [
|
||||||
|
[
|
||||||
|
51.51818357322121,
|
||||||
|
-0.09293317794799805
|
||||||
|
],
|
||||||
|
[
|
||||||
|
51.52898437160955,
|
||||||
|
-0.08147478103637695
|
||||||
|
]
|
||||||
|
],
|
||||||
"clustering": {
|
"clustering": {
|
||||||
"minNeededFeatures": 25,
|
"minNeededFeatures": 25,
|
||||||
"maxZoom": 17
|
"maxZoom": 17
|
||||||
|
|