diff --git a/Logic/FeatureSource/FeaturePipeline.ts b/Logic/FeatureSource/FeaturePipeline.ts index 9a32ba25f..fd17de4e6 100644 --- a/Logic/FeatureSource/FeaturePipeline.ts +++ b/Logic/FeatureSource/FeaturePipeline.ts @@ -304,7 +304,10 @@ export default class FeaturePipeline { } }), - updater) + updater, + {handleLeftovers: (leftOvers) => { + console.warn("Overpass returned a few non-matched features:", leftOvers) + }}) // Also load points/lines that are newly added. @@ -323,7 +326,10 @@ export default class FeaturePipeline { perLayer.features.addCallbackAndRunD(_ => self.onNewDataLoaded(perLayer)) }, - newGeometry + newGeometry, + {handleLeftovers: (leftOvers) => { + console.warn("Got some leftovers from the filteredLayers: ", leftOvers) + }} ) diff --git a/Models/Constants.ts b/Models/Constants.ts index d02d9ec55..61c3d8eb1 100644 --- a/Models/Constants.ts +++ b/Models/Constants.ts @@ -2,7 +2,7 @@ import {Utils} from "../Utils"; export default class Constants { - public static vNumber = "0.14.0-rc-1"; + public static vNumber = "0.14.0-rc-2"; public static ImgurApiKey = '7070e7167f0a25a' public static readonly mapillary_client_token_v4 = "MLY|4441509239301885|b40ad2d3ea105435bd40c7e76993ae85" diff --git a/Models/ThemeConfig/Conversion/LegacyJsonConvert.ts b/Models/ThemeConfig/Conversion/LegacyJsonConvert.ts index 8ea2783ce..69faf4d28 100644 --- a/Models/ThemeConfig/Conversion/LegacyJsonConvert.ts +++ b/Models/ThemeConfig/Conversion/LegacyJsonConvert.ts @@ -236,7 +236,7 @@ class ExpandTagRendering extends Conversion { const knownTagRenderings: Map = state.tagRenderings; const errors = []; const warnings = []; - const layers: LayerConfigJson[] = theme.layers; // Layers should be expanded at this point - + const layers: LayerConfigJson[] = theme.layers; // Layers should be expanded at this point + knownTagRenderings.forEach((value, key) => { value.id = key; }) @@ -954,11 +954,25 @@ class AddDefaultLayers extends DesugaringStep { convert(state: DesugaringContext, json: LayoutConfigJson, context: string): { result: LayoutConfigJson; errors: string[]; warnings: string[] } { const errors = [] + const warnings = [] json.layers = [...json.layers] if (json.id === "personal") { + json.layers = [] + for (const publicLayer of AllKnownLayouts.AllPublicLayers()) { + const id = publicLayer.id + const config = state.sharedLayers.get(id) + if(Constants.added_by_default.indexOf(id) >= 0){ + continue; + } + if(config === undefined){ + // This is a layer which is coded within a public theme, not as separate .json + continue + } + json.layers.push(config) + } const publicIds = AllKnownLayouts.AllPublicLayers().map(l => l.id) - json.layers = publicIds.map(id => state.sharedLayers.get(id)) + publicIds.map(id => state.sharedLayers.get(id)) } for (const layerName of Constants.added_by_default) { @@ -968,10 +982,11 @@ class AddDefaultLayers extends DesugaringStep { } json.layers.push(v) } + return { result: json, errors, - warnings: [] + warnings }; } diff --git a/Models/ThemeConfig/TagRenderingConfig.ts b/Models/ThemeConfig/TagRenderingConfig.ts index 803d9dd64..f85f6b19a 100644 --- a/Models/ThemeConfig/TagRenderingConfig.ts +++ b/Models/ThemeConfig/TagRenderingConfig.ts @@ -373,6 +373,9 @@ export default class TagRenderingConfig { return mapping.then; } if (mapping.if.matchesProperties(tags)) { + if(this.id === "uk_addresses_placename"){ + console.log("Matched",mapping.if,"with ",tags["addr:place"]) + } return mapping.then; } } diff --git a/UI/Popup/ImportButton.ts b/UI/Popup/ImportButton.ts index 4d7c409d3..1d65a2432 100644 --- a/UI/Popup/ImportButton.ts +++ b/UI/Popup/ImportButton.ts @@ -4,7 +4,6 @@ import {UIEventSource} from "../../Logic/UIEventSource"; import Combine from "../Base/Combine"; import {VariableUiElement} from "../Base/VariableUIElement"; import Translations from "../i18n/Translations"; -import Constants from "../../Models/Constants"; import Toggle from "../Input/Toggle"; import CreateNewNodeAction from "../../Logic/Osm/Actions/CreateNewNodeAction"; import Loading from "../Base/Loading"; @@ -37,8 +36,12 @@ import TagApplyButton from "./TagApplyButton"; import LayerConfig from "../../Models/ThemeConfig/LayerConfig"; import * as conflation_json from "../../assets/layers/conflation/conflation.json"; import {GeoOperations} from "../../Logic/GeoOperations"; +import {LoginToggle} from "./LoginButton"; - +/** + * A helper class for the various import-flows. + * An import-flow always starts with a 'Import this'-button. Upon click, a custom confirmation panel is provided + */ abstract class AbstractImportButton implements SpecialVisualizations { public readonly funcName: string public readonly docs: string @@ -93,7 +96,6 @@ ${Utils.special_visualizations_importRequirementDocs} constr(state, tagSource: UIEventSource, argsRaw, guiState) { - const self = this; /** * Some generic import button pre-validation is implemented here: * - Are we logged in? @@ -136,25 +138,11 @@ ${Utils.special_visualizations_importRequirementDocs} // Explanation of the tags that will be applied onto the imported/conflated object let tagSpec = args.tags; - if(tagSpec.indexOf(" ")< 0 && tagSpec.indexOf(";") < 0){ + if(tagSpec.indexOf(" ")< 0 && tagSpec.indexOf(";") < 0 && tagSource.data[args.tags] !== undefined){ // This is probably a key tagSpec = tagSource.data[args.tags] + console.warn("Using tagspec tagSource.data["+args.tags+"] which is ",tagSpec) } - - const newTags = TagApplyButton.generateTagsToApply(tagSpec, tagSource) - const appliedTags = new Toggle( - new VariableUiElement( - newTags.map(tgs => { - const filteredTags = tgs.filter(tg => self.showRemovedTags || (tg.value ?? "") !== "") - const asText = new And(filteredTags) - .asHumanString(true, true, {}) - - return t0.presetInfo.Subs({tags: asText}).SetClass("subtle"); - })), - undefined, - state.osmConnection.userDetails.map(ud => ud.csCount >= Constants.userJourney.tagsVisibleAt) - ) - const importClicked = new UIEventSource(false); inviteToImportButton.onClick(() => { @@ -179,7 +167,7 @@ ${Utils.special_visualizations_importRequirementDocs} const importFlow = new Toggle( new Toggle( new Loading(t0.stillLoading), - new Combine([importGuidingPanel, appliedTags]).SetClass("flex flex-col"), + importGuidingPanel, state.featurePipeline.runningQuery ), inviteToImportButton, @@ -187,7 +175,7 @@ ${Utils.special_visualizations_importRequirementDocs} ); return new Toggle( - new Toggle( + new LoginToggle( new Toggle( new Toggle( t.hasBeenImported, @@ -198,7 +186,7 @@ ${Utils.special_visualizations_importRequirementDocs} state.locationControl.map(l => l.zoom >= 18) ), pleaseLoginButton, - state.osmConnection.isLoggedIn + state ), t.wrongType, new UIEventSource(this.canBeImported(feature))) @@ -210,9 +198,10 @@ ${Utils.special_visualizations_importRequirementDocs} if (originalFeatureTags !== undefined) { const tags = baseArgs.tags - if(tags.indexOf(" ") < 0 && tags.indexOf(";") < 0){ - // This might be a propertie to expand... + if(tags.indexOf(" ") < 0 && tags.indexOf(";") < 0 && originalFeatureTags.data[tags] !== undefined){ + // This might be a property to expand... const items : string = originalFeatureTags.data[tags] + console.warn("Using tagspec tagSource.data["+tags+"] which is ",items) baseArgs["newTags"] = TagApplyButton.generateTagsToApply(items, originalFeatureTags) }else{ baseArgs["newTags"] = TagApplyButton.generateTagsToApply(tags, originalFeatureTags) @@ -569,7 +558,6 @@ export class ImportPointButton extends AbstractImportButton { const presetInfo = { tags: args.newTags.data, icon: () => new Img(args.icon), - description: Translations.WT(args.text), layerToAddTo: state.filteredLayers.data.filter(l => l.layerDef.id === args.targetLayer)[0], name: args.text, title: Translations.WT(args.text), diff --git a/assets/layers/address/address.json b/assets/layers/address/address.json index be970c1f6..cdd4621d6 100644 --- a/assets/layers/address/address.json +++ b/assets/layers/address/address.json @@ -12,8 +12,7 @@ "osmTags": { "or": [ "addr:housenumber~*", - "addr:street~*", - "ref:inspireid~*" + "addr:street~*" ] } }, diff --git a/assets/themes/personal/personal.json b/assets/themes/personal/personal.json index c39039d70..b5474cda1 100644 --- a/assets/themes/personal/personal.json +++ b/assets/themes/personal/personal.json @@ -48,8 +48,12 @@ "version": "0", "startLat": 0, "startLon": 0, - "startZoom": 16, + "startZoom": 0, "widenFactor": 1.2, - "overpassMaxZoom": 0, + "#note": "The 'overpassMaxZoom' should be exactly the same as or less then the overrideAll", + "overpassMaxZoom": 15, + "overrideAll": { + "minZoom": 16 + }, "layers": [] } \ No newline at end of file diff --git a/assets/themes/uk_addresses/license_info.json b/assets/themes/uk_addresses/license_info.json index 4bcce8003..cfad1b9d7 100644 --- a/assets/themes/uk_addresses/license_info.json +++ b/assets/themes/uk_addresses/license_info.json @@ -77,5 +77,15 @@ "Pieter Vander Vennet" ], "sources": [] + }, + { + "path": "stamp.jpg", + "license": "CC-BY 2.0", + "authors": [ + "Mark Morgan" + ], + "sources": [ + "https://commons.wikimedia.org/wiki/File:Queen_Elizabeth_II_Virgin_Islands_stamp.jpg" + ] } ] \ No newline at end of file diff --git a/assets/themes/uk_addresses/stamp.jpg b/assets/themes/uk_addresses/stamp.jpg new file mode 100644 index 000000000..e54290b27 Binary files /dev/null and b/assets/themes/uk_addresses/stamp.jpg differ diff --git a/assets/themes/uk_addresses/uk_addresses.json b/assets/themes/uk_addresses/uk_addresses.json index 07d1db5f0..8941b8614 100644 --- a/assets/themes/uk_addresses/uk_addresses.json +++ b/assets/themes/uk_addresses/uk_addresses.json @@ -66,7 +66,7 @@ "calculatedTags": [ "_has_address=feat.overlapWith('address').length > 0" ], - "#mapRendering": [ + "mapRendering": [ { "width": 2, "color": { @@ -80,13 +80,18 @@ } } ], - "mapRendering": null + "shownByDefault": false, + "name": { + "en": "Inspire polygons" + } }, { "id": "to_import", "source": { "geoJson": "https://osm-uk-addresses.russss.dev/addresses/{z}/{x}/{y}.json", - "osmTags": "inspireid~*", + "osmTags": { + "and": ["ref:GB:inspire~*","id!~node/.*"] + }, "geoJsonZoomLevel": 16, "isOsmCache": false }, @@ -126,7 +131,7 @@ }, { "id": "uk_addresses_import_button", - "render": "{import_button(address,ref:inspireid=$inspireid, Add this address, ./assets/themes/uk_addresses/housenumber_add.svg)}" + "render": "{import_button(address,ref:GB:inspire=$ref:GB:inspire;ref:GB:uprn=$ref:GB:uprn$, Add this address, ./assets/themes/uk_addresses/housenumber_add.svg)}" } ], "calculatedTags": [ @@ -203,7 +208,7 @@ "or": [ "addr:housenumber~*", "addr:street~*", - "ref:inspireid~*" + "ref:GB:inspire~*" ] } }, @@ -285,6 +290,7 @@ "then": "This building has no housename" }, { + "#": "By adding nohousenumber!=yes, this option will trigger when first added, but will be untriggered if a housenumber is added, resulting in the question poping up!", "if": { "and": [ "addr:housename=", @@ -298,7 +304,7 @@ }, { "id": "uk_addresses_unit", - "render": "The sub-part of this address is {addr:unit}", + "render": "The sub-part of this address is {addr:unit}", "question": { "en": "What is the unit indication of this address?
This is the letter or number of the letterbox here, if multiple letterboxes share the same street and housenumber. If there are multiple at the same location, add them here with a ; between them
" }, @@ -346,6 +352,26 @@ ] }, + { + "id": "uk_addresses_placename", + "question": { + "en": "What is the place or locality?
This is additional information if the streetname alone isn't enough to find this address. Typical examples are 'Technology Park', 'XYZ Terrace', ...
" + }, + "render": { + "en": "The placename is {addr:place}" + }, + "freeform": { + "key": "addr:place" + }, + "mappings": [ + { + "if": "addr:place=", + "then": { + "en": "No extra placename is given or needed" + } + } + ] + }, { "id": "fixme", "render": "This address is complicated - therefore someone has given a description of what should be fixed:{fixme}", @@ -358,7 +384,7 @@ "mappings": [ { "if": "fixme=", - "then": "Is this address very complicated? - write something here to explain complicated cases" + "then": "Is this address complicated? Write something here to explain this case. An experienced mapper will have a look at it" } ] }, @@ -368,6 +394,12 @@ "render": { "en": "{image_carousel(image:address)}
{image_upload(image:address, Add image of the address)}" } + }, + { + "id": "preview", + "render": { + "en": "To send a letter to this addres, you would write:
Name of the inhabitant
{addr:housename}
{addr:unit} {addr:housenumber} {addr:street}
{addr:place}
Suburb
Town
Postal code
" + } } ], "mapRendering": [ diff --git a/langs/themes/de.json b/langs/themes/de.json index 40f8d193c..627902acf 100644 --- a/langs/themes/de.json +++ b/langs/themes/de.json @@ -841,7 +841,7 @@ }, "grb": { "layers": { - "2": { + "1": { "tagRenderings": { "building type": { "question": "Was ist das für ein Gebäude?" diff --git a/langs/themes/en.json b/langs/themes/en.json index 452d3a19b..22faa8e7b 100644 --- a/langs/themes/en.json +++ b/langs/themes/en.json @@ -839,7 +839,7 @@ "grb": { "description": "This theme is an attempt to help automating the GRB import.", "layers": { - "2": { + "1": { "tagRenderings": { "building type": { "question": "What kind of building is this?" @@ -1271,6 +1271,9 @@ "uk_addresses": { "description": "Contribute to OpenStreetMap by filling out address information", "layers": { + "0": { + "name": "Inspire polygons" + }, "1": { "tagRenderings": { "uk_addresses_embedding_outline": { @@ -1301,6 +1304,9 @@ "fixme": { "question": "What should be fixed here? Please explain what the address is" }, + "preview": { + "render": "To send a letter to this addres, you would write:
Name of the inhabitant
{addr:housename}
{addr:unit} {addr:housenumber} {addr:street}
{addr:place}
Suburb
Town
Postal code
" + }, "uk_addresses_explanation_osm": { "render": "This address is saved in OpenStreetMap" }, @@ -1313,9 +1319,21 @@ "question": "What is the number of this house?", "render": "The housenumber is {addr:housenumber}" }, + "uk_addresses_placename": { + "mappings": { + "0": { + "then": "No extra placename is given or needed" + } + }, + "question": "What is the place or locality?
This is additional information if the streetname alone isn't enough to find this address. Typical examples are 'Technology Park', 'XYZ Terrace', ...
", + "render": "The placename is {addr:place}" + }, "uk_addresses_street": { "question": "What street is this address located in?", "render": "This address is in street {addr:street}" + }, + "uk_addresses_unit": { + "question": "What is the unit indication of this address?
This is the letter or number of the letterbox here, if multiple letterboxes share the same street and housenumber. If there are multiple at the same location, add them here with a ; between them
" } }, "title": { diff --git a/langs/themes/nl.json b/langs/themes/nl.json index e01e58387..ef2da9f7a 100644 --- a/langs/themes/nl.json +++ b/langs/themes/nl.json @@ -769,7 +769,7 @@ "grb": { "description": "Dit thema helpt het GRB importeren.", "layers": { - "2": { + "1": { "tagRenderings": { "grb-fixme": { "mappings": {