Arcgis javascript API 4.1:Label graphic layer with fonts not working

1368
2
01-30-2019 08:11 PM
zahidullakhanjunaid
New Contributor

Javascript API 4.1 : when adding a label grapgic layer in offline maps locally deployed and using text symbol, the label is not shown and it gives an error as mapview-invalid-resource, couldn't find font arial-unicode-ms-regular. falling back to Arial Unicode MS Regular. No matter what font family you set it aslways show this error. and lebels are never shown.

How to use offline fonts for arcgis javascript api's 4.1 .

2 Replies
JoshKing
New Contributor II

I have the same error:  "mapview-invalid-resource", message: "Couldn't find font arial-unicode-ms-regular. Falling back to Arial Unicode MS Regular"

This is when trying to use the DistanceMeasurement2D and AreaMeasurement2D widgets.  The graphics are not drawing correctly on the map when using the widgets.  This is the standard map view, not using a webmap.  

Using the 4.14.1 JS API

cwmat
by
New Contributor

I recognize this is old, and may not even be the same issue.  But in case it is helpful for anyone else.  I was having the same issue as JoshKing and (sort of related to the OP's issue) RE font error.  When looking at network traffic looked like I was getting a 403 when the API was trying to call https://static.arcgis.com/fonts/arial-unicode-ms-regular/0-255.pbf to get the font for the measure widget's labels.  

For me, turns out I had maxUrlLength set too low in esri config:

https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request

Which was causing the above font request to be sent as a POST which resulted in the 403.

Increasing maxUrlLength solved my issue.

 

0 Kudos