Google Maps geolocation
Hey Guys, I 'm having a problem with the geo location tutorial. I have followed every step as required, how when I test the APP it doesnt seem to work. PLEASE HELP
http://docs.appery.io/tutorials/build...
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Hey Guys, I 'm having a problem with the geo location tutorial. I have followed every step as required, how when I test the APP it doesnt seem to work. PLEASE HELP
http://docs.appery.io/tutorials/build...
Hello!
Could you clarify what exactly doesn't work?
The app doesnt seem to be working.
I have made it public for testing
http://appery.io/app/mobile-frame?src...
This is javascript code that I've used:
var directionsDisplay;
var directionsService = new google.maps.DirectionsService();
function initialize() {
directionsDisplay = new google.maps.DirectionsRenderer();
}
function displayDirections(sourceAddress, destinationAddress, map) {
var request = {
origin: sourceAddress,
destination: destinationAddress,
travelMode: google.maps.DirectionsTravelMode.DRIVING
};
directionsService.route(request, function(response, status) {
directionsDisplay.setMap(map);
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
} else {
alert("Directions query unsuccessful. Response status: " + status);
}
});
}
Do you invoke service on button click?
Could you clarify where did you place this code?
On Get_Directions button Click event according to tutorial you have to add the following code prevar sourceAddress = Appery("inputSource").val();
var destinationAddress = Appery("inputDestination").val();
var map = Appery("directionsMap").gmap;
displayDirections(sourceAddress, destinationAddress, map);/pre