How can i convert coordinates to routeparam compatible stops in order to carry out a RouteTask?
These coordinates are coming from the browser geolocation. Currently when i click on a point and then use the geolocation from the browser I get an error from attempting to solve the route, however when i click on 2 separate points the route solves successfully.
Solved! Go to Solution.
I am going to try that right now, should I pass in the new geom object to the stops array in the routeparams?
This indeed works, so in order to use coordinates you have to convert the geometry to webmercator geometry first then push that to the routes params. Esri should make a note of this, or amend it in future releases. thanks for pointing out the suggestions I was stumped.
Evon,
I don't think they have to be in Web Mercator it is just the fact that all the stops have to be in the same WKID.
Ok I see, i guess the clicked points were not in the same wkid then.
Evon,
Correct the clicked points would be created in the WKID of the Map. Which if you are using a standard esri basemap means that it would be WKID 102100 and the browsers geolocation will always be WKID 4326.