[Geomoose-users] GeoMoose API: GeoMOOSE.turnLayerOn problem with multi map-source layers

Jim Klassen klassen.js at gmail.com
Mon Apr 16 15:46:40 EDT 2012


I don't think we've made the 2.4.1 release yet either.  I have already applied some fixes in branches/geomoose-2.4 in anticipation for the 2.4.1 release (update for Mapserver 6.x and the famous extra comma).  I think it is all sitting pending testing.  My main confusion is that the 2.4.0 tarball and the 2.4.0 tag and branch in SVN somehow ended up at slightly different versions and I'm not sure which is most correct.

On Apr 16, 2012, at 2:08 PM, Brent Fraser wrote:

> Dan,
> 
>   I'm using the GeoMoose API (v2.4 I think) in a JavaScript user extension to  turn on a multi-mapsource Layer:
> 
>       GeoMOOSE.turnLayerOn("Image/image:Filler/all");
> 
> In geomoose.js, turnLayerOn calls changeLayerVisibility, where the layerpath is split and the DOM is queried for each portion.  But those portions are Map-Sources, not Layers, and therefor are not found.
> 
> So I changed the code to simply query on the original path (not the portions), and it seems to work:
> 
> 
>     changeLayerVisibility : function(layerPath, visibility) {     
> /*    
>         var paths = this.splitPaths(layerPath);
>         for(var p = 0; p < paths.length; p++) {
>             var e = document.getElementById('catalog-'+paths[p]);
>             if(!e && !Catalog.setLayerVisibility(paths[p], visibility)) {
>                 OpenLayers.Console.log('Layer '+paths[p]+' does not exist');
>             } else if(e && e.checked != visibility) {
>                 e.checked = visibility;
>                 e.onclick();
>             }
>         }
> */        
>         var e = document.getElementById('catalog-'+layerPath);
>         if(!e && !Catalog.setLayerVisibility(layerPath, visibility)) {
>             OpenLayers.Console.log('Layer '+layerPath+' does not exist');
>         } else if(e && e.checked != visibility) {
>             e.checked = visibility;
>             e.onclick();
>         }
>     },
> 
> If you think the above fix is valid, I'll file an Issue in Trac (I guess we're still filing issues on v2.4), and put the fix in SVN.
> 
> Thanks!
> -- 
> Best Regards,
> Brent Fraser
> _______________________________________________
> Geomoose-users mailing list
> Geomoose-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geomoose-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20120416/bf900802/attachment-0001.html


More information about the Geomoose-users mailing list