I'm trying to figure out how to dynamically move the location geometry location in Google Places in the dynamic direction of a route service request. If i use
service.getDetails({ placeId: 'ChIJy_YmBMEMIocRZF8r5wPFMYU' }, function(place, status) { if (status === google.maps.places.PlacesServiceStatus.OK) { var marker = new google.maps.Marker({ map: map, position: place.geometry.location, icon: 'img/pillicon.jpg' }); }
to get a position, how can I pass this to my request like this
var request = { origin: currentLoc, destination: place.geometry.location, //not sure about this travelMode: google.maps.DirectionsTravelMode.DRIVING };
I tried returning place.geometry.location and then calling it and converting it to a string, but I still cannot access it. Thank you for being new to javascript
source share