From cde59f84a79cae00f1654c54cc77aec389ba8530 Mon Sep 17 00:00:00 2001 From: wmisener <58491489+wmisener@users.noreply.github.com> Date: Sat, 6 Jul 2024 16:07:41 -0700 Subject: [PATCH 1/9] Add suburb, quarter, neighborhood rendering --- src/layer/index.js | 3 + src/layer/place.js | 149 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 152 insertions(+) diff --git a/src/layer/index.js b/src/layer/index.js index 740eb6061..e23a4c422 100644 --- a/src/layer/index.js +++ b/src/layer/index.js @@ -232,6 +232,9 @@ export function build(locales) { lyrPoi.poi, lyrPlace.state, + lyrPlace.neighborhood, + lyrPlace.quarter, + lyrPlace.suburb, lyrPlace.village, lyrPlace.town, lyrPlace.city, diff --git a/src/layer/place.js b/src/layer/place.js index 611199a7d..d5556d131 100644 --- a/src/layer/place.js +++ b/src/layer/place.js @@ -208,6 +208,155 @@ export const city = { metadata: {}, }; +export const suburb = { + id: "place_suburb", + type: "symbol", + paint: { + "text-color": Color.waterLabel, + "text-halo-color": labelHaloColor, + "text-halo-width": [ + "interpolate", + ["exponential", 1.2], + ["zoom"], + 3, + 1.5, + 6, + 2.5, + ], + "text-halo-blur": labelHaloBlur, + }, + filter: ["==", ["get", "class"], "suburb"], + layout: { + "text-font": ["Americana-Regular"], + "text-size": { + base: 1.2, + stops: [ + [10, 10], + [12, 14], + [14, 18], + ], + }, + "text-field": Label.localizedName, + "text-padding": 1, + "text-transform": "uppercase", + "text-letter-spacing": 0.04, + "text-variable-anchor": ["center"], + "text-radial-offset": [ + "interpolate", + ["exponential", 1.6], + ["zoom"], + 3, + 0.5, + 7, + 3, + ], + "text-max-width": 6, + }, + source: "openmaptiles", + maxzoom: 15, + minzoom: 11, + "source-layer": "place", +}; + +export const quarter = { + id: "place_quarter", + type: "symbol", + paint: { + "text-color": Color.waterLabel, + "text-halo-color": labelHaloColor, + "text-halo-width": [ + "interpolate", + ["exponential", 1.2], + ["zoom"], + 3, + 1.5, + 6, + 2.5, + ], + "text-halo-blur": labelHaloBlur, + }, + filter: ["==", ["get", "class"], "quarter"], + layout: { + "text-font": ["Americana-Regular"], + "text-size": { + base: 1.2, + stops: [ + [13, 12], + [14, 14], + [16, 18], + ], + }, + "text-field": Label.localizedName, + "text-padding": 1, + "text-transform": "uppercase", + "text-letter-spacing": 0.04, + "text-variable-anchor": ["center"], + "text-radial-offset": [ + "interpolate", + ["exponential", 1.6], + ["zoom"], + 3, + 0.5, + 7, + 3, + ], + "text-max-width": 6, + }, + source: "openmaptiles", + maxzoom: 16, + minzoom: 13, + "source-layer": "place", +}; + +export const neighborhood = { + id: "place_neighborhood", + type: "symbol", + paint: { + "text-color": Color.waterLabel, + "text-halo-color": labelHaloColor, + "text-halo-width": [ + "interpolate", + ["exponential", 1.2], + ["zoom"], + 3, + 1.5, + 6, + 2.5, + ], + "text-halo-blur": labelHaloBlur, + }, + filter: ["==", ["get", "class"], "neighbourhood"], + layout: { + "text-font": ["Americana-Regular"], + "text-size": { + base: 1.2, + stops: [ + [14, 12], + [16, 14], + ], + }, + "text-field": Label.localizedName, + "text-padding": 1, + "text-transform": "uppercase", + "text-letter-spacing": 0.04, + "text-variable-anchor": ["center"], + "text-radial-offset": [ + "interpolate", + ["exponential", 1.6], + ["zoom"], + 3, + 0.5, + 7, + 3, + ], + "text-max-width": 6, + }, + source: "openmaptiles", + maxzoom: 17, + minzoom: 14, + "source-layer": "place", +}; + export const state = { id: "place_state", type: "symbol", From 38501caf48a80f127c93e4e9ddc4f3a7ca3e2a5e Mon Sep 17 00:00:00 2001 From: wmisener <58491489+wmisener@users.noreply.github.com> Date: Tue, 9 Jul 2024 19:10:43 -0700 Subject: [PATCH 2/9] Add legend entries As described in original PR, but neglected to actually merge. --- src/layer/place.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/layer/place.js b/src/layer/place.js index d5556d131..4d9639d9a 100644 --- a/src/layer/place.js +++ b/src/layer/place.js @@ -590,6 +590,18 @@ export const legendEntries = [ description: "Small village", layers: [village.id], filter: nonCapitalFilter, + }, + { + description: "Major district", + layers: [suburb.id], + }, + { + description: "Large neighborhood", + layers: [quarter.id], + }, + { + description: "Neighborhood", + layers: [neighborhood.id], }, { description: "National capital", From c188be073f94507d56dd0866bc1d580054ce0da8 Mon Sep 17 00:00:00 2001 From: wmisener <58491489+wmisener@users.noreply.github.com> Date: Tue, 9 Jul 2024 19:14:22 -0700 Subject: [PATCH 3/9] Whitespace error --- src/layer/place.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layer/place.js b/src/layer/place.js index 4d9639d9a..f4d10f865 100644 --- a/src/layer/place.js +++ b/src/layer/place.js @@ -591,7 +591,7 @@ export const legendEntries = [ layers: [village.id], filter: nonCapitalFilter, }, - { + { description: "Major district", layers: [suburb.id], }, From 3a73a98f8b51c72632c38c1c08600ceaef6e99f1 Mon Sep 17 00:00:00 2001 From: wmisener <58491489+wmisener@users.noreply.github.com> Date: Mon, 15 Jul 2024 21:32:39 -0700 Subject: [PATCH 4/9] Font size and spacing upgrades Make suburb labels bigger at z11 and 12, and make letter spacing increase with zoom level for all three place values --- src/layer/place.js | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/layer/place.js b/src/layer/place.js index f4d10f865..fdb6e1b2c 100644 --- a/src/layer/place.js +++ b/src/layer/place.js @@ -231,15 +231,23 @@ export const suburb = { "text-size": { base: 1.2, stops: [ - [10, 10], - [12, 14], + [10, 12], + [12, 15], [14, 18], ], }, "text-field": Label.localizedName, "text-padding": 1, "text-transform": "uppercase", - "text-letter-spacing": 0.04, + "text-letter-spacing": { + base:0.04, + stops: [ + [11, 0.04], + [12, 0.08], + [13, 0.2], + [14, 0.4], + ], + }, "text-variable-anchor": ["center"], "text-radial-offset": [ "interpolate", @@ -289,7 +297,13 @@ export const quarter = { "text-field": Label.localizedName, "text-padding": 1, "text-transform": "uppercase", - "text-letter-spacing": 0.04, + "text-letter-spacing": { + base:0.04, + stops: [ + [14, 0.08], + [15, 0.2], + ], + }, "text-variable-anchor": ["center"], "text-radial-offset": [ "interpolate", @@ -338,7 +352,13 @@ export const neighborhood = { "text-field": Label.localizedName, "text-padding": 1, "text-transform": "uppercase", - "text-letter-spacing": 0.04, + "text-letter-spacing": { + base:0.04, + stops: [ + [15, 0.08], + [16, 0.2], + ], + }, "text-variable-anchor": ["center"], "text-radial-offset": [ "interpolate", From f679a6303ec7e065a0d59d97f7a287a8385e2ef3 Mon Sep 17 00:00:00 2001 From: wmisener <58491489+wmisener@users.noreply.github.com> Date: Mon, 15 Jul 2024 21:44:05 -0700 Subject: [PATCH 5/9] Taginfo for places --- scripts/taginfo_template.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/scripts/taginfo_template.json b/scripts/taginfo_template.json index 672adcccb..f2e38c92d 100644 --- a/scripts/taginfo_template.json +++ b/scripts/taginfo_template.json @@ -47,6 +47,27 @@ "doc_url": "https://openmaptiles.org/schema/#capital", "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/star_state_capital.svg" }, + { + "key": "place", + "value": "suburb", + "object_types": ["node"], + "description": "Suburbs are labeled in capital letters.", + "doc_url": "https://openmaptiles.org/schema/#place", + }, + { + "key": "place", + "value": "quarter", + "object_types": ["node"], + "description": "Quarters are labeled in capital letters.", + "doc_url": "https://openmaptiles.org/schema/#place", + }, + { + "key": "place", + "value": "neighbourhood", + "object_types": ["node"], + "description": "Neighborhoods are labeled in capital letters.", + "doc_url": "https://openmaptiles.org/schema/#place", + }, { "key": "disputed", "value": "yes", From d2f392e0627b4b187545a6d98235d8fe880a298f Mon Sep 17 00:00:00 2001 From: wmisener <58491489+wmisener@users.noreply.github.com> Date: Mon, 15 Jul 2024 21:45:37 -0700 Subject: [PATCH 6/9] Prettify --- scripts/taginfo_template.json | 6 +++--- src/layer/place.js | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/taginfo_template.json b/scripts/taginfo_template.json index f2e38c92d..fdac3eed5 100644 --- a/scripts/taginfo_template.json +++ b/scripts/taginfo_template.json @@ -52,21 +52,21 @@ "value": "suburb", "object_types": ["node"], "description": "Suburbs are labeled in capital letters.", - "doc_url": "https://openmaptiles.org/schema/#place", + "doc_url": "https://openmaptiles.org/schema/#place" }, { "key": "place", "value": "quarter", "object_types": ["node"], "description": "Quarters are labeled in capital letters.", - "doc_url": "https://openmaptiles.org/schema/#place", + "doc_url": "https://openmaptiles.org/schema/#place" }, { "key": "place", "value": "neighbourhood", "object_types": ["node"], "description": "Neighborhoods are labeled in capital letters.", - "doc_url": "https://openmaptiles.org/schema/#place", + "doc_url": "https://openmaptiles.org/schema/#place" }, { "key": "disputed", diff --git a/src/layer/place.js b/src/layer/place.js index fdb6e1b2c..192c3a086 100644 --- a/src/layer/place.js +++ b/src/layer/place.js @@ -240,14 +240,14 @@ export const suburb = { "text-padding": 1, "text-transform": "uppercase", "text-letter-spacing": { - base:0.04, + base: 0.04, stops: [ [11, 0.04], [12, 0.08], [13, 0.2], [14, 0.4], ], - }, + }, "text-variable-anchor": ["center"], "text-radial-offset": [ "interpolate", @@ -298,12 +298,12 @@ export const quarter = { "text-padding": 1, "text-transform": "uppercase", "text-letter-spacing": { - base:0.04, + base: 0.04, stops: [ [14, 0.08], [15, 0.2], ], - }, + }, "text-variable-anchor": ["center"], "text-radial-offset": [ "interpolate", @@ -353,12 +353,12 @@ export const neighborhood = { "text-padding": 1, "text-transform": "uppercase", "text-letter-spacing": { - base:0.04, + base: 0.04, stops: [ [15, 0.08], [16, 0.2], ], - }, + }, "text-variable-anchor": ["center"], "text-radial-offset": [ "interpolate", From 67140b536112d6f89ae662fdd3199be780051831 Mon Sep 17 00:00:00 2001 From: wmisener <58491489+wmisener@users.noreply.github.com> Date: Thu, 18 Jul 2024 19:35:31 -0700 Subject: [PATCH 7/9] Rearrange taginfo more logically --- scripts/taginfo_template.json | 42 +++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/scripts/taginfo_template.json b/scripts/taginfo_template.json index 6ff25da08..2266cf159 100644 --- a/scripts/taginfo_template.json +++ b/scripts/taginfo_template.json @@ -47,13 +47,6 @@ "doc_url": "https://openmaptiles.org/schema/#capital", "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/star_state_capital.svg" }, - { - "key": "place", - "value": "suburb", - "object_types": ["node"], - "description": "Suburbs are labeled in capital letters.", - "doc_url": "https://openmaptiles.org/schema/#place" - }, { "key": "capital", "value": "5", @@ -126,13 +119,6 @@ "description": "Continents are labeled in capital letters.", "doc_url": "https://openmaptiles.org/schema/#place" }, - { - "key": "place", - "value": "quarter", - "object_types": ["node"], - "description": "Quarters are labeled in capital letters.", - "doc_url": "https://openmaptiles.org/schema/#place" - }, { "key": "place", "value": "country", @@ -140,13 +126,6 @@ "description": "Countries are labeled in mixed case.", "doc_url": "https://openmaptiles.org/schema/#place" }, - { - "key": "place", - "value": "neighbourhood", - "object_types": ["node"], - "description": "Neighborhoods are labeled in capital letters.", - "doc_url": "https://openmaptiles.org/schema/#place" - }, { "key": "place", "value": "state", @@ -178,6 +157,27 @@ "doc_url": "https://openmaptiles.org/schema/#place", "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/place_dot.svg" }, + { + "key": "place", + "value": "suburb", + "object_types": ["node"], + "description": "Suburbs are labeled in capital letters.", + "doc_url": "https://openmaptiles.org/schema/#place" + }, + { + "key": "place", + "value": "quarter", + "object_types": ["node"], + "description": "Quarters are labeled in capital letters.", + "doc_url": "https://openmaptiles.org/schema/#place" + }, + { + "key": "place", + "value": "neighbourhood", + "object_types": ["node"], + "description": "Neighborhoods are labeled in capital letters.", + "doc_url": "https://openmaptiles.org/schema/#place" + }, { "key": "disputed", "value": "yes", From 442676ee3a3b213d3f26def03714cb56709f7262 Mon Sep 17 00:00:00 2001 From: William Misener <58491489+wmisener@users.noreply.github.com> Date: Wed, 20 Nov 2024 22:15:19 -0500 Subject: [PATCH 8/9] Rename color variable Same color as waterLabel, but now named urbanSubAreaLabel --- src/constants/color.js | 2 ++ src/layer/place.js | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/constants/color.js b/src/constants/color.js index e2bf7bdc7..cf6851c19 100644 --- a/src/constants/color.js +++ b/src/constants/color.js @@ -28,6 +28,8 @@ export const airportOutline = "hsl(250, 41%, 79%)"; export const airportRunway = "hsl(250, 41%, 79%)"; export const airportLabel = "hsl(250, 71%, 29%)"; +export const urbanSubAreaLabel = "hsl(211, 43%, 28%)"; + //TODO - rename this variable to "palette" export const palette = { black: "black", diff --git a/src/layer/place.js b/src/layer/place.js index 192c3a086..0abda0ef0 100644 --- a/src/layer/place.js +++ b/src/layer/place.js @@ -212,7 +212,7 @@ export const suburb = { id: "place_suburb", type: "symbol", paint: { - "text-color": Color.waterLabel, + "text-color": Color.urbanSubAreaLabel, "text-halo-color": labelHaloColor, "text-halo-width": [ "interpolate", @@ -270,7 +270,7 @@ export const quarter = { id: "place_quarter", type: "symbol", paint: { - "text-color": Color.waterLabel, + "text-color": Color.urbanSubAreaLabel, "text-halo-color": labelHaloColor, "text-halo-width": [ "interpolate", @@ -326,7 +326,7 @@ export const neighborhood = { id: "place_neighborhood", type: "symbol", paint: { - "text-color": Color.waterLabel, + "text-color": Color.urbanSubAreaLabel, "text-halo-color": labelHaloColor, "text-halo-width": [ "interpolate", From ec2d603c454be2d55c960bd8bf668160400394eb Mon Sep 17 00:00:00 2001 From: William Misener <58491489+wmisener@users.noreply.github.com> Date: Wed, 20 Nov 2024 23:23:58 -0500 Subject: [PATCH 9/9] Fixes icon links for capital icons in taginfo --- scripts/taginfo_template.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/taginfo_template.json b/scripts/taginfo_template.json index 9f332a06e..d6fe04842 100644 --- a/scripts/taginfo_template.json +++ b/scripts/taginfo_template.json @@ -21,7 +21,7 @@ "object_types": ["node"], "description": "Marks the city with a national capital icon.", "doc_url": "https://openmaptiles.org/schema/#capital", - "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/star_nation_capital.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/place_star_in_circle.svg" }, { "key": "capital", @@ -29,7 +29,7 @@ "object_types": ["node"], "description": "Marks the city with a national capital icon.", "doc_url": "https://openmaptiles.org/schema/#capital", - "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/star_nation_capital.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/place_star_in_circle.svg" }, { "key": "capital", @@ -37,7 +37,7 @@ "object_types": ["node"], "description": "Marks the city with a state capital icon.", "doc_url": "https://openmaptiles.org/schema/#capital", - "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/star_state_capital.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/place_star.svg" }, { "key": "capital", @@ -45,7 +45,7 @@ "object_types": ["node"], "description": "Marks the city with a state capital icon.", "doc_url": "https://openmaptiles.org/schema/#capital", - "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/star_state_capital.svg" + "icon_url": "https://raw.githubusercontent.com/osm-americana/openstreetmap-americana/main/icons/place_star.svg" }, { "key": "capital",