Hello everybody,
I'm trying to recover through the object GDirections, all routes of a
route.
I did the code below as a test, but I'm only getting 1 route to
retrieve the itinerary provided. However, when I query the web service
from google maps, I realize that there are other routes to the route.
Someone could give a help? Grateful now.
Julio Santana
===============================================
code test
var map;
var directionsPanel;
var dirObj;
var summaryHTML;
var distance;
var duration;
var numRoutes;
var getNumEtapas;
function initialize() {
map = new
GMap2(document.getElementById("map_canvas"));
directionsPanel =
document.getElementById("my_textual_div");
query = "from: rua ana neri, rio de janeiro to: rua
medina, méier, rio de janeiro";
dirObj = new GDirections(map, directionsPanel);
dirObj.load(query);
}
function exibeDetalhesDoMapa(){
summaryHTML = dirObj.getSummaryHtml();
distance = dirObj.getDistance().meters;
duration = dirObj.getDuration().seconds;
numRoutes = dirObj.getNumRoutes();
getNumEtapas =
dirObj.getRoute(0).getNumSteps();
var sumario = summaryHTML;
alert("Sumário: "+sumario);
alert("Distância Total: "+distance);
alert("Duração Total: "+duration);
alert("Número de Rotas "+numRoutes);
alert("Número de Etapas da Rota:
"+getNumEtapas);
}
-----------------------------------------------------------------------------------------------------------------
Olá pessoal,
Estou tentando recuperar através do objeto GDirections, todas as rotas
de um itinerário.
Fiz o código abaixo como teste, porém, só estou conseguindo recuperar
1 rota para o itinerário fornecido. No entanto, quando consulto o
serviço web do google maps, percebo a existência de outras rotas para
o itinerário.
Alguém poderia dar uma ajuda? Grato desde já.
Julio Santana
--
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=en.