Hi Brendan, Firebug reports "414 Request-URI Too Large". The API has generated a url that is too long to send to Google's directions service. I'll file a bug.
Cheers Ben On Wed, Jan 20, 2010 at 6:29 PM, ipixel <[email protected]> wrote: > Hi All > > Getting an error on a test I'm doing on V3. It concerns the number of > waypoints I have between a 'origin' and 'destination' point. Example > page shown below: > > http://www.starsofwa.com.au/googletest.html > > This is basically taken from the example files for V3 and the error > occurs when there's 12 waypoints, all set to stopover 'true'. If I > remove any of the waypoints and knock it back to 11, then the map will > display the polyline and the DirectionsRenderer shows the step by step > instructions. > > The maximum number of waypoints allowed is 23 plus the 'origin' and > 'destination' according to the documentation - which I assume I would > see the error status of MAX_WAYPOINTS_EXCEEDED, but this is not the > case. > > Code used as follows: > > <script type="text/javascript"> > var directionsDisplay; > var directionsService = new google.maps.DirectionsService(); > var map; > > function initialize() { > directionsDisplay = new google.maps.DirectionsRenderer(); > var chicago = new google.maps.LatLng(-25.363882,120.27832); > var myOptions = { > zoom:5, > mapTypeId: google.maps.MapTypeId.ROADMAP, > center: chicago > } > map = new google.maps.Map(document.getElementById("map_canvas"), > myOptions); > directionsDisplay.setMap(map); > directionsDisplay.setPanel(document.getElementById > ("directionsPanel")); > > calcRoute() > } > > function calcRoute() { > var request = { > origin: "Perth, WA", > destination: "Albany WA", > waypoints: [ > { > location: new google.maps.LatLng > (-32.304291378,115.702241063), > stopover:true > },{ > location: new google.maps.LatLng > (-33.319734803,115.643162727), > stopover:true > },{ > location: new google.maps.LatLng > (-33.644277591,115.344353914), > stopover:true > },{ > location: new google.maps.LatLng > (-33.642241142,115.034279823), > stopover:true > },{ > location: new google.maps.LatLng > (-33.698761474,115.016212463), > stopover:true > },{ > location: new google.maps.LatLng > (-33.966204552,115.070800781), > stopover:true > },{ > location: new google.maps.LatLng > (-34.837547610,116.004209518), > stopover:true > },{ > location: new google.maps.LatLng > (-34.454518655,116.049442291), > stopover:true > },{ > location: new google.maps.LatLng > (-34.444556637,116.034979820), > stopover:true > },{ > location: new google.maps.LatLng > (-34.985987621,116.882944107), > stopover:true > },{ > location: new google.maps.LatLng > (-35.035478228,117.919000983), > stopover:true > },{ > location: new google.maps.LatLng > (-35.095192592,117.959089279), > stopover:true > }], > provideTripAlternatives: false, > travelMode: google.maps.DirectionsTravelMode.DRIVING, > unitSystem: google.maps.DirectionsUnitSystem.METRIC > }; > directionsService.route(request, function(response, status) { > if (status == google.maps.DirectionsStatus.OK) { > directionsDisplay.setDirections(response); > } else { > alert(status) > } > }); > } > </script> > > Could it be the use of the LatLng() function within the setup of the > waypoints array? > > Cheers > Brendan > > -- > 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 > [email protected]. > To unsubscribe from this group, send email to > [email protected]<google-maps-js-api-v3%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-maps-js-api-v3?hl=en. > > > >--
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 [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-js-api-v3?hl=en.
