If you have many many points, you could store them in two arrays (to
minimise the number of objects being allocated), one for lat, one for lng.
Then iterate through and create LatLng objects as desired.
var lat = [47.38154, 47.3815, 47.38147, 47.3814, 47.38138, 47.3813];
var lng = [-93.70881, -93.70879, -93.70879, -93.70898, -93.70908,
-93.70914];
var latlng = [];
for (var i = 0, ii = lat.length; i < ii; i++) {
latlng.push(new google.maps.LatLng(lat[i], lng[i]));
}
Chris
On Thu, Dec 23, 2010 at 3:08 AM, [email protected]
<[email protected]>wrote:
> On Dec 22, 7:59 am, Myopia <[email protected]> wrote:
> > Thanks, geocodezip and Martin. I think Martin's suggestion (which I
> > should have thought of, of course) will be adequate for the time
> > being. The polyline encoding looks very slick, but a bit complex and
> > I don't have the resources to test with a panoply of browsers, which
> > looks to be desirable.
> >
> > My GPS tracks are airplane flights at a 1/second sample rate,
> > basically long straight lines punctuated with brief periods of
> > circling for photography. So I will probably also write a simple test
> > to skip points where nothing is really changing. That should help
> > reduce verbosity a lot too..
>
> You may want to look at this recent thread also:
>
> http://groups.google.com/group/google-maps-js-api-v3/browse_frm/thread/ad1c8f1418a549be#
>
> -- Larry
>
> --
> 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.