diff --git a/src/js/style.js b/src/js/style.js index bcf72ed6c..cf5a56c1b 100644 --- a/src/js/style.js +++ b/src/js/style.js @@ -2,6 +2,8 @@ import * as Layers from "../layer/index.js"; // Generate style.json export function build(tileURL, spriteURL, glyphURL, locales) { + let today = new Date(); + let fool = today.getMonth() === 3 && today.getDate() === 1; return { name: "Americana", glyphs: glyphURL, @@ -11,6 +13,24 @@ export function build(tileURL, spriteURL, glyphURL, locales) { url: tileURL, type: "vector", }, + controlcities: { + type: "geojson", + data: fool ? { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "name": "Other Desert Cities" + } + "geometry": { + "type": "Point", + "coordinates": [-116.3694769,33.7667042] + } + } + ] + } : {} + }, }, sprite: spriteURL, light: { diff --git a/src/layer/index.js b/src/layer/index.js index ba083d910..0fd0ba410 100644 --- a/src/layer/index.js +++ b/src/layer/index.js @@ -165,6 +165,7 @@ export function build(locales) { lyrPlace.village, lyrPlace.town, lyrPlace.city, + lyrPlace.controlcities, lyrPlace.countryOther, lyrPlace.country3, lyrPlace.country2, diff --git a/src/layer/place.js b/src/layer/place.js index a034b8d32..980645d79 100644 --- a/src/layer/place.js +++ b/src/layer/place.js @@ -202,6 +202,63 @@ export const city = { metadata: {}, }; +export const controlcities = { + id: "controlcities", + type: "symbol", + paint: cityLabelPaint, + layout: { + "text-font": ["Americana-Bold"], + "text-size": { + base: 1.2, + stops: [ + [4, 11], + [7, 14], + [11, 24], + ], + }, + "icon-image": [ + "match", + ["get", "capital"], + 2, + "place_star_in_circle", + 3, + "place_star", + 4, + "place_star", + "place_dot", + ], + "icon-size": { + base: 1.2, + stops: [ + [4, 0.4], + [7, 0.5], + [11, 0.9], + ], + }, + "text-field": Label.localizedNameWithLocalGloss, + "text-anchor": "bottom", + "text-variable-anchor": [ + "bottom", + "bottom-right", + "bottom-left", + "right", + "left", + ], + "text-justify": "auto", + "text-radial-offset": ["match", ["get", "capital"], 2, 0.7, 0.5], + "icon-optional": false, + "text-max-width": 8, + "icon-padding": 0, + "text-padding": 1, + "icon-allow-overlap": false, + }, + source: "controlcities", + minzoom: 4, + maxzoom: 12, + "source-layer": "place", + metadata: {}, +}; + export const state = { id: "place_state", type: "symbol",