Esri / Esri/esri-leaflet-vector

Text labels not showing for certain vector tile layers

Open
#121 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
72
Forks
54
PR merge metrics
No merged PRs in 30d

Description

## Issue summary

When using Esri Leaflet Vector to add vector tile basemap layers in other languages, on some langauges (like Arabic) the text labels do not show on in the layer.

## Italian is working:

See web map [4d1c336e57504552a04552600122f96a](https://www.arcgis.com/home/item.html?id=4d1c336e57504552a04552600122f96a):

- See how the font is loaded correctly on ArcGIS Online: https://www.arcgis.com/apps/mapviewer/index.html?webmap=4d1c336e57504552a04552600122f96a
- Take the layer ID from that web map, add it to a leaflet map using `L.esri.Vector.vectorTileLayer("bd47af4aad0847909b3ccd255a429092").addTo(map);`: https://jsbin.com/resuqol/3/edit?html,output
- Expected: layer loads just like in ArcGIS Online
- Actual: layer loads just like in ArcGIS Online ✅

## Arabic is not working:

See web map [8e0c793963b74220b0d18bbd332372cc](https://www.arcgis.com/home/item.html?id=8e0c793963b74220b0d18bbd332372cc):
- See how the font is loaded correctly on ArcGIS Online: https://www.arcgis.com/apps/mapviewer/index.html?webmap=8e0c793963b74220b0d18bbd332372cc
- Take the layer ID from that web map, add it to a leaflet map using `L.esri.Vector.vectorTileLayer("3942a6195c51412c8bb75f1fe82d9a5d").addTo(map);`: https://jsbin.com/xafutow/2/edit?html,output
- Expected: layer loads just like in ArcGIS Online
- Actual: text not loading ❌
![image](https://user-images.githubusercontent.com/209355/155555597-d04934f4-7a9a-412b-8ddd-50fc6e9b11b0.png)

## Potential Cause

If you look at the [style root.json](https://www.arcgis.com/sharing/rest/content/items/3942a6195c51412c8bb75f1fe82d9a5d/resources/styles/root.json?f=json), you'll see that `text-font` is an array, and the layer should "Fall back" to the second font if the first one is not found.

![image](https://user-images.githubusercontent.com/209355/155556320-fab3192e-8465-4722-a649-6574b9f39889.png)

Is it possible that this "falling back" to `Arial Unicode MS Regular` is not happening and thus the font is not showing?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the JSBin Arabic reproduction and the L.esri.Vector.vectorTileLayer entry point, then compare it with the working Italian example. Inspect the Arabic style root.json and its text-font array; done means Arabic labels render with the fallback font as they do in ArcGIS Online.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.