[OpenLayers-Users] autosizing popup containing image does not work in firefox

arno arno at renevier.net
Sat Jul 25 12:33:02 EDT 2009


Le Thursday 23 July 2009, à 08:44:41AM -0400, Dave a écrit : 
> I get 24px as well, guess firefox has a bug.
> 
> > yes,
> > I checked what happens in OpenLayers.Util.getRenderedDimensions (because
> > that's method report a wrong result), and made a testcase that exhibits the
> > behaviour I'm seeing:
> > http://renevier.net/misc/ol_autosizeimg_2.html
> > If the bug is not triggered when loading the page, try reloading by
> > pressing
> > Ctrl-Shift-R simultaneously, or by pressing Shift and clicking reload
> > button
> > simultaneously. If the bug still not shows, try to reload that way 2 or 3
> > times.
> >
> > On my testcase (ol_autosizeimg_2.html), does someone sometimes get a result
> > of
> > "24px" as I do, or do everyone see "465 px" ?

ok,

In case someone else encounters that problem, I could work around by 
redefining registerImageListeners method:
in onImgLoad, before calling this.popup.updateSize(), I set
this.img.width =  this.img.width;
this.img.height =  this.img.height;
That way, image dimensions are set in contentDiv.innerHTML, and 
getRenderedDimensions computes popup size correctly.

arno
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090725/88986dd3/attachment.bin


More information about the Users mailing list