On Dec 23, 5:42 am, Chris Broadfoot <[email protected]> wrote:
> 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

Or alternating even/odd elements of a single array which is more
intuitive & less confusing.  Requiring every point of every poly to
execute a "new google.maps.LatLng()" constructor is insane.

-- 
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.

Reply via email to