Page 1 of 3

Google Maps geolocation

Posted: Fri Apr 11, 2014 11:06 am
by Colin Snowmann

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...


Google Maps geolocation

Posted: Fri Apr 11, 2014 11:08 am
by Maryna Brodina

Hello!

Could you clarify what exactly doesn't work?


Google Maps geolocation

Posted: Fri Apr 11, 2014 1:13 pm
by Colin Snowmann

The app doesnt seem to be working.
I have made it public for testing
http://appery.io/app/mobile-frame?src...


Google Maps geolocation

Posted: Fri Apr 11, 2014 1:15 pm
by Colin Snowmann

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);
}
});
}


Google Maps geolocation

Posted: Fri Apr 11, 2014 1:17 pm
by Maryna Brodina

Do you invoke service on button click?


Google Maps geolocation

Posted: Fri Apr 11, 2014 1:23 pm
by Maryna Brodina

Could you clarify where did you place this code?


Google Maps geolocation

Posted: Fri Apr 11, 2014 1:37 pm
by Colin Snowmann

I did not invoke the service, I ran javascript and I placed the code as shwn below Image


Google Maps geolocation

Posted: Fri Apr 11, 2014 1:57 pm
by Colin Snowmann

Google Maps geolocation

Posted: Fri Apr 11, 2014 2:02 pm
by Maryna Brodina

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


Google Maps geolocation

Posted: Fri Apr 11, 2014 2:15 pm
by Colin Snowmann

I have made all those changes and still no avail
Image