v3 Map lag/sluggishness. 814 markers in zoom=8

199 views
Skip to first unread message

Ryan Wood

unread,
Dec 7, 2010, 12:24:46 PM12/7/10
to Google Maps JavaScript API v3
I am having an issue with my map on my website. I am using a mysql
database which is already geocoded. I am using this tutorial:
http://code.google.com/apis/maps/articles/phpsqlajax_v3.html

I am also using a custom marker, which is a 2k .png file.

Obviously the lag gets worse as more markers are added.

It is strange because if I use google fusion tables, geocode and then
embed the map on my website, there is zero lag.

If someone could please help to identify what is causing the lag I
would greatly appreciate it. Thanks in advance.

Here is the page where the map is: http://www.legalgrab.com/florida_arrest_map.html

geoco...@gmail.com

unread,
Dec 7, 2010, 4:18:30 PM12/7/10
to Google Maps JavaScript API v3

Ryan Wood

unread,
Dec 7, 2010, 4:31:19 PM12/7/10
to Google Maps JavaScript API v3
This is what I dont understand:

If I geocode in fusion tables, and then use "embed map" the speed is
perfect.

Check here for comparison: http://www.legalgrab.com/florida_arrest_map2.html
embed is bottom map.


What is making the embed so much faster?

On Dec 7, 4:18 pm, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:
> On Dec 7, 9:24 am, Ryan Wood <ryanwoodmi...@gmail.com> wrote:
>
> > I am having an issue with my map on my website. I am using a mysql
> > database which is already geocoded. I am using this tutorial:http://code.google.com/apis/maps/articles/phpsqlajax_v3.html
>
> > I am also using a custom marker, which is a 2k .png file.
>
> > Obviously the lag gets worse as more markers are added.
>
> > It is strange because if I use google fusion tables, geocode and then
> > embed the map on my website, there is zero lag.
>
> > If someone could please help to identify what is causing the lag I
> > would greatly appreciate it. Thanks in advance.
>
> > Here is the page where the map is:http://www.legalgrab.com/florida_arrest_map.html
>
> Have you tried using a marker manager or a marker clusterer?http://code.google.com/p/google-maps-utility-library-v3/source/browse...http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer...
>
>   -- Larry

Ben Appleton

unread,
Dec 7, 2010, 4:42:08 PM12/7/10
to google-map...@googlegroups.com

Fusion Tables (and KML) are rendered as image tiles by a Google server, precisely to be as fast as you observe. v3 markers are rendered in the browser, so the speed depends on the browser.

You can speed up marker rendering by setting 'clickable' false (removes DOM click targets) and 'flat' true (hides shadows). I seem to recall these double marker rendering speed.

You can also use a marker manager to cluster markers so that fewer are shown at once. They can all be seen when you zoom in.

You could also try a fast browser such as Safari or Chrome, which are both based on the (fast) WebKit rendering engine.

- Ben

On 8 Dec 2010 08:31, "Ryan Wood" <ryanwo...@gmail.com> wrote:

Ryan Wood

unread,
Dec 7, 2010, 4:50:30 PM12/7/10
to Google Maps JavaScript API v3
I do not have either of those options in my code. I am using a
shadowless icon. I also need a clickable infowindow to show the
individual and their arrest charge.

Is there a way to set it so that clickable is available, but it loads
the data in the infowindow ONLY when they click, and not loading all
data when the map loads? So the map doesnt load any of the infowindow
data until they click on a marker, which will then load that markers'
data in infowindow?

I hope this makes sense =) I greatly appreciate the help!
> On 8 Dec 2010 08:31, "Ryan Wood" <ryanwoodmi...@gmail.com> wrote:

Ryan Wood

unread,
Dec 7, 2010, 4:56:38 PM12/7/10
to Google Maps JavaScript API v3
Do you recommend that I instead use KML?

Here is a tutorial I can use? http://code.google.com/apis/kml/articles/phpmysqlkml.html

On Dec 7, 4:42 pm, Ben Appleton <apple...@google.com> wrote:
> On 8 Dec 2010 08:31, "Ryan Wood" <ryanwoodmi...@gmail.com> wrote:

Chad Killingsworth

unread,
Dec 7, 2010, 5:13:15 PM12/7/10
to Google Maps JavaScript API v3
If KML is an option for you, then I would definitely be using it. The
InfoWindow behavior you described is supported by KML layers and the
latency doesn't increase with the addition of more data.

Note: Multiple people have had problems with dynamically generating
large KML files with PHP. The PHP processing takes longer than the
Google servers will wait. So far, I've only seen this problem with
PHP.

Chad Killingsworth

On Dec 7, 3:56 pm, Ryan Wood <ryanwoodmi...@gmail.com> wrote:
> Do you recommend that I instead use KML?
>
> Here is a tutorial I can use?http://code.google.com/apis/kml/articles/phpmysqlkml.html

Ben Appleton

unread,
Dec 7, 2010, 5:15:07 PM12/7/10
to google-map...@googlegroups.com

Fusion Tables is fastest because Google stores and indexes the data. KML is not necessarily as fast because Google must fetch your KML - if your KML server is slow or sets poor cache headers this adds latency. But both KML and Fusion Tables render as image tiles which is faster than browser rendering.

Both KML and Fusion Tables load the infowindow content on click, so the initial download is minimal. You can do this yourself with "AJAX" techniques so that your page load is fast. But this won't speed up marker rendering, just the page load.

- Ben

> --
> 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 google-map...@googlegroups.com.
> To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
Reply all
Reply to author
Forward
0 new messages