[OpenLayers-Users] ol2.13 and old ticket 3621 calculateResolutions

Steve.Toutant at inspq.qc.ca Steve.Toutant at inspq.qc.ca
Tue Jun 11 06:46:49 PDT 2013


We have this issue with 2.10 as well. I didn't try with earlier version.
I repeat that the problem is in chrome only.

I tried testing typeof.....function in chrome
<script type="text/javascript">
var numZoomLevels; //tried with null, 20, '20', 'aaa'
if(typeof numZoomLevels !== "number") 
        alert('nan'); 
alert(isNaN(numZoomLevels));
</script>

typeof numZoomLevels !== "number" and isNaN(numZoomLevels) work.

I also created a simple application with 500 openstreetmap in the 
layerswitcher, I didn't have any problem since numZoomLevels never 
changed, always = 20 as defined in the mapOptions.

In our application we have 460 layers, some of them have minscale, 
maxscale settings, so numZoomLevels is not the same for each layer.
For some reason, numZoomLevels as a value that only isNaN(numZoomLevels) 
can manage well in Chrome

This problem appears since we have 450 wms layers.
I'm still trying to create a test case but it is difficult. 
steve






Bart van den Eijnden <bartvde at opengeo.org> 
2013-06-10 14:23

A
Steve.Toutant at inspq.qc.ca
cc
Bart van den Eijnden <bartvde at opengeo.org>, 
openlayers-users at lists.osgeo.org
Objet
Re: [OpenLayers-Users] ol2.13 and old ticket 3621 calculateResolutions








Also Steve, what version of OpenLayers do you run now where you don't have 
this issue?

Best regards,
Bart

-- 
Bart van den Eijnden
OpenGeo - http://opengeo.org
Expert service straight from the developers.



On Jun 10, 2013, at 7:35 PM, Steve.Toutant at inspq.qc.ca wrote:


This problem is happening since we have more than 450 wms layers. It is 
difficult to create a test case since we are using a complex application 
built with extjs/geoext and OL. We are using a geoext layertree, not a 
layer switcher. 
The crash happens in openlayers/Layer.js 

What would be a good test case? Should I create just an OL map with 450 
layers in the layerswitcher? 
thanks 
steve



Bart van den Eijnden <bartvde at opengeo.org> 
2013-06-10 02:42 


A
Steve.Toutant at inspq.qc.ca 
cc
openlayers-users at lists.osgeo.org 
Objet
Re: [OpenLayers-Users] ol2.13 and old ticket 3621 calculateResolutions










Steve, 

can you show us an example to reproduce this? 

Best regards, 
Bart 

-- 
Bart van den Eijnden
OpenGeo - http://opengeo.org
Expert service straight from the developers. 



On Jun 7, 2013, at 9:45 PM, Steve.Toutant at inspq.qc.ca wrote: 


Hi, 
We have a problem with OL2.13 in Google Chrome only. 
Here is the error message: Uncaught RangeError: Invalid array length 
Layer.js line 1050 

It seems to be related to this issue 
http://trac.osgeo.org/openlayers/ticket/3621 

it fails because numZoomLevels is NaN 
But this code at line 1042 should manage that.... 

// are we able to calculate resolutions? 
       if(typeof numZoomLevels !== "number" || numZoomLevels <= 0 || 
(typeof maxResolution !== "number" &&     typeof minResolution !== 
"number")) { 
           return; 
       } 


I fix it adding isNaN(numZoomLevels) 
// are we able to calculate resolutions? 
       if(isNaN(numZoomLevels) || typeof numZoomLevels !== "number" || 
numZoomLevels <= 0 || 
          (typeof maxResolution !== "number" && 
               typeof minResolution !== "number")) { 
           return; 
       } 

I went on github but could not find the issue. 
So I submit here 
Steve_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users 






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130611/315ec21f/attachment.html>


More information about the Users mailing list