Shawn Oatley wrote: > >>>> On 7/29/2009 at 11:57 AM, Andreas Hocevar <ahoce...@opengeo.org> wrote: >>>> >> soatley wrote: >> >>> In case anyone else runs into this, I found out that after the map is >>> created, it sometimes doesn't set a height or width value in the map.size >>> property. Here's my fix which seems to work quite nicely: >>> >>> map = new OpenLayers.Map('map', options); >>> if (isNaN(map.size.w) || isNaN(map.size.h)) { >>> map.updateSize(); >>> } >>> >>> >> You can also make sure that the container where you render the map in >> (in your snippet a div or whatever element with id 'map') has a width >> and height style before you create the map object. >> >> > > Andreas, thanks for the tip. What about when the map is going to be the full > screen size? Would it be best to set an initial value (say 800X800)? Will > the map then go back and update the size to the ful screen? Or should I > specify a size by percent (100%)? >
100% should work (untested), but you have to set width and height to 100% on the html and body elements also. Regards, Andreas. > Shawn > > _______________________________________________ > Users mailing list > Users@openlayers.org > http://openlayers.org/mailman/listinfo/users > -- Andreas Hocevar OpenGeo - http://opengeo.org/ Expert service straight from the developers. _______________________________________________ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users