[OpenLayers-Users] Error displaying map in IE8 - VML.js

Shawn Oatley shawn at niagarafalls.ca
Wed Jul 29 12:13:22 EDT 2009



>>> On 7/29/2009 at 11:57 AM, Andreas Hocevar <ahocevar at 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%)?

Shawn




More information about the Users mailing list