I have a local ExB Dev Edition tied to a custom routing service. The directions widget I set the units as imperial. When I download a zip and deploy it to a web server the directions widget returns routes in meters instead.
The imperial units do show in the draft preview and in the published item view while still using the Dev Edition before the zip is made.
Is there a work around until the bug is addressed?
This behavior I have seen on both 1.17 and 1.18
Solved! Go to Solution.
I found a solution for it. Not sure why, but on download, the widget setting for "unit" is not added to the widget's config. In the main cdn\config.json
Adding the line: "unit": "imperial",
This did the trick.
Example inline:
"widget_##":{
...
"routeConfig":{ ... },
"searchConfig":{ ... },
"unit": "imperial",
"enableRouteSaving": true,
...
... },
Hi @Treavon , Are you accessing the draft and the published item using the same user credentials? Units preferences may be stored at the org/user settings level and may affect what you see in the app. Something to double-check.
While in the Developer Edition I am accessing the draft and published item using an ArcGIS Online Account.
When deployed to a web server this is accessed publicly and anonymously by users.
To check, I updated my own user accounts' unit preferences to metric.
This does seem to be stored in the user's account settings.
But that means the SDK's unit toggle has no purpose?
A user's preferences override it and anonymous users do not see the widget setting either.
I found a solution for it. Not sure why, but on download, the widget setting for "unit" is not added to the widget's config. In the main cdn\config.json
Adding the line: "unit": "imperial",
This did the trick.
Example inline:
"widget_##":{
...
"routeConfig":{ ... },
"searchConfig":{ ... },
"unit": "imperial",
"enableRouteSaving": true,
...
... },