Using GPS coordinates as inputs for driving directions

827
3
07-12-2014 07:34 PM
JohnPapageorgiou
New Contributor III

Hi,

I'm working on a javascript webmap application, and I want to incorporate the functionality of the sample located at: Directions Widget‌.  What I'm trying to do is use the output of the geoLocate sample to populate field A and then use the GPS coordinates of my destination point to populate field B.  Is there a place in the code where this capability is accessible?  Am I missing something?  Can this script be manipulated to allow for GPS data to be entered as variables in these fields without copying and pasting addresses location. You know they way it's done in Bing or Google?

I have created route geoprocessing tool that is hosted on a ArcGIS for server so I won't have to use credits from ArcGIS online. 

Thanks,

John

0 Kudos
3 Replies
williamcarr
Occasional Contributor II

Are you searching for a point by GPS coordinates or just GPS coordinates alone?

This example by John Gravois might help. 

http://johngravois.com/maps/directions-click.html

0 Kudos
JakeSkinner
Esri Esteemed Contributor

Hi John,

You can reverse geocode your coordinates using the locationToAddress method.  Next, use the Directions class updateStop method to populate your destination.  You can take a look at a JS Fiddle of this here (you will need to login using an ArcGIS.com named user).

0 Kudos
DonOpgenorth
Esri Contributor

I've moved your post into the  Arcgis API for Javascript space. You will get a much better answer here as the GeoNet Help is intended for community help and feedback. I have also added in a few additional tags. You can see more on the community structure, and what topics are under each space from the following documents:

GeoNet Community Structure

ArcGIS Discussion Forums Migration Strategy

Thanks!

Don

0 Kudos