mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-05-27 02:25:10 +00:00
fix map localization
This commit is contained in:
@@ -1698,7 +1698,12 @@
|
|||||||
"layout": {
|
"layout": {
|
||||||
"icon-image": "mountain_11",
|
"icon-image": "mountain_11",
|
||||||
"text-anchor": "top",
|
"text-anchor": "top",
|
||||||
"text-field": ["get", "name"],
|
"text-field": [
|
||||||
|
"case",
|
||||||
|
["has", "name:nonlatin"],
|
||||||
|
["concat", ["get", "name:latin"], " ", ["get", "name:nonlatin"]],
|
||||||
|
["coalesce", ["get", "name_en"], ["get", "name"]]
|
||||||
|
],
|
||||||
"text-font": ["Noto Sans Regular"],
|
"text-font": ["Noto Sans Regular"],
|
||||||
"text-max-width": 9,
|
"text-max-width": 9,
|
||||||
"text-offset": [0, 0.6],
|
"text-offset": [0, 0.6],
|
||||||
@@ -1727,7 +1732,12 @@
|
|||||||
"layout": {
|
"layout": {
|
||||||
"icon-image": "attraction_11",
|
"icon-image": "attraction_11",
|
||||||
"text-anchor": "top",
|
"text-anchor": "top",
|
||||||
"text-field": ["get", "name"],
|
"text-field": [
|
||||||
|
"case",
|
||||||
|
["has", "name:nonlatin"],
|
||||||
|
["concat", ["get", "name:latin"], " ", ["get", "name:nonlatin"]],
|
||||||
|
["coalesce", ["get", "name_en"], ["get", "name"]]
|
||||||
|
],
|
||||||
"text-font": ["Noto Sans Regular"],
|
"text-font": ["Noto Sans Regular"],
|
||||||
"text-max-width": 9,
|
"text-max-width": 9,
|
||||||
"text-offset": [0, 0.6],
|
"text-offset": [0, 0.6],
|
||||||
|
|||||||
@@ -2631,7 +2631,12 @@
|
|||||||
"layout": {
|
"layout": {
|
||||||
"icon-image": "mountain_11",
|
"icon-image": "mountain_11",
|
||||||
"text-anchor": "top",
|
"text-anchor": "top",
|
||||||
"text-field": ["get", "name"],
|
"text-field": [
|
||||||
|
"case",
|
||||||
|
["has", "name:nonlatin"],
|
||||||
|
["concat", ["get", "name:latin"], " ", ["get", "name:nonlatin"]],
|
||||||
|
["coalesce", ["get", "name_en"], ["get", "name"]]
|
||||||
|
],
|
||||||
"text-font": ["Noto Sans Regular"],
|
"text-font": ["Noto Sans Regular"],
|
||||||
"text-max-width": 9,
|
"text-max-width": 9,
|
||||||
"text-offset": [0, 0.6],
|
"text-offset": [0, 0.6],
|
||||||
@@ -2660,7 +2665,12 @@
|
|||||||
"layout": {
|
"layout": {
|
||||||
"icon-image": "attraction_11",
|
"icon-image": "attraction_11",
|
||||||
"text-anchor": "top",
|
"text-anchor": "top",
|
||||||
"text-field": ["get", "name"],
|
"text-field": [
|
||||||
|
"case",
|
||||||
|
["has", "name:nonlatin"],
|
||||||
|
["concat", ["get", "name:latin"], " ", ["get", "name:nonlatin"]],
|
||||||
|
["coalesce", ["get", "name_en"], ["get", "name"]]
|
||||||
|
],
|
||||||
"text-font": ["Noto Sans Regular"],
|
"text-font": ["Noto Sans Regular"],
|
||||||
"text-max-width": 9,
|
"text-max-width": 9,
|
||||||
"text-offset": [0, 0.6],
|
"text-offset": [0, 0.6],
|
||||||
|
|||||||
@@ -233,12 +233,13 @@ export class StyleManager {
|
|||||||
const textField = layer.layout['text-field'];
|
const textField = layer.layout['text-field'];
|
||||||
if (
|
if (
|
||||||
Array.isArray(textField) &&
|
Array.isArray(textField) &&
|
||||||
textField.length >= 2 &&
|
textField.length == 4 &&
|
||||||
textField[0] === 'coalesce' &&
|
Array.isArray(textField[3]) &&
|
||||||
Array.isArray(textField[1]) &&
|
textField[3][0] === 'coalesce' &&
|
||||||
textField[1][0] === 'get' &&
|
Array.isArray(textField[3][1]) &&
|
||||||
typeof textField[1][1] === 'string' &&
|
textField[3][1][0] === 'get' &&
|
||||||
textField[1][1].startsWith('name')
|
typeof textField[3][1][1] === 'string' &&
|
||||||
|
textField[3][1][1].startsWith('name')
|
||||||
) {
|
) {
|
||||||
layer.layout['text-field'] = [
|
layer.layout['text-field'] = [
|
||||||
'coalesce',
|
'coalesce',
|
||||||
|
|||||||
Reference in New Issue
Block a user