Thanks all - it was the setMap causing the problem - why did I put it there? I will look at the problems with other browsers in due course
On Aug 23, 12:22 am, William <[email protected]> wrote: > On Aug 23, 2:49 am, spotnick <[email protected]> wrote: > > > > > ... The problem seems to be in the drawing of the polyline .... > > V3 uses a MVC architecture and because the polyline is already > displayed on the map, it is being updated for every point you insert > into the array. > > I think it would be best to move the "setMap" statement until after > the points are in the array. > > ********** > > plannedPoly = new google.maps.Polyline(plannedpolyOptions); > > // plannedPoly.setMap(map); <-- move this statement > > var polypath = plannedPoly.getPath(); > > ********** > > if (path.length > 1) { > for (var p=0; p<path.length-1; p++) { > bits = path[p].split(","); > if (bits.length == 3){ > plat = parseFloat(bits[1]); > plng = parseFloat(bits[0]); > point = new google.maps.LatLng(plat,plng); > polypath.push(point); > } > } > plannedPoly.setMap(map); // <-- all the points are in the array, > display the polyline > > } > > ********** > > ... -- 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.
