The same principle applies when you're generating code as when you're
writing it by hand: Don't Repeat Yourself.

Instead of generating all the JavaScript code to create each marker, write
that code once and make it a JavaScript function.

Then you can generate only the much smaller code to call that function for
each marker. Or you can generate an array of the data you need for each
marker, loop through that array in JavaScript, and call the marker creation
function. Either way you avoid repeating all that code.

This principle applies whether you use Ajax as Larry suggested or whether
you continue to generate the code as part of your page.

If you post a link to your page, or even just a bit of the code you generate
(not the server-side code, please - the JavaScript code it generates), I or
someone can make a more specific suggestion.

-Mike

On Wed, Apr 14, 2010 at 2:54 AM, kennyhp <[email protected]> wrote:

> Hello,
> I need to position more than 1000 points in a Google map. What I'm
> doing now is creating code dynamically, creating a new GMarker for
> each of the points. When viewed with MarkerClusterer, but the client
> code generated is very large. Am I doing well? Is there any way to do
> better?
>
> Thanks in advance.
>
> --
> 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]<google-maps-api%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-maps-api?hl=en.
>
>

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