Note that DirectionsResult does not have a constructor: http://code.google.com/apis/maps/documentation/javascript/reference.html#DirectionsResult
It is just a data structure that you get back from the server. You could simply build your own arbitrary object or array, like var myRoutes = []; ... myRoutes.push(tmp_routes[j]); -- Marcelo - http://maps.forum.nu -- On Feb 9, 4:53 am, Morwust <morw...@gmail.com> wrote: > Hi, > > I want to do a request to google.maps.DirectionsService() with more > than 8 waypoints. Because i can't i do my own javascript function that > separate all the points to do some requests. > > Then I have a google.maps.DirectionsResult array. I want to iterate it > and include each google.maps.DirectionsRoute item on the routes > propery of a new google.maps.DirectionsResult. > > But i can't instantiate a google.maps.DirectionsResult object. > > Something like this: > //result is a google.maps.DirectionsResult array > var directions = new google.maps.DirectionsResult(); > for(i=0; i<result.length; i++) > { > var tmp_routes = result[i].routes; > for(j=0; j<tmp_routes.length; j++) > { > directions.routes.push(tmp_routes[j]); > } > > > > > > > > } -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to google-maps-js-api-v3@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.