On Feb 27, 2:40 pm, bratliff <bratl...@umich.edu> wrote: > Does anyone have a non-trivial OverlayView WITHOUT using an "idle" > event listener ???? > > Google has refused to make it automatic like the "redraw" method in V2 > with "force=false". > > I cannot imagine doing anything useful in an OverlayView without an > "idle" event listener. It is the most efficient way to update the > OverlayView at the completion of a "drag" or a "pan" or a "zoom". Any > realistic OverlayView will have to insert or remove elements depending > on the change in the visible portion of the map. I suppose a really > trivial OverlayView might not bother to update the view. > > But, if an "idle" method is not defined, the API will not attempt to > call it. The "excess overhead" argument has no merit. > > if (this.idle) this.idle(); > > One simple statement in the API could eliminate explicitly defined > "idle" event listeners for every OverlayView. Event listeners waste > resources & cause memory leaks. Adding a single statement to the API > will save resources & reduce memory leaks without any impact on an > OverlayView without an "idle" method. The "onAdd" method is analogous > & optional. If it does not exist, it is not called. > > Google - please reconsider your decision.
I forgot to mention another consideration. "idle" occurs very infrequently. It occurs at the completion of a zoom, at the completion of a pan, at the completion of a drag. Even if the overhead was significant which it is not - who cares ? If the API provided: OverlayView.prototype.idle=function(){}; the subclass could override it. The "fall back" superclass would simple return. The "if" statment is no longer required. The "idle" method always exists even if it does nothing. For me, "onAdd()" does nothing useful. I do not define it. Everything works fine. The application does not crash. -- 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.