[OpenLayers-Dev] popups

Erik Uzureau euzuro at gmail.com
Mon Apr 28 20:02:33 EDT 2008


On Sun, Apr 27, 2008 at 11:34 PM, Tim Schaub <tschaub at openplans.org> wrote:
> Thanks for the description.  New question.
>
> How do folks like to manage popup destruction?
>
> Seems to me like it would be pretty typical to set "exclusive" to true
> when calling map.addPopup (one popup open at a time).  This means in a
> typical application, a popup would be created by a user click.  The DOM
> elements associated with this popup are removed in another user click.
> This doesn't give much chance for the popup creator to call destroy.
>
> IE6 (unpatched) is horrendous with memory leaks and element.removeChild
> when child elements are listening for events with functions that contain
> cyclic structures.  This seems a pretty obvious source of memory leaks.
>
> IE6 aside, it seems like I must be missing something with regard to a
> simple way to destroy popups.  Is the solution to have the sixth arg to
> the popup constructor (closeBoxCallback) set to something that calls
> destroy?

yes, i think that is probably the best way to go about it nowadays. the
exclusive parameter was something i added many moons ago, when i was
just a young ajaxer and even younger ol-er. it and virtually everything else
about the popup API is to be firmly blamed on me.

these are among the many things that must be thoroughly re-thought-out
when we start the 3.0 discussions.

if you want to get into this further, find me on IM. i'm ready and willing.
erik





> Tim
>
>
> Christopher Schmidt wrote:
> > On Sun, Apr 27, 2008 at 10:42:51AM -0600, Tim Schaub wrote:
> >> Hey-
> >>
> >> Can someone describe the following to me:
> >>
> >> 1) OpenLayers.Popup
> >
> > Simple div. Tied to a lat/lon, not an object. Always opens in a single
> > direction. Generally not used: doesn't fit itself to the right area of
> > the map, and doesn't provide a 'pretty' UI.
> >
> >> 2) OpenLayers.Popup.Anchored
> >
> > Simple div, tied to an object (like a marker) which provides an
> > 'offset'. The offset is used to place the popup based on the lonlat, and
> > the offset, based on the preferred relative position -- top left, bottom
> > right, etc. Thsi is automatically calculated based on where the lonlat
> > is in the map, designed to open the popup in the directin with the most
> > space.
> >
> >> 3) OpenLayers.Popup.AnchoredBubble
> >
> > Same as above, but with rounded corners using Rico.Corner.
> >
> >> 4) OpenLayers.Popup.Framed
> >
> > Base class for image-based popups, which can be fixedRelativePosition or
> > not. An image (defined in a property of the popup) is used to create the
> > "GUI" aspect of the popup. A base class, this is never meant to be used
> > excpet for extension.
> >
> >> 5) OpenLayers.Popup.FramedCloud
> >
> > A specific instance of the above: Provides image properties for a popup.
> >
> >
> >> Seems to me like all popups are "anchored" and I can't tell what is the
> >> implied distinction in the words "bubble" and "cloud".
> >
> > Anchored means 'has an offset, and can be offset relative to the
> > position of its 'anchor''
> >
> >> None of the above shed much light on the question "why so many, and
> >> which to use when?"
> >
> > I don't know if thsi helps at all, but, there it is.
> >
> > Regards,
>
>
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>



More information about the Dev mailing list