On Aug 1, 11:07 pm, William <william.g...@gmail.com> wrote: > I see what you are saying. I think the OverlayView and GOverlay are > designed for "full" overlays which are positioned once with "draw", > whereas MarkerClusterer etc efficiently manage the display of > "partial" overlays, and are best updated on "bounds_changed". > > Based on my testing I think Luke was right to say that > "bounds_changed" gives a better user experience than "idle". It's > quite a pause before clustering begins. > > As described by the OP the only problem is with a cascade of > bounds_changed events where the Manager must do too much work, which > blocks the user interface and maxes the CPU. > > I think the fix to this problem is to ensure the main calculation > method createClusters_() can be interrupted if it running for too > long. I tried this by having createClusters_() check whether it had > been running more than 300ms, and if so, to setTimeout() with a > resumption of the method after 0 milliseconds. This pause gives the > processing thread back to the browser and allows other events to occur > like for the user continuing to drag the map. > > This worked but the display was confusing because partial cluster > counts were shown, and these were updated as processing completed. To > be interruptable the update process needs to return final results, not > interim results, so I'll try a grid-based update instead. > > ...
It would be very easy for Google to do with an insignificant amount of overhead. If the the subclass does not override the "idle" method, the prototype "idle" method returns immediately. The "onAdd" method works essentially the same way. I never use it. It does not cause my applications to crash. I use event handlers to determine whether I have to rebuild tiles. If the tile boundaries have not changed, it can be dismissed in about a dozen statements. I suspect Luke is doing something similar to decide whether to "recluster". If the map movement is small, nothing happens. Luke requires an event listener associated with the map. It is a redundant requirement of every useful OverlayView. It ought to be performed automatically. -- 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-maps-js-api...@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.