Doman
unread,May 3, 2011, 8:45:22 AM5/3/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to google-map...@googlegroups.com
OK problem solved!
It is easy. Solution needs extracting
coordinates from directions service and then create polyline
accordingly. In below example start and end coordinates are beginning
and end of path searched by directions service and ble is coordinates
which is later attached to polyline without in "free" mode :)
function calcRoute() {
var request = {
origin:start,
destination:end,
travelMode: google.maps.TravelMode.WALKING
};
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK)
{
var steps = response.routes[0].legs[0].steps;
for(var step = 0; step < steps.length; step++)
{
polylineOptions = {
map: mapa,
strokeColor: "#FF0000",
strokeOpacity: 0.7,
strokeWeight: 2,
path: steps[step].path
}
police = new google.maps.Polyline(polylineOptions);
}
police.getPath().push(ble);
}
});
Similar case: it is possibla to copy path created in plain google maps to path format using in google maps api?
BR
Doman