If you mean how better to structure the dynamically created
javascript, i'd suggest you write the data as an array.
Then when the page loads iterate thru the array creating your LatLngs.

So your page source would look something like:

var myPoints=[[47.38154, -93.70881], [47.3815, -93.70879], [47.38147,
-93.70879]];
for(var i=0, j=myPoints.length; i<j; i++){
 // create a LatLng from the array element and build your polyline
}

Martin.

On Dec 22, 12:38 am, Iam Anonymous <[email protected]>
wrote:
> I am plotting a polyline from a GPS logger, so there are lots of points.  I
> suppose there is some way to store them in a file, but for various reasons I
> want to generate a single html document that contains everything -- no
> references to other files, images, etc.
>
> So I now have line after line that look like this:
>
> new google.maps.LatLng(47.38154, -93.70881),
> new google.maps.LatLng(47.3815, -93.70879),
> new google.maps.LatLng(47.38147, -93.70879),
> new google.maps.LatLng(47.3814, -93.70898),
> new google.maps.LatLng(47.38138, -93.70908),
> new google.maps.LatLng(47.3813, -93.70914),
>
> Is there any way to get this job done more compactly?  A different way to
> add the points to the object?  I am relatively new to javascript but RTFM
> has not helped me with this question.
>
> TIA.

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