0

I was going through the routing example Simple Routing which works on map click event. I am bale to replicate the same but instead of click I want the routing to take place using 2 different x,y.

Is there a reference or example for doing this with at least 2 hard coded points?

3
  • Welcome to GIS SE! As a new user be sure to take the Tour to learn about our focussed Q&A format. You said "I checked this" but what is "this"? – PolyGeo Aug 2 '18 at 2:51
  • Hi, I made have the following code to bring the data. routeParams.stops.features = []; if (features && features.length > 0) { array.forEach(features, lang.hitch(this, function (feature) { routeParams.stops.features.push(feature); } })); And here I am getting an error feature refrence error. – Aditya Kumar Aug 2 '18 at 4:34
  • Please use the edit button beneath your question to revise it with any requested clarifications. – PolyGeo Aug 2 '18 at 5:27
0

Aditya, here's an example based on the sample from https://developers.arcgis.com/javascript/latest/sample-code/tasks-route/index.html but that instead of user input on the map takes hardcoded values as input to the routing service. And displays the route on the map.

https://codepen.io/bsvensson/pen/NBLwMm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.