[OpenLayers-Users] One Popup situation resolved, New troubles w/ panmapifoutofview

Christopher Schmidt crschmidt at metacarta.com
Thu Feb 5 10:30:07 EST 2009


On Thu, Feb 05, 2009 at 06:49:41AM -0800, smithfield wrote:
> I did try both.  If I could have figured it out, I wouldn't have asked again
> on this board.  As you are well aware, the documentation is lacking for
> openlayers.  

For the record, this is not the way to endear yourself to me. 

  

> popup.panMapIfOutOfView=true;
>                 popup.setContentHTML(content);
> 		popup.setBackgroundColor("white");
>                 popup.setOpacity(.95);
>                 map.addPopup(popup);	
> 		popup.autoSize(true);

                ^^ Same problem.
autoSize is a *property*, not a function. Properties are set as the
panMapIfOutOfView option is set. Because your 'size' was null, it was
being set to a reasonable default in the browser, but the OL JavaScript
didn't know what was going on.

Put 'popup.autoSize' before setContentHTML, and it all works.

  http://crschmidt.net/mapping/ol-list/1233847445-popup.html

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list