I am using the tutorial on how to make a directions app but I need it to use my current location and take me to my business.
I am using the tutorial on how to make a directions app but I need it to use my current location and take me to my business.
Hello - for create such an app, you will need:
ul
lito use a Geolocation service/li
get current coordinates and save them;
define the destination adress (there are several approaches for a static adress: you can store this data in a database or define it as a local storage);
lithen you need to pass these coordinates (current and destination) to the Google Directions service -- as variables for sourceAddress and destinationAddress in this part/li
/ul
Yes. I know that but how do I, using the code:
var sourceAddress = Appery("inputSource").val();
var destinationAddress = Appery("inputDestination").val();
var map = Appery("directionsMap").gmap;
displayDirections(sourceAddress, destinationAddress, map);
get the Latitude and Longitude from the storage variables? Meaning, what do I replace the "var sourceAddress = Appery("inputSource").val();" with to
read the local variable and what do I replace the "var destinationAddress = Appery("inputDestination").val();" with to use a set destination? Does it read the address as a String and pass that to google or what?
You can use local storage API directly to read the values: https://developer.mozilla.org/en-US/d...
I have the same question and the answers given don't really help.
Hi Grant.
I believe Illya gives you good direction on how to build your application. What specific question do you have?
Can you please answer the question with detailed step by step instructions?
Hello! Could you clarify what is specific question you have?
What are the step by step instruction for making an app that gives directions from a given location to a unchangeable location?