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

Andreas Hocevar ahocevar at opengeo.org
Wed Jul 29 11:57:22 EDT 2009


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.

Regards,
Andreas.


>
> Shawn
>
> soatley wrote:
>   
>> I have a feeling I am running into the same issue here.  I am using
>> Revision 9492 and the problem I encounter is the Invalid Argument error
>> when adding vector layers to the map.
>>
>> I have tried it on IE 7 (Win XP 32 bit) and IE 8 (Vista 64, in
>> compatability mode).  IE 8 on Vista not in compat. mode works fine.
>>
>> It seems to be very similar to the issue with Ticket 1910 from what I can
>> tell....  Setting up an IE breakpoint on line 600 of OpenLayers.js it
>> breaks where the variables w and h are assigned because this.size.w is
>> NaN.  If you were to look at the VML.js file, it is in the area of line
>> 154.
>>
>> Does anyone have any new information or a way I can work around this?
>>
>> Shawn
>>
>>
>> Christopher Schmidt-2 wrote:
>>     
>>> On Thu, Jun 18, 2009 at 10:23:15AM -0700, palewire wrote:
>>>       
>>>> I've encountered some IE8 errors too. Here's the paste from what the
>>>> browser
>>>> gives you. Is there anything I can do to help out?
>>>>         
>>> What SVN version is this with? This should only have been fixed in the
>>> last few commits.
>>>
>>> -- Chris
>>>
>>>       
>>>> Webpage error details
>>>>
>>>> User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;
>>>> Trident/4.0)
>>>> Timestamp: Thu, 18 Jun 2009 17:21:04 UTC
>>>>
>>>>
>>>> Message: Invalid argument.
>>>> Line: 793
>>>> Char: 110
>>>> Code: 0
>>>> URI: http:// ... /openlayers/OpenLayers.js
>>>>
>>>>
>>>>
>>>>
>>>> Asle Benoni wrote:
>>>>         
>>>>> Sorry Christopher and others. That was a bad one from me. I did't like  
>>>>> my attitude there.
>>>>> Of course I will test it since I had the problem just now. Glad you  
>>>>> pointed that out since I am always so glad and amazed at people here  
>>>>> just helping out ;-)
>>>>> Hope I can contribute also.
>>>>>
>>>>> /asle
>>>>>
>>>>>
>>>>> Den 12. juni. 2009 kl. 16.01 skrev Christopher Schmidt:
>>>>>
>>>>>           
>>>>>> On Fri, Jun 12, 2009 at 03:52:54PM +0200, Asle Benoni wrote:
>>>>>>             
>>>>>>> Thanks Kenneth, the compatibility hack works fine. I would rather  
>>>>>>> not hack
>>>>>>> VML.js but I see this hack is newer than the one I tried. As long  
>>>>>>> as the
>>>>>>> quickfix works I am satisfied. But would like to know if some have  
>>>>>>> success
>>>>>>> with it and if it is included in future OL release.
>>>>>>>               
>>>>>> It can't be included in a future OL release until people test it. If
>>>>>> you're unwilling to test it, the chances it will be included
>>>>>>             
>>>> decrease.
>>>>         
>>>>>> Please help test it if you care about it.
>>>>>>
>>>>>> -- Chris
>>>>>>
>>>>>>             
>>>>>>> /asle
>>>>>>>
>>>>>>> 2009/6/12 Andreas Hocevar <ahocevar at opengeo.org>
>>>>>>>
>>>>>>>               
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> On Fri, Jun 12, 2009 at 8:53 AM, Kenneth Skovhede, GEOGRAF
>>>>>>>> A/S<ks at geograf.dk> wrote:
>>>>>>>>                 
>>>>>>>>> Note sure what the actual problem is, but there are notes that  
>>>>>>>>> the patch
>>>>>>>>> does not solve all issues.
>>>>>>>>>
>>>>>>>>> There is a nother fix mentioned, namely the one in comment #20:
>>>>>>>>> http://trac.openlayers.org/ticket/1910#comment:20
>>>>>>>>>
>>>>>>>>> This effectively places IE8 in IE7 compatibility mode, and it  
>>>>>>>>> works.
>>>>>>>>> Although it's not the correct long term solution, you can use it  
>>>>>>>>> until
>>>>>>>>> the issue is fixed more permanently.
>>>>>>>>>                   
>>>>>>>> The latest patch [1] should fix all vector layer issues in IE8. It
>>>>>>>> would be nice to get some feedback if this is really the case.
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>> Andreas.
>>>>>>>>
>>>>>>>> [1]
>>>>>>>>
>>>>>>>>                 
>>>> http://trac.openlayers.org/attachment/ticket/1910/openlayers-1910.patch
>>>>         
>>>>>>>> --
>>>>>>>> Andreas Hocevar
>>>>>>>> OpenGeo - http://opengeo.org/
>>>>>>>> Expert service straight from the developers.
>>>>>>>>
>>>>>>>>                 
>>>>>>> _______________________________________________
>>>>>>> Users mailing list
>>>>>>> Users at openlayers.org
>>>>>>> http://openlayers.org/mailman/listinfo/users
>>>>>>>               
>>>>>> -- 
>>>>>> Christopher Schmidt
>>>>>> MetaCarta
>>>>>>             
>>>>> _______________________________________________
>>>>> Users mailing list
>>>>> Users at openlayers.org
>>>>> http://openlayers.org/mailman/listinfo/users
>>>>>
>>>>>
>>>>>           
>>>> -- 
>>>> View this message in context:
>>>> http://n2.nabble.com/Error-displaying-map-in-IE8---VML.js-tp3061276p3114656.html
>>>> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>>>>
>>>> _______________________________________________
>>>> Users mailing list
>>>> Users at openlayers.org
>>>> http://openlayers.org/mailman/listinfo/users
>>>>         
>>> -- 
>>> Christopher Schmidt
>>> MetaCarta
>>> _______________________________________________
>>> Users mailing list
>>> Users at openlayers.org
>>> http://openlayers.org/mailman/listinfo/users
>>>
>>>
>>>       
>>     
>
>   


-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.




More information about the Users mailing list