[Users] Error in WMSBrowserTreePanel.js

Alexandre Dubé adube at mapgears.com
Tue Sep 25 14:50:06 CEST 2012


Hi Antoni,

   I added the list in CC.

   The tree uses the WMSCapabilitiesLoader to trigger the WMS 
GetCapabilities requests.  Looking at the code in GeoExt 1.1, is 
parameters are returned by the getParams methos, which looks like this :

     getParams: function(node) {
         return {'service': 'WMS', 'request': 'GetCapabilities'};
     },

   You could try to override this method :

GeoExt.tree.WMSCapabilitiesLoader.prototype.getParams = function(node) {
     return {'service': 'WMS', 'request': 'GetCapabilities', 'version': 
'1.1.1'};
};

HTH,

Alexandre


On 12-09-25 08:36 AM, Vidal, Antoni wrote:
>
> Hi Alexander,
>
> I’ve made the test, and GML as plain text in a file parsed by 
> OpenLayers.Format.WMSCapabilities get a layer with minScale to “infinity”.
>
> Notice that this property becomes to WMS version 1.1.1, and the server 
> response is version 1.3.0 by default, not our case because OpenLayers 
> use 1.1.1 if not provided.
>
> What do you think it could be the best solution?
>
> Best regards,
>
> Antoni
>
> *De:*users-bounces at geoext.org [mailto:users-bounces at geoext.org] *En 
> nom de *Alexandre Dubé
> *Enviat:* viernes, 21 de septiembre de 2012 16:42
> *Per a:* users at geoext.org
> *Tema:* Re: [Users] Error in WMSBrowserTreePanel.js
>
> Hi Antoni,
>
>   I think I found what the issue is.  If you take a look at the 
> capabilities returned by that WMS service, you'll notice a "max" 
> attribute equal to "Infinity" inside ScaleHint nodes :
>
> <ScaleHint min="39.597980" max="Infinity"></ScaleHint>
>
>   OpenLayers reads this and sets the layer minScale property to 
> "infinity".  At some point, the number of zoom levels is calculated 
> using the min and max scales properties of the layers, which ends up 
> equalling to "infinity".  This is the line that, in the end, throws 
> the error (in Layers.js, in calculateResolutions) :
>
> var resolutions = new Array(numZoomLevels);
>
>   numZoomLevels equals "infinity".  I think you found a bug in 
> OpenLayers.  Would you please try making a small example using your 
> capabilities GML returned (as plain text, in a file) and use 
> OpenLayers.Format.WMSCapabilities to read it and see if the layer 
> minScale property is equal to "infinity" as well ?  That would become 
> a nice test-case to reproduce the issue.
>
> Best regards,
>
> Alexandre
>
>
> On 12-09-21 09:02 AM, Vidal, Antoni wrote:
>
>     Hi list,
>
>     I’m testing WMSBrowser example in my production server and it
>     works fine calling some WMS servers but in some cases, it doesn’t.
>
>     Open http://www.icc.cat/WMSBrowser/examples/WMSBrowserICC.html (it
>     uses EPSG:23031) and try the following WMS servers:
>
>     A.OK: http://sima.gencat.cat/DMAH_ws/SIMA_OGC/MapServer/WMSServer?
>
>     B.NOT OK:
>     http://siurana.igc.cat/arcgis/services/geotermia/amplitud_termica/MapServer/WMSServer
>
>
>     Firebug shows an “invalid array length” produced in
>     WMSBrowserTreePanel.js line 111, when layer must be added to
>     previewMap...
>
>     Maybe somebody could light me.
>
>     Regards,
>
>     *Antoni Vidal*
>
>     Unitat d'Aplicacions SIG-WEB
>     Institut Cartogràfic de Catalunya
>     <http://mercuri.icc.cat/website/mob_nf/mob1/mob2/inici2.htm?CONSULTA=Institut%20Cartogr%25E0fic%20de%20Catalunya&XYADDRESS=429486:4580392>
>     Parc de Montjuïc, E-08038 Barcelona
>     Tel. (+34) 93 567 15 00 (ext. 3228)
>     www.icc.cat <http://www.icc.cat/>
>
>
>
>
>     _______________________________________________
>
>     Users mailing list
>
>     Users at geoext.org  <mailto:Users at geoext.org>
>
>     http://www.geoext.org/cgi-bin/mailman/listinfo/users
>
>
>
>
> -- 
> Alexandre Dubé
> Mapgears
> www.mapgears.com  <http://www.mapgears.com>


-- 
Alexandre Dubé
Mapgears
www.mapgears.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20120925/1f390e83/attachment.htm 


More information about the Users mailing list