Select to view content in your preferred language

Measurement widget does not work on disconnected Environment

1796
8
02-21-2021 03:10 AM
YObaidat
Occasional Contributor

When deploying JS API version 4.18 on Winodws/IIS everything works very well expect the measurement tool. When no internet and start using measurement widget it requests a file from  https://static.arcgis.com/fonts/arial-unicode-ms-regular/0-255.pbf.

And since no internet is available on the user's machine he is not able to use the widget properly. 

I hope someone at esri can provide a solution for this issue. 

Thanks,

 

 

0 Kudos
8 Replies
Noah-Sager
Esri Regular Contributor

Hi @YObaidat, there should be a fallback font available for the Measurement widget to use. Is that not happening? What does it mean that the widget cannot be used properly?

0 Kudos
YObaidat
Occasional Contributor

Hi @Noah-Sager . Exactly the locally hosted API doesn't fallback to a locally hosted font . As you can see in the attached snapshots. I hosted 4.18 API on windows IIS on a local server and when using the measurement widget without internet, the symbology of the measurement graphic on the map appears incomplete.

0 Kudos
Noah-Sager
Esri Regular Contributor

Is that app running over http or https? What's in the console? What happens with Google Chrome browser?

0 Kudos
YObaidat
Occasional Contributor

The app in the snapshots is running on http. The console shows that, when I use measurement widget the API make a request to https://static.arcgis.com/fonts/arial-unicode-ms-regular/0-255.pbf. Also I changed the app to work on https and recorded a video to the issue(video link: https://youtu.be/llS3KPlEwN4) . I want to note here , I tested the app on latest version of Firefox and chrome and the problem appeared in both.

0 Kudos
YObaidat
Occasional Contributor
0 Kudos
Noah-Sager
Esri Regular Contributor

Hi @YObaidat , my apologies as I did not see the message from 2 weeks ago. Thank you for the video, as I was concerned about the http vs https and different browser behavior. I did some more digging and we are aware of this issue, and we're working on a fix for a future release.

In the meantime, you could try pointing to a local font resource using this property, so it no longer looks online for the font:
https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#fontsUrl


0 Kudos
GregoryBologna
Frequent Contributor

I have the same missing font issue when starting a new measurement in JS 4.22, except I have an Internet connection and I am not specifying a font anywhere in my map code. I have not changed any of the measurement widget implementation since 4.12. It is odd to me that this shows as an error in the browser instead of a warning since the framework is using a fallback. I'm not familiar with loading font for esri JS. Is there a complete example somewhere?

0 Kudos
Noah-Sager
Esri Regular Contributor

Hi @GregoryBologna, unfortunately, that is a known issue that will be fixed at the next release (4.23). For loading a custom/local font, there is more information here: 

https://developers.arcgis.com/javascript/latest/labeling/#featurelayer-csvlayer-and-streamlayer

and here:

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