Skip to content

Commit

Permalink
4/1
Browse files Browse the repository at this point in the history
  • Loading branch information
bmacs001 committed Mar 13, 2024
1 parent e5ce938 commit 3d21c5d
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/js/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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: {
Expand Down
1 change: 1 addition & 0 deletions src/layer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ export function build(locales) {
lyrPlace.village,
lyrPlace.town,
lyrPlace.city,
lyrPlace.controlcities,
lyrPlace.countryOther,
lyrPlace.country3,
lyrPlace.country2,
Expand Down
57 changes: 57 additions & 0 deletions src/layer/place.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 3d21c5d

Please sign in to comment.