From 140c81315173dc72244aead8dd1209a736d013e9 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 20 Jun 2023 02:02:45 +0200 Subject: [PATCH] Refactoring: move anchor out of iconSize --- .../ThemeConfig/Conversion/LegacyJsonConvert.ts | 15 +++++++++++++++ .../ThemeConfig/Json/PointRenderingConfigJson.ts | 10 ++++++++++ Models/ThemeConfig/PointRenderingConfig.ts | 11 ++++++++--- assets/layers/address/address.json | 5 +++-- .../bicycle_tube_vending_machine.json | 5 +++-- assets/layers/bike_cleaning/bike_cleaning.json | 5 +++-- assets/layers/bike_parking/bike_parking.json | 5 +++-- assets/layers/conflation/conflation.json | 6 ++++-- assets/layers/crab_address/crab_address.json | 5 +++-- assets/layers/dentist/dentist.json | 5 +++-- assets/layers/direction/direction.json | 5 +++-- assets/layers/doctors/doctors.json | 5 +++-- assets/layers/dogpark/dogpark.json | 5 +++-- assets/layers/drinking_water/drinking_water.json | 5 +++-- assets/layers/elevator/elevator.json | 5 +++-- assets/layers/fitness_centre/fitness_centre.json | 5 +++-- .../layers/fitness_station/fitness_station.json | 5 +++-- assets/layers/ghost_bike/ghost_bike.json | 5 +++-- assets/layers/governments/governments.json | 5 +++-- assets/layers/gps_location/gps_location.json | 5 +++-- .../gps_location_history.json | 3 ++- assets/layers/hospital/hospital.json | 5 +++-- assets/layers/hotel/hotel.json | 3 ++- .../layers/import_candidate/import_candidate.json | 3 ++- assets/layers/maproulette/maproulette.json | 3 ++- .../maproulette_challenge.json | 3 ++- assets/layers/note/note.json | 5 +++-- .../osm_community_index/osm_community_index.json | 5 +++-- assets/layers/parcel_lockers/parcel_lockers.json | 5 +++-- assets/layers/parking_spaces/parking_spaces.json | 5 +++-- .../parking_ticket_machine.json | 3 ++- assets/layers/pharmacy/pharmacy.json | 5 +++-- .../layers/physiotherapist/physiotherapist.json | 5 +++-- assets/layers/postoffices/postoffices.json | 5 +++-- .../rainbow_crossings/rainbow_crossings.json | 5 +++-- assets/layers/reception_desk/reception_desk.json | 3 ++- .../layers/selected_element/selected_element.json | 5 +++-- assets/layers/split_point/split_point.json | 3 ++- assets/layers/split_road/split_road.json | 3 ++- assets/layers/street_lamps/street_lamps.json | 3 ++- assets/layers/ticket_machine/ticket_machine.json | 5 +++-- .../layers/ticket_validator/ticket_validator.json | 5 +++-- assets/layers/veterinary/veterinary.json | 5 +++-- assets/layers/viewpoint/viewpoint.json | 5 +++-- assets/layers/village_green/village_green.json | 5 +++-- assets/themes/grb/grb.json | 5 +++-- .../mapcomplete-changes/mapcomplete-changes.json | 3 ++- assets/themes/sidewalks/sidewalks.json | 3 ++- .../street_lighting_assen.json | 3 ++- assets/themes/uk_addresses/uk_addresses.json | 5 +++-- assets/themes/waste_assen/waste_assen.json | 6 ++++-- assets/themes/width/width.json | 3 ++- 52 files changed, 168 insertions(+), 87 deletions(-) diff --git a/Models/ThemeConfig/Conversion/LegacyJsonConvert.ts b/Models/ThemeConfig/Conversion/LegacyJsonConvert.ts index 0ad777fe7..82b48b6a3 100644 --- a/Models/ThemeConfig/Conversion/LegacyJsonConvert.ts +++ b/Models/ThemeConfig/Conversion/LegacyJsonConvert.ts @@ -3,6 +3,7 @@ import { Utils } from "../../../Utils" import LineRenderingConfigJson from "../Json/LineRenderingConfigJson" import { LayerConfigJson } from "../Json/LayerConfigJson" import { DesugaringStep, Each, Fuse, On } from "./Conversion" +import PointRenderingConfigJson from "../Json/PointRenderingConfigJson" export class UpdateLegacyLayer extends DesugaringStep< LayerConfigJson | string | { builtin; override } @@ -139,6 +140,20 @@ export class UpdateLegacyLayer extends DesugaringStep< } } + for (const rendering of config.mapRendering ?? []) { + if (!rendering["iconSize"]) { + continue + } + const pr = rendering + const iconSize = pr.iconSize + if (typeof iconSize === "string") + if (["bottom", "center", "top"].some((a) => (iconSize).endsWith("," + a))) { + const parts = iconSize.split(",").map((parts) => parts.toLowerCase().trim()) + pr.anchor = parts.pop() + pr.iconSize = parts.join(",") + } + } + return { result: config, errors: [], diff --git a/Models/ThemeConfig/Json/PointRenderingConfigJson.ts b/Models/ThemeConfig/Json/PointRenderingConfigJson.ts index 54ad00db9..ca168b402 100644 --- a/Models/ThemeConfig/Json/PointRenderingConfigJson.ts +++ b/Models/ThemeConfig/Json/PointRenderingConfigJson.ts @@ -54,6 +54,16 @@ export default interface PointRenderingConfigJson { * Default is '40,40,center' */ iconSize?: string | TagRenderingConfigJson + + /** + * question: What is the anchorpoint of the icon? + * + * This matches the geographical point with a location on the icon. + * For example, a feature attached to the ground can use 'bottom' as zooming in will give the appearance of being anchored to a fixed location. + * + */ + anchor?: "center" | "top" | "bottom" | "left" | "right" | string + /** * The rotation of an icon, useful for e.g. directions. * Usage: as if it were a css property for 'rotate', thus has to end with 'deg', e.g. `90deg`, `{direction}deg`, `calc(90deg - {camera:direction}deg)`` diff --git a/Models/ThemeConfig/PointRenderingConfig.ts b/Models/ThemeConfig/PointRenderingConfig.ts index 250f92e95..8977136ad 100644 --- a/Models/ThemeConfig/PointRenderingConfig.ts +++ b/Models/ThemeConfig/PointRenderingConfig.ts @@ -27,6 +27,8 @@ export default class PointRenderingConfig extends WithContextLoader { public readonly icon?: TagRenderingConfig public readonly iconBadges: { if: TagsFilter; then: TagRenderingConfig }[] public readonly iconSize: TagRenderingConfig + public readonly anchor: TagRenderingConfig + public readonly label: TagRenderingConfig public readonly labelCss: TagRenderingConfig public readonly labelCssClasses: TagRenderingConfig @@ -90,7 +92,8 @@ export default class PointRenderingConfig extends WithContextLoader { throw context + ": builtin SVG asset not found: " + iconPath } } - this.iconSize = this.tr("iconSize", "40,40,center") + this.iconSize = this.tr("iconSize", "40,40") + this.anchor = this.tr("anchor", "center") this.label = this.tr("label", undefined) this.rotation = this.tr("rotation", "0") this.pitchAlignment = this.tr("pitchAlignment", "canvas") @@ -229,11 +232,13 @@ export default class PointRenderingConfig extends WithContextLoader { return Utils.SubstituteKeys(str, tags.data).replace(/{.*}/g, "") } - const iconSize = render(this.iconSize, "40,40,center").split(",") + const iconSize = render(this.iconSize, "40,40").split(",") const iconW = num(iconSize[0]) let iconH = num(iconSize[1]) - const mode = iconSize[2]?.trim()?.toLowerCase() ?? "center" + + const anchor = render(this.anchor, "center") + const mode = anchor?.trim()?.toLowerCase() ?? "center" // in MapLibre, the offset is relative to the _center_ of the object, with left = [-x, 0] and up = [0,-y] let anchorW = 0 diff --git a/assets/layers/address/address.json b/assets/layers/address/address.json index 347d8d683..9c17a0454 100644 --- a/assets/layers/address/address.json +++ b/assets/layers/address/address.json @@ -251,7 +251,7 @@ "render": "
{addr:housenumber}
", "condition": "addr:housenumber~*" }, - "iconSize": "50,50,center", + "iconSize": "50,50", "icon": { "render": "./assets/layers/address/housenumber_blank.svg", "mappings": [ @@ -274,7 +274,8 @@ "location": [ "point", "centroid" - ] + ], + "anchor": "center" }, { "color": { diff --git a/assets/layers/bicycle_tube_vending_machine/bicycle_tube_vending_machine.json b/assets/layers/bicycle_tube_vending_machine/bicycle_tube_vending_machine.json index f0ca93ea9..a1e7a60b5 100644 --- a/assets/layers/bicycle_tube_vending_machine/bicycle_tube_vending_machine.json +++ b/assets/layers/bicycle_tube_vending_machine/bicycle_tube_vending_machine.json @@ -304,11 +304,12 @@ "then": "close:#c33" } ], - "iconSize": "50,50,bottom", + "iconSize": "50,50", "location": [ "point", "centroid" - ] + ], + "anchor": "bottom" }, { "color": "#6bc4f7" diff --git a/assets/layers/bike_cleaning/bike_cleaning.json b/assets/layers/bike_cleaning/bike_cleaning.json index 6ac80bd67..d0dfaeabf 100644 --- a/assets/layers/bike_cleaning/bike_cleaning.json +++ b/assets/layers/bike_cleaning/bike_cleaning.json @@ -257,11 +257,12 @@ } } ], - "iconSize": "50,50,bottom", + "iconSize": "50,50", "location": [ "point", "centroid" - ] + ], + "anchor": "bottom" } ], "description": { diff --git a/assets/layers/bike_parking/bike_parking.json b/assets/layers/bike_parking/bike_parking.json index b3b20d15d..c44ffc844 100644 --- a/assets/layers/bike_parking/bike_parking.json +++ b/assets/layers/bike_parking/bike_parking.json @@ -699,11 +699,12 @@ "icon": { "render": "pin:#5473de;./assets/layers/bike_parking/parking.svg" }, - "iconSize": "40,40,bottom", + "iconSize": "40,40", "location": [ "point", "centroid" - ] + ], + "anchor": "bottom" }, { "color": "#00f", diff --git a/assets/layers/conflation/conflation.json b/assets/layers/conflation/conflation.json index 5cc23d054..3af2b482d 100644 --- a/assets/layers/conflation/conflation.json +++ b/assets/layers/conflation/conflation.json @@ -17,7 +17,8 @@ } ] }, - "iconSize": "10,10,center" + "iconSize": "10,10", + "anchor": "center" }, { "location": "end", @@ -34,7 +35,8 @@ } ] }, - "iconSize": "10,10,center" + "iconSize": "10,10", + "anchor": "center" }, { "location": "start", diff --git a/assets/layers/crab_address/crab_address.json b/assets/layers/crab_address/crab_address.json index 97728eb0c..15bddb2bb 100644 --- a/assets/layers/crab_address/crab_address.json +++ b/assets/layers/crab_address/crab_address.json @@ -15,11 +15,12 @@ "point", "centroid" ], - "iconSize": "50,50,center", + "iconSize": "50,50", "icon": "./assets/layers/crab_address/housenumber_blank.svg", "label": { "render": "
{_HNRLABEL}
" - } + }, + "anchor": "center" } ], "calculatedTags": [ diff --git a/assets/layers/dentist/dentist.json b/assets/layers/dentist/dentist.json index a737b3a6f..d821db75a 100644 --- a/assets/layers/dentist/dentist.json +++ b/assets/layers/dentist/dentist.json @@ -70,11 +70,12 @@ "icon": { "render": "circle:white;./assets/layers/dentist/dentist.svg" }, - "iconSize": "40,40,center", + "iconSize": "40,40", "location": [ "point", "centroid" - ] + ], + "anchor": "center" } ], "deletion": true, diff --git a/assets/layers/direction/direction.json b/assets/layers/direction/direction.json index b290a82b8..186f8daa6 100644 --- a/assets/layers/direction/direction.json +++ b/assets/layers/direction/direction.json @@ -35,14 +35,15 @@ "mapRendering": [ { "icon": "direction_gradient:var(--catch-detail-color)", - "iconSize": "200,200,center", + "iconSize": "200,200", "location": [ "point", "centroid" ], "rotation": { "render": "{_direction:numerical}deg" - } + }, + "anchor": "center" }, { "color": "--catch-detail-color" diff --git a/assets/layers/doctors/doctors.json b/assets/layers/doctors/doctors.json index c6c487481..3d9c4dd01 100644 --- a/assets/layers/doctors/doctors.json +++ b/assets/layers/doctors/doctors.json @@ -129,11 +129,12 @@ "icon": { "render": "circle:white;./assets/layers/doctors/doctors.svg" }, - "iconSize": "40,40,center", + "iconSize": "40,40", "location": [ "point", "centroid" - ] + ], + "anchor": "center" } ], "deletion": true, diff --git a/assets/layers/dogpark/dogpark.json b/assets/layers/dogpark/dogpark.json index 66d7210d3..f760088b2 100644 --- a/assets/layers/dogpark/dogpark.json +++ b/assets/layers/dogpark/dogpark.json @@ -68,7 +68,7 @@ "centroid" ], "icon": "./assets/layers/dogpark/dog-park.svg", - "iconSize": "40,40,center", + "iconSize": "40,40", "label": { "mappings": [ { @@ -76,7 +76,8 @@ "then": "
{name}
" } ] - } + }, + "anchor": "center" }, { "color": "#ff0", diff --git a/assets/layers/drinking_water/drinking_water.json b/assets/layers/drinking_water/drinking_water.json index 117f46b6a..3fa423080 100644 --- a/assets/layers/drinking_water/drinking_water.json +++ b/assets/layers/drinking_water/drinking_water.json @@ -258,11 +258,12 @@ "then": "close:#c33" } ], - "iconSize": "40,40,bottom", + "iconSize": "40,40", "location": [ "point", "centroid" - ] + ], + "anchor": "bottom" } ], "description": { diff --git a/assets/layers/elevator/elevator.json b/assets/layers/elevator/elevator.json index dbe8f50d6..28f7a81e4 100644 --- a/assets/layers/elevator/elevator.json +++ b/assets/layers/elevator/elevator.json @@ -194,7 +194,7 @@ "icon": { "render": "circle:white;./assets/layers/elevator/elevator_wheelchair.svg" }, - "iconSize": "40,40,center", + "iconSize": "40,40", "location": [ "point", "centroid" @@ -209,7 +209,8 @@ }, "then": "close:#c33" } - ] + ], + "anchor": "center" } ], "presets": [ diff --git a/assets/layers/fitness_centre/fitness_centre.json b/assets/layers/fitness_centre/fitness_centre.json index 6cf7ebb47..095e355bf 100644 --- a/assets/layers/fitness_centre/fitness_centre.json +++ b/assets/layers/fitness_centre/fitness_centre.json @@ -92,14 +92,15 @@ "centroid" ], "icon": "circle:white;./assets/layers/fitness_centre/gym.svg", - "iconSize": "40,40,center", + "iconSize": "40,40", "label": "
{name}
", "iconBadges": [ { "if": "opening_hours~*", "then": "icons.isOpen" } - ] + ], + "anchor": "center" } ], "filter": [ diff --git a/assets/layers/fitness_station/fitness_station.json b/assets/layers/fitness_station/fitness_station.json index ebef26657..331f6a81f 100644 --- a/assets/layers/fitness_station/fitness_station.json +++ b/assets/layers/fitness_station/fitness_station.json @@ -393,7 +393,7 @@ "centroid" ], "icon": "circle:white;./assets/layers/fitness_station/fitness.svg", - "iconSize": "40,40,center", + "iconSize": "40,40", "iconBadges": [ { "if": { @@ -404,7 +404,8 @@ }, "then": "icons.isOpen" } - ] + ], + "anchor": "center" } ], "filter": [ diff --git a/assets/layers/ghost_bike/ghost_bike.json b/assets/layers/ghost_bike/ghost_bike.json index b46383ecb..f50dabfc3 100644 --- a/assets/layers/ghost_bike/ghost_bike.json +++ b/assets/layers/ghost_bike/ghost_bike.json @@ -232,11 +232,12 @@ "mapRendering": [ { "icon": "./assets/layers/ghost_bike/ghost_bike.svg", - "iconSize": "40,40,bottom", + "iconSize": "40,40", "location": [ "point", "centroid" - ] + ], + "anchor": "bottom" } ], "description": { diff --git a/assets/layers/governments/governments.json b/assets/layers/governments/governments.json index dcf20cd50..a05dd5ae1 100644 --- a/assets/layers/governments/governments.json +++ b/assets/layers/governments/governments.json @@ -67,11 +67,12 @@ "icon": { "render": "circle:white;./assets/layers/governments/government.svg" }, - "iconSize": "40,40,center", + "iconSize": "40,40", "location": [ "point", "centroid" - ] + ], + "anchor": "center" } ] } diff --git a/assets/layers/gps_location/gps_location.json b/assets/layers/gps_location/gps_location.json index e466f03f5..15740cbd8 100644 --- a/assets/layers/gps_location/gps_location.json +++ b/assets/layers/gps_location/gps_location.json @@ -14,7 +14,7 @@ } ] }, - "iconSize": "40,40,center", + "iconSize": "40,40", "pitchAlignment": "map", "rotation": { "render": "0deg", @@ -33,7 +33,8 @@ "location": [ "point", "centroid" - ] + ], + "anchor": "center" } ] } diff --git a/assets/layers/gps_location_history/gps_location_history.json b/assets/layers/gps_location_history/gps_location_history.json index 34167beb5..ecde04534 100644 --- a/assets/layers/gps_location_history/gps_location_history.json +++ b/assets/layers/gps_location_history/gps_location_history.json @@ -12,7 +12,8 @@ "centroid" ], "icon": "square:red", - "iconSize": "5,5,center" + "iconSize": "5,5", + "anchor": "center" } ] } diff --git a/assets/layers/hospital/hospital.json b/assets/layers/hospital/hospital.json index 9ecfbbded..405779462 100644 --- a/assets/layers/hospital/hospital.json +++ b/assets/layers/hospital/hospital.json @@ -115,11 +115,12 @@ "icon": { "render": "circle:white;./assets/layers/hospital/hospital.svg" }, - "iconSize": "40,40,center", + "iconSize": "40,40", "location": [ "point", "centroid" - ] + ], + "anchor": "center" }, { "color": "#fcd862", diff --git a/assets/layers/hotel/hotel.json b/assets/layers/hotel/hotel.json index 6e3a21352..d4221f43b 100644 --- a/assets/layers/hotel/hotel.json +++ b/assets/layers/hotel/hotel.json @@ -55,7 +55,8 @@ "centroid" ], "icon": "circle:white;./assets/layers/hotel/hotel.svg", - "iconSize": "40,40,center" + "iconSize": "40,40", + "anchor": "center" } ], "tagRenderings": [ diff --git a/assets/layers/import_candidate/import_candidate.json b/assets/layers/import_candidate/import_candidate.json index 0e1a7653e..99fb3f0b7 100644 --- a/assets/layers/import_candidate/import_candidate.json +++ b/assets/layers/import_candidate/import_candidate.json @@ -9,7 +9,8 @@ "centroid" ], "icon": "square:red;", - "iconSize": "15,15,center" + "iconSize": "15,15", + "anchor": "center" } ], "title": "Import candidate", diff --git a/assets/layers/maproulette/maproulette.json b/assets/layers/maproulette/maproulette.json index 6318fc441..d7d6bf640 100644 --- a/assets/layers/maproulette/maproulette.json +++ b/assets/layers/maproulette/maproulette.json @@ -54,7 +54,8 @@ } ] }, - "iconSize": "40,40,bottom" + "iconSize": "40,40", + "anchor": "bottom" } ], "tagRenderings": [ diff --git a/assets/layers/maproulette_challenge/maproulette_challenge.json b/assets/layers/maproulette_challenge/maproulette_challenge.json index 451cffba8..2df211cbb 100644 --- a/assets/layers/maproulette_challenge/maproulette_challenge.json +++ b/assets/layers/maproulette_challenge/maproulette_challenge.json @@ -67,7 +67,8 @@ } ] }, - "iconSize": "40,40,bottom" + "iconSize": "40,40", + "anchor": "bottom" } ], "tagRenderings": [ diff --git a/assets/layers/note/note.json b/assets/layers/note/note.json index 89e3d7777..4bf57c781 100644 --- a/assets/layers/note/note.json +++ b/assets/layers/note/note.json @@ -113,7 +113,7 @@ } ] }, - "iconSize": "40,40,bottom", + "iconSize": "40,40", "iconBadges": [ { "if": "_total_comments>1", @@ -123,7 +123,8 @@ "if": "_is_import_note~*", "then": "addSmall" } - ] + ], + "anchor": "bottom" } ], "filter": [ diff --git a/assets/layers/osm_community_index/osm_community_index.json b/assets/layers/osm_community_index/osm_community_index.json index e2c1210b9..1886485d1 100644 --- a/assets/layers/osm_community_index/osm_community_index.json +++ b/assets/layers/osm_community_index/osm_community_index.json @@ -40,10 +40,11 @@ "icon": { "render": "pin:#6BC4F7;./assets/layers/osm_community_index/osm.svg" }, - "iconSize": "40,40,bottom", + "iconSize": "40,40", "location": [ "point" - ] + ], + "anchor": "bottom" }, { "color": "#444444", diff --git a/assets/layers/parcel_lockers/parcel_lockers.json b/assets/layers/parcel_lockers/parcel_lockers.json index faf9bbab3..2a76ea473 100644 --- a/assets/layers/parcel_lockers/parcel_lockers.json +++ b/assets/layers/parcel_lockers/parcel_lockers.json @@ -270,11 +270,12 @@ "then": "icons.isOpen" } ], - "iconSize": "40,40,center", + "iconSize": "40,40", "location": [ "point", "centroid" - ] + ], + "anchor": "center" } ] } diff --git a/assets/layers/parking_spaces/parking_spaces.json b/assets/layers/parking_spaces/parking_spaces.json index fa6049a95..7dc0f52b6 100644 --- a/assets/layers/parking_spaces/parking_spaces.json +++ b/assets/layers/parking_spaces/parking_spaces.json @@ -195,11 +195,12 @@ } ] }, - "iconSize": "20,20,center", + "iconSize": "20,20", "location": [ "point", "centroid" - ] + ], + "anchor": "center" }, { "color": "#696969", diff --git a/assets/layers/parking_ticket_machine/parking_ticket_machine.json b/assets/layers/parking_ticket_machine/parking_ticket_machine.json index f13253547..3b0d101c0 100644 --- a/assets/layers/parking_ticket_machine/parking_ticket_machine.json +++ b/assets/layers/parking_ticket_machine/parking_ticket_machine.json @@ -88,7 +88,8 @@ "centroid" ], "icon": "square:white;./assets/layers/parking_ticket_machine/parking_tickets.svg", - "iconSize": "20,20,center" + "iconSize": "20,20", + "anchor": "center" } ] } diff --git a/assets/layers/pharmacy/pharmacy.json b/assets/layers/pharmacy/pharmacy.json index 941fe0865..b6d236ab9 100644 --- a/assets/layers/pharmacy/pharmacy.json +++ b/assets/layers/pharmacy/pharmacy.json @@ -116,7 +116,7 @@ "icon": { "render": "./assets/layers/pharmacy/pharmacy.svg" }, - "iconSize": "40,40,bottom", + "iconSize": "40,40", "location": [ "point", "centroid" @@ -134,7 +134,8 @@ "then": "
{name}
" } ] - } + }, + "anchor": "bottom" } ], "filter": [ diff --git a/assets/layers/physiotherapist/physiotherapist.json b/assets/layers/physiotherapist/physiotherapist.json index 741294309..1270ad4ac 100644 --- a/assets/layers/physiotherapist/physiotherapist.json +++ b/assets/layers/physiotherapist/physiotherapist.json @@ -65,11 +65,12 @@ "icon": { "render": "circle:white;./assets/layers/physiotherapist/doctors.svg" }, - "iconSize": "40,40,center", + "iconSize": "40,40", "location": [ "point", "centroid" - ] + ], + "anchor": "center" } ], "deletion": true, diff --git a/assets/layers/postoffices/postoffices.json b/assets/layers/postoffices/postoffices.json index 91de19877..d76b2909c 100644 --- a/assets/layers/postoffices/postoffices.json +++ b/assets/layers/postoffices/postoffices.json @@ -446,11 +446,12 @@ "then": "./assets/themes/shops/shop.svg" } ], - "iconSize": "40,40,center", + "iconSize": "40,40", "location": [ "point", "centroid" - ] + ], + "anchor": "center" }, { "color": "#DADADA", diff --git a/assets/layers/rainbow_crossings/rainbow_crossings.json b/assets/layers/rainbow_crossings/rainbow_crossings.json index 4b59c54e8..b397da6fd 100644 --- a/assets/layers/rainbow_crossings/rainbow_crossings.json +++ b/assets/layers/rainbow_crossings/rainbow_crossings.json @@ -119,11 +119,12 @@ } ] }, - "iconSize": "40,40,center", + "iconSize": "40,40", "location": [ "point", "centroid" - ] + ], + "anchor": "center" }, { "color": "red", diff --git a/assets/layers/reception_desk/reception_desk.json b/assets/layers/reception_desk/reception_desk.json index 72333e67a..007dfb553 100644 --- a/assets/layers/reception_desk/reception_desk.json +++ b/assets/layers/reception_desk/reception_desk.json @@ -30,7 +30,8 @@ "centroid" ], "icon": "circle:white;./assets/layers/reception_desk/reception_desk.svg", - "iconSize": "40,40,center" + "iconSize": "40,40", + "anchor": "center" } ], "tagRenderings": [ diff --git a/assets/layers/selected_element/selected_element.json b/assets/layers/selected_element/selected_element.json index 1d2390939..876d8ed66 100644 --- a/assets/layers/selected_element/selected_element.json +++ b/assets/layers/selected_element/selected_element.json @@ -11,13 +11,14 @@ "mapRendering": [ { "icon": "circle:red", - "iconSize": "1,1,center", + "iconSize": "1,1", "location": [ "point", "projected_centerpoint" ], "css": "box-shadow: red 0 0 20px 20px; z-index: -1; height: 1px; width: 1px;", - "cssClasses": "block relative rounded-full" + "cssClasses": "block relative rounded-full", + "anchor": "center" } ] } diff --git a/assets/layers/split_point/split_point.json b/assets/layers/split_point/split_point.json index 9202df71c..e35006cb2 100644 --- a/assets/layers/split_point/split_point.json +++ b/assets/layers/split_point/split_point.json @@ -12,7 +12,8 @@ "centroid" ], "icon": "circle:white;./assets/svg/scissors.svg", - "iconSize": "30,30,center" + "iconSize": "30,30", + "anchor": "center" } ] } diff --git a/assets/layers/split_road/split_road.json b/assets/layers/split_road/split_road.json index 2b15e115f..3fad3696c 100644 --- a/assets/layers/split_road/split_road.json +++ b/assets/layers/split_road/split_road.json @@ -11,7 +11,8 @@ "point" ], "icon": "bug", - "iconSize": "30,30,center" + "iconSize": "30,30", + "anchor": "center" }, { "width": "8", diff --git a/assets/layers/street_lamps/street_lamps.json b/assets/layers/street_lamps/street_lamps.json index b26054c7f..9c9ddef2c 100644 --- a/assets/layers/street_lamps/street_lamps.json +++ b/assets/layers/street_lamps/street_lamps.json @@ -43,7 +43,8 @@ "then": "circle:{light:colour}" } ], - "iconSize": "40,40,bottom" + "iconSize": "40,40", + "anchor": "bottom" } ], "presets": [ diff --git a/assets/layers/ticket_machine/ticket_machine.json b/assets/layers/ticket_machine/ticket_machine.json index 0e6149534..2d4abc356 100644 --- a/assets/layers/ticket_machine/ticket_machine.json +++ b/assets/layers/ticket_machine/ticket_machine.json @@ -86,11 +86,12 @@ "mapRendering": [ { "icon": "square:lightblue;./assets/themes/stations/public_transport_tickets.svg", - "iconSize": "20,20,center", + "iconSize": "20,20", "location": [ "point", "centroid" - ] + ], + "anchor": "center" } ], "allowMove": true, diff --git a/assets/layers/ticket_validator/ticket_validator.json b/assets/layers/ticket_validator/ticket_validator.json index 1529ff1ca..b6b258f6a 100644 --- a/assets/layers/ticket_validator/ticket_validator.json +++ b/assets/layers/ticket_validator/ticket_validator.json @@ -114,11 +114,12 @@ "mapRendering": [ { "icon": "square:green;./assets/themes/stations/public_transport_tickets.svg", - "iconSize": "20,20,center", + "iconSize": "20,20", "location": [ "point", "centroid" - ] + ], + "anchor": "center" } ], "allowMove": true, diff --git a/assets/layers/veterinary/veterinary.json b/assets/layers/veterinary/veterinary.json index cadeaf334..f0006470c 100644 --- a/assets/layers/veterinary/veterinary.json +++ b/assets/layers/veterinary/veterinary.json @@ -67,7 +67,7 @@ "centroid" ], "icon": "./assets/layers/veterinary/vet.svg", - "iconSize": "30,40,center", + "iconSize": "30,40", "label": { "mappings": [ { @@ -81,7 +81,8 @@ "if": "opening_hours~*", "then": "icons.isOpen" } - ] + ], + "anchor": "center" }, { "color": "#ff0", diff --git a/assets/layers/viewpoint/viewpoint.json b/assets/layers/viewpoint/viewpoint.json index c635d37bd..c7b0644fa 100644 --- a/assets/layers/viewpoint/viewpoint.json +++ b/assets/layers/viewpoint/viewpoint.json @@ -81,10 +81,11 @@ "mapRendering": [ { "icon": "./assets/layers/viewpoint/viewpoint.svg", - "iconSize": "20,20,center", + "iconSize": "20,20", "location": [ "point" - ] + ], + "anchor": "center" }, { "color": "#ffffff", diff --git a/assets/layers/village_green/village_green.json b/assets/layers/village_green/village_green.json index 0fd86ad1a..b191d9802 100644 --- a/assets/layers/village_green/village_green.json +++ b/assets/layers/village_green/village_green.json @@ -34,11 +34,12 @@ "mapRendering": [ { "icon": "./assets/themes/playgrounds/playground.svg", - "iconSize": "40,40,center", + "iconSize": "40,40", "location": [ "point", "centroid" - ] + ], + "anchor": "center" }, { "color": "#937f20", diff --git a/assets/themes/grb/grb.json b/assets/themes/grb/grb.json index 77c3fb331..0cd71ae2b 100644 --- a/assets/themes/grb/grb.json +++ b/assets/themes/grb/grb.json @@ -479,7 +479,7 @@ "render": "
{addr:housenumber}
", "condition": "addr:housenumber~*" }, - "iconSize": "50,50,center", + "iconSize": "50,50", "icon": { "mappings": [ { @@ -495,7 +495,8 @@ "location": [ "point", "centroid" - ] + ], + "anchor": "center" }, { "width": { diff --git a/assets/themes/mapcomplete-changes/mapcomplete-changes.json b/assets/themes/mapcomplete-changes/mapcomplete-changes.json index 2bd225a5b..034e6ccb8 100644 --- a/assets/themes/mapcomplete-changes/mapcomplete-changes.json +++ b/assets/themes/mapcomplete-changes/mapcomplete-changes.json @@ -416,7 +416,8 @@ } ] }, - "iconSize": "30,30,center" + "iconSize": "30,30", + "anchor": "center" } ], "filter": [ diff --git a/assets/themes/sidewalks/sidewalks.json b/assets/themes/sidewalks/sidewalks.json index 6defec631..e3cad4102 100644 --- a/assets/themes/sidewalks/sidewalks.json +++ b/assets/themes/sidewalks/sidewalks.json @@ -235,7 +235,8 @@ "end" ], "icon": "circle:#ccc", - "iconSize": "3,3,center" + "iconSize": "3,3", + "anchor": "center" }, { "#": "The center line", diff --git a/assets/themes/street_lighting_assen/street_lighting_assen.json b/assets/themes/street_lighting_assen/street_lighting_assen.json index 16877b6fb..4b0031431 100644 --- a/assets/themes/street_lighting_assen/street_lighting_assen.json +++ b/assets/themes/street_lighting_assen/street_lighting_assen.json @@ -43,7 +43,8 @@ } ] }, - "iconSize": "20,20,center" + "iconSize": "20,20", + "anchor": "center" } ], "tagRenderings": [ diff --git a/assets/themes/uk_addresses/uk_addresses.json b/assets/themes/uk_addresses/uk_addresses.json index 1592ebefb..1ea337c2f 100644 --- a/assets/themes/uk_addresses/uk_addresses.json +++ b/assets/themes/uk_addresses/uk_addresses.json @@ -638,7 +638,7 @@ "render": "
{addr:housenumber}
", "condition": "addr:housenumber~*" }, - "iconSize": "50,50,center", + "iconSize": "50,50", "icon": { "render": "./assets/layers/address/housenumber_blank.svg", "mappings": [ @@ -661,7 +661,8 @@ "location": [ "point", "centroid" - ] + ], + "anchor": "center" }, { "color": { diff --git a/assets/themes/waste_assen/waste_assen.json b/assets/themes/waste_assen/waste_assen.json index e70b765ac..0484d4ef8 100644 --- a/assets/themes/waste_assen/waste_assen.json +++ b/assets/themes/waste_assen/waste_assen.json @@ -47,7 +47,8 @@ } ] }, - "iconSize": "20,20,center" + "iconSize": "20,20", + "anchor": "center" } ], "tagRenderings": [ @@ -92,7 +93,8 @@ } ] }, - "iconSize": "20,20,center" + "iconSize": "20,20", + "anchor": "center" } ], "tagRenderings": [ diff --git a/assets/themes/width/width.json b/assets/themes/width/width.json index 1a9261434..5f9adf3ae 100644 --- a/assets/themes/width/width.json +++ b/assets/themes/width/width.json @@ -210,7 +210,8 @@ "point" ], "icon": "./assets/themes/width/icon.svg", - "iconSize": "40,40,center" + "iconSize": "40,40", + "anchor": "center" }, { "width": "4",