One Google specific optimization is to stop using "new GLatLng" to
build GPolys.

Both GPolyline & GPolygon will accept arrays of {x:,y:} objects which
is an improvement but still not optimal.  Arrays of two element
objects waste a lot of space.  Each object requires a trivial two
element hash table.  Arrays of two element arrays are an improvement
but still not optimal.  Each requires an index which also is trivial
but also wastes space.

Pack both X & Y in the same array.  Alternate their indicies.  One
variable occupies even numbered slots.  The other occupies odd
numbered slots.  The big array has twice the number of elements but a
secondary array is not required.  In some cases, X & Y can be combined
in the same element if their magnitudes will never exceed 16 bits
(65,536).

    var whatever=[x0,y0,x1,y1,x2,y2,x3,y3, . . . ];

Alternatively, X & Y can be separate arrays with the same index.

    var x=[x0,x1,x2,x3, . . . ];
    var y=[y0,y1,y2,y3, . . . ];

Avoid both:

    var whatever=[[x0,y0],[x1,y1],[x2,y2],[x3,y3], . . . ];

    var whatever=[{x:x0,y:y0},{x:x1,y:y1},{x:x2,y:y2},
{x:x3,y:y3}, . . . ];

if it is feasible.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to