Hi, I'm trying to limit the travel modes in the direction's widget. Is there a simple way to get rid of the travel modes in the directions widget? I only want Driving Distance and Walking distance.
Thank you!
Hi @JohnPaulAlbana, thanks for the question. The available Travel modes are based on the ArcGIS Online org settings. If you define the Travel modes you want in your org, then define the URL to your org using https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#portalUrl
in your app, then you will only see the options you defined in the Directions widget Travel mode dropdown.
@Noah-Sager Hi, it might be a silly question but where can I find my portal URL? I already have checked in ArcGIS Online and I can confirm that my administrator has set the directions to only show distance travel modes
this is what I have and it seems to not work.
That looks correct to me, but the error message in the console is about CORS. I would try testing the app in something like Codepen or another https location rather than from http from your localhost.
Hi @Noah-Sager ,
I get the same error in code pen. Is there a certain setting that I need to turn on/off to allow this?
Strange, it works for me with codepen and my org. I'm not sure if there is a setting to allow this, but I found this doc, maybe this will help?
https://doc.arcgis.com/en/arcgis-online/administer/configure-security.htm