Hi.
I am struggling with my directionsScreen, and to get the map updated with correct destinations. The Panel with discriptions are updated right away, but the map, nothing is happening, it stays put on default address; San Francisco, CA
oh.. and,, I have double and tripple checked the component names
Suggestions?
Screen - load - javascript
code
var startLocation = '59.32893000000001, 18.06491';
var endLocation = '52.32893000000001, 18.064910000000054';
var directionsDisplay;
var directionsService = new google.maps.DirectionsService();
var map = Appery("directionsMap").gmap;
var panel = Appery("directionsPanel")[0];
function initDirections() {
directionsDisplay = new google.maps.DirectionsRenderer();
}
function displayDirections(sourceLocation, destinationLocation, map, panel) {
var request = {
origin: sourceLocation,
destination: destinationLocation,
travelMode: google.maps.DirectionsTravelMode.DRIVING
};
directionsService.route(request, function(response, status) {
directionsDisplay.setMap(map);
if (panel !== null) {
directionsDisplay.setPanel(panel);
}
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
} else {
alert("Directions query unsuccessful. Response status: " + status);
}
});
}
initDirections();
displayDirections(startLocation, endLocation, map, panel);
/code