[Geomoose-users] GeoMoose API: GeoMOOSE.turnLayerOn problem with
multi map-source layers
Brent Fraser
bfraser at geoanalytic.com
Mon Apr 16 15:08:23 EDT 2012
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20120416/8c0ddf34/attachment.html
More information about the Geomoose-users
mailing list