diff --git a/Customizations/AllKnownLayers.ts b/Customizations/AllKnownLayers.ts index 4f142cfeb..0f32405e1 100644 --- a/Customizations/AllKnownLayers.ts +++ b/Customizations/AllKnownLayers.ts @@ -21,7 +21,7 @@ export default class AllKnownLayers { public static added_by_default: string[] = ["gps_location", "gps_location_history", "home_location", "gps_track"] - public static no_include: string[] = ["conflation", "left_right_style", "split_point","current_view"] + public static no_include: string[] = ["conflation", "left_right_style", "split_point","current_view","matchpoint"] /** * Layer IDs of layers which have special properties through built-in hooks */ diff --git a/Models/ThemeConfig/Json/PointRenderingConfigJson.ts b/Models/ThemeConfig/Json/PointRenderingConfigJson.ts index 75e663361..f214687ba 100644 --- a/Models/ThemeConfig/Json/PointRenderingConfigJson.ts +++ b/Models/ThemeConfig/Json/PointRenderingConfigJson.ts @@ -15,7 +15,7 @@ export default interface PointRenderingConfigJson { * All the locations that this point should be rendered at. * Using `location: ["point", "centroid"] will always render centerpoint */ - location: ("point" | "centroid" | "start" | "end")[] + location: ("point" | "centroid" | "start" | "end" | string)[] /** * The icon for an element. diff --git a/Models/ThemeConfig/PointRenderingConfig.ts b/Models/ThemeConfig/PointRenderingConfig.ts index 7160a251d..7ecb713e7 100644 --- a/Models/ThemeConfig/PointRenderingConfig.ts +++ b/Models/ThemeConfig/PointRenderingConfig.ts @@ -16,7 +16,7 @@ import {VariableUiElement} from "../../UI/Base/VariableUIElement"; export default class PointRenderingConfig extends WithContextLoader { private static readonly allowed_location_codes = new Set(["point", "centroid", "start", "end"]) - public readonly location: Set<"point" | "centroid" | "start" | "end"> + public readonly location: Set<"point" | "centroid" | "start" | "end" | string> public readonly icon: TagRenderingConfig; public readonly iconBadges: { if: TagsFilter; then: TagRenderingConfig }[]; @@ -69,7 +69,7 @@ export default class PointRenderingConfig extends WithContextLoader { if (iconPath !== undefined && iconPath.startsWith(Utils.assets_path)) { const iconKey = iconPath.substr(Utils.assets_path.length); if (Svg.All[iconKey] === undefined) { - throw "Builtin SVG asset not found: " + iconPath; + throw context+": builtin SVG asset not found: " + iconPath; } } this.iconSize = this.tr("iconSize", "40,40,center"); diff --git a/UI/Input/LocationInput.ts b/UI/Input/LocationInput.ts index fe2f66bfe..107b39639 100644 --- a/UI/Input/LocationInput.ts +++ b/UI/Input/LocationInput.ts @@ -15,20 +15,10 @@ import {FixedUiElement} from "../Base/FixedUiElement"; import ShowDataLayer from "../ShowDataLayer/ShowDataLayer"; import BaseUIElement from "../BaseUIElement"; import Toggle from "./Toggle"; - +import * as matchpoint from "../../assets/layers/matchpoint/matchpoint.json" export default class LocationInput extends InputElement implements MinimapObj { - private static readonly matchLayer = new LayerConfig( - { - id: "matchpoint", source: { - osmTags: {and: []} - }, - mapRendering: [{ - location: ["point","centroid"], - icon: "./assets/svg/crosshair-empty.svg" - }] - }, "matchpoint icon", true - ) + private static readonly matchLayer = new LayerConfig(matchpoint, "LocationInput.matchpoint", true) IsSelected: UIEventSource = new UIEventSource(false); public readonly snappedOnto: UIEventSource = new UIEventSource(undefined) diff --git a/assets/layers/matchpoint/matchpoint.json b/assets/layers/matchpoint/matchpoint.json new file mode 100644 index 000000000..983ba8025 --- /dev/null +++ b/assets/layers/matchpoint/matchpoint.json @@ -0,0 +1,13 @@ +{ + "id": "matchpoint", + "description": "The default rendering for a locationInput which snaps onto another object", + "source": { + "osmTags": { + "and": []} + }, + "mapRendering": [{ + "location": ["point","centroid"], + "icon": "./assets/svg/crosshair-empty.svg" + }] + +} \ No newline at end of file diff --git a/assets/svg/arrow-download.svg b/assets/svg/arrow-download.svg deleted file mode 100644 index b1f2ff8ea..000000000 --- a/assets/svg/arrow-download.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/assets/svg/arrow-left-smooth.svg b/assets/svg/arrow-left-smooth.svg deleted file mode 100644 index d5bb1d8e4..000000000 --- a/assets/svg/arrow-left-smooth.svg +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/assets/svg/arrow-left-thin.svg b/assets/svg/arrow-left-thin.svg deleted file mode 100644 index 5eb76481b..000000000 --- a/assets/svg/arrow-left-thin.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/assets/svg/arrow-right-smooth.svg b/assets/svg/arrow-right-smooth.svg deleted file mode 100644 index 4fec56311..000000000 --- a/assets/svg/arrow-right-smooth.svg +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/assets/svg/direction.svg b/assets/svg/direction.svg deleted file mode 100644 index 9e2f0e911..000000000 --- a/assets/svg/direction.svg +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - diff --git a/assets/svg/direction_masked.svg b/assets/svg/direction_masked.svg deleted file mode 100644 index af763459e..000000000 --- a/assets/svg/direction_masked.svg +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - Created by potrace 1.15, written by Peter Selinger 2001-2017 - - - image/svg+xml - - - - - - diff --git a/assets/svg/direction_outline.svg b/assets/svg/direction_outline.svg deleted file mode 100644 index e90b7da5b..000000000 --- a/assets/svg/direction_outline.svg +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - Created by potrace 1.15, written by Peter Selinger 2001-2017 - - - image/svg+xml - - - - - - - diff --git a/assets/svg/down.svg b/assets/svg/down.svg deleted file mode 100644 index 0f1acab6b..000000000 --- a/assets/svg/down.svg +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - diff --git a/assets/svg/home_white_bg.svg b/assets/svg/home_white_bg.svg deleted file mode 100644 index 96d62bcb4..000000000 --- a/assets/svg/home_white_bg.svg +++ /dev/null @@ -1,29 +0,0 @@ - -image/svg+xml - - - - \ No newline at end of file diff --git a/assets/svg/layersAdd.svg b/assets/svg/layersAdd.svg deleted file mode 100644 index ff0535d1f..000000000 --- a/assets/svg/layersAdd.svg +++ /dev/null @@ -1,299 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/svg/license_info.json b/assets/svg/license_info.json index 0b19904d7..b2e4b5704 100644 --- a/assets/svg/license_info.json +++ b/assets/svg/license_info.json @@ -71,54 +71,6 @@ "authors": [], "sources": [] }, - { - "path": "arrow-download.svg", - "license": "CC0", - "authors": [ - "Hannah Declerck" - ], - "sources": [] - }, - { - "path": "arrow-left-smooth.svg", - "license": "CC0", - "authors": [ - "Pieter Vander Vennet" - ], - "sources": [] - }, - { - "path": "arrow-left-smooth.svg", - "license": "CC0", - "authors": [ - "Pieter Vander Vennet" - ], - "sources": [] - }, - { - "path": "arrow-left-thin.svg", - "license": "CC0", - "authors": [ - "Hannah Declerck" - ], - "sources": [] - }, - { - "path": "arrow-right-smooth.svg", - "license": "CC0", - "authors": [ - "Pieter Vander Vennet" - ], - "sources": [] - }, - { - "path": "arrow-right-smooth.svg", - "license": "CC0", - "authors": [ - "Pieter Vander Vennet" - ], - "sources": [] - }, { "path": "back.svg", "license": "CC0", @@ -373,18 +325,6 @@ ], "sources": [] }, - { - "path": "direction.svg", - "license": "CC0; trivial", - "authors": [], - "sources": [] - }, - { - "path": "direction.svg", - "license": "CC0; trivial", - "authors": [], - "sources": [] - }, { "path": "direction_gradient.svg", "license": "CC0; trivial", @@ -397,38 +337,6 @@ "authors": [], "sources": [] }, - { - "path": "direction_masked.svg", - "license": "CC0", - "authors": [ - "Pieter Vander Vennet" - ], - "sources": [] - }, - { - "path": "direction_masked.svg", - "license": "CC0", - "authors": [ - "Pieter Vander Vennet" - ], - "sources": [] - }, - { - "path": "direction_outline.svg", - "license": "CC0", - "authors": [ - "Pieter Vander Vennet" - ], - "sources": [] - }, - { - "path": "direction_outline.svg", - "license": "CC0", - "authors": [ - "Pieter Vander Vennet" - ], - "sources": [] - }, { "path": "direction_stroke.svg", "license": "CC0", @@ -445,18 +353,6 @@ ], "sources": [] }, - { - "path": "down.svg", - "license": "CC0; trivial", - "authors": [], - "sources": [] - }, - { - "path": "down.svg", - "license": "CC0; trivial", - "authors": [], - "sources": [] - }, { "path": "download.svg", "license": "CC0", @@ -679,26 +575,6 @@ "https://commons.wikimedia.org/wiki/File:Home-icon.svg" ] }, - { - "path": "home_white_bg.svg", - "license": "CC-BY-SA 3.0", - "authors": [ - "Timothy Miller" - ], - "sources": [ - "https://commons.wikimedia.org/wiki/File:Home-icon.svg" - ] - }, - { - "path": "home_white_bg.svg", - "license": "CC-BY-SA 3.0", - "authors": [ - "Timothy Miller" - ], - "sources": [ - "https://commons.wikimedia.org/wiki/File:Home-icon.svg" - ] - }, { "path": "josm_logo.svg", "license": "CC0", @@ -733,18 +609,6 @@ "authors": [], "sources": [] }, - { - "path": "layersAdd.svg", - "license": "CC0; trivial", - "authors": [], - "sources": [] - }, - { - "path": "layersAdd.svg", - "license": "CC0; trivial", - "authors": [], - "sources": [] - }, { "path": "length-crosshair.svg", "license": "CC0", @@ -953,34 +817,6 @@ "authors": [], "sources": [] }, - { - "path": "or.svg", - "license": "CC0; trivial", - "authors": [], - "sources": [] - }, - { - "path": "or.svg", - "license": "CC0; trivial", - "authors": [], - "sources": [] - }, - { - "path": "osm-copyright.svg", - "license": "logo; all rights reserved", - "authors": [], - "sources": [ - "https://www.OpenStreetMap.org" - ] - }, - { - "path": "osm-copyright.svg", - "license": "logo; all rights reserved", - "authors": [], - "sources": [ - "https://www.OpenStreetMap.org" - ] - }, { "path": "osm-logo-us.svg", "license": "Logo", diff --git a/assets/svg/or.svg b/assets/svg/or.svg deleted file mode 100644 index 20841f19b..000000000 --- a/assets/svg/or.svg +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - diff --git a/assets/svg/osm-copyright.svg b/assets/svg/osm-copyright.svg deleted file mode 100644 index 42c1744d2..000000000 --- a/assets/svg/osm-copyright.svg +++ /dev/null @@ -1,115 +0,0 @@ - - diff --git a/scripts/generateIncludedImages.ts b/scripts/generateIncludedImages.ts index ae1569719..a716751de 100644 --- a/scripts/generateIncludedImages.ts +++ b/scripts/generateIncludedImages.ts @@ -31,10 +31,15 @@ function genImages(dryrun = false) { svg = "xxx" } + let rawName = name; + if(dryrun){ + rawName = "add"; + } + module += ` public static ${name} = "${svg}"\n` - module += ` public static ${name}_img = Img.AsImageElement(Svg.${name})\n` - module += ` public static ${name}_svg() { return new Img(Svg.${name}, true);}\n` - module += ` public static ${name}_ui() { return new FixedUiElement(Svg.${name}_img);}\n\n` + module += ` public static ${name}_img = Img.AsImageElement(Svg.${rawName})\n` + module += ` public static ${name}_svg() { return new Img(Svg.${rawName}, true);}\n` + module += ` public static ${name}_ui() { return new FixedUiElement(Svg.${rawName}_img);}\n\n` if (!dryrun) { allNames.push(`"${path}": Svg.${name}`) }