Dragging google maps 3 with custom overlays causes VERY HUGE LAG

1.9k Views Asked by At

I started using version 3, but there is a BIG problem.

When I create more than 20-30 custom overlays on the map AND try to drag the map with the mouse there is VERY HUGE lag.

When I use the build in control to pan the map there is NO lag.

Any idea what is happening? When I use version 2 the lag appears after adding more than 200 custom overlays. Version 3 start lagging with 20-30 only.

P.S. By custom overlay I mean subclassing OverlayView.

Here is example of the problem which appears mainly when using firefox

google maps v2: 46.233.14.168:8080/GoogleMapsTest/testPage2.jsp google maps v3: 46.233.14.168:8080/GoogleMapsTest/testPage.jsp

1

There are 1 best solutions below

1
On

I encountered the same problem, with GM API 3 and an up-to-date Firefox. There where no performance problems with good old Firefox 11.

After some research, I found that the markers in my software were too complex - they consisted of a self-constructed div object with an image object inside.

I replaced them by standard Google.maps.Marker, which are less flexible but sufficient for my purpose. Now the map panning is blazingly fast - no problem with some thousand markers in Firefox, and even some ten thousands in Chrome!