Skip to content

Commit

Permalink
Merge pull request #592 from ZeLonewolf/1ec5-place-gloss-471
Browse files Browse the repository at this point in the history
Gloss city names in the local language
  • Loading branch information
1ec5 authored Dec 5, 2022
2 parents b677e5d + 8025a7d commit f9b08d0
Show file tree
Hide file tree
Showing 10 changed files with 701 additions and 77 deletions.
128 changes: 128 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"open": "^8.4.0"
},
"devDependencies": {
"@maplibre/maplibre-gl-style-spec": "^17.0.1",
"chai": "^4.3.7",
"create-serve": "^1.0.1",
"esbuild": "^0.15.15",
Expand Down
18 changes: 2 additions & 16 deletions src/americana.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,22 +255,7 @@ function buildLayers() {
lyrPlace.continent
);

// Resolve localized name placeholders.
let localizedNameExpression = Label.getLocalizedNameExpression(false);
let legacyLocalizedNameExpression = Label.getLocalizedNameExpression(true);
for (let layer of layers) {
if (
"metadata" in layer &&
"layout" in layer &&
layer.metadata["americana:text-field-localized"] === true
) {
// https://github.com/openmaptiles/openmaptiles/issues/769
layer.layout["text-field"] =
layer["source-layer"] === "transportation_name"
? legacyLocalizedNameExpression
: localizedNameExpression;
}
}
Label.localizeLayers(layers, Label.getLocales());

return layers;
}
Expand Down Expand Up @@ -316,6 +301,7 @@ maplibregl.setRTLTextPlugin(
true
);

window.maplibregl = maplibregl;
export const map = (window.map = new maplibregl.Map({
container: "map", // container id
hash: "map",
Expand Down
Loading

0 comments on commit f9b08d0

Please sign in to comment.