On Feb 27, 2:53 pm, Chad Killingsworth
<chadkillingswo...@missouristate.edu> wrote:
> In my case, I'm not. The dom nodes are not removed if they are out of
> view. Based on my map's use cases, at any given zoom level it is
> highly probable that the majority of these dom nodes will be on
> screen.
>
> I'm not trying to create an in-general solution for distribution. I
> simply needed to handle my specific map needs. In this case idle
> wasn't needed and would have added extra overhead. My map is designed
> for use on iPhones and Androids where processing power is limited.
>
> Chad Killingsworth

What I am suggesting is to the call the "chadsClass.idle()" method if
it is defined.  Otherwise, do nothing.  The overhead is practically
zero.  It is one "if" statement in the API.  In your case it will fail
but in many cases it will succeed.  It will eliminate explicit event
listeners which waste resources, consume memory & cause leaks.

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.

Reply via email to