It took me a while to find a solution - probably a slow head day but here's how;
In this case a node represents a web mapping service. If the WMS is alive it should return a list of layers which are used to create a series of child nodes. So if no children change the icon to something relevant.
the css file;
.failedwms-icon {
background: url('resources/deadwms.gif') no-repeat;
height: 16px;
width: 16px;
}
in your js code;
'load': function(node){
// if a node receives a response and no layer child nodes are created we want to change the icon
if (node.childNodes) {
if (node.childNodes)
{
if (node.childNodes.length == 0)
{
node.attributes.iconCls = 'failedwms-icon';
node.getUI().iconNode.className = node.attributes.iconCls;
}
}
}
}
On here you'll find tips and notes on stuff i'm interested in. That's normally xbmc, movie libraries, psp homebrew and gadgets. I'll also post some code examples which are more for my reference than anything else.
Wednesday, 14 March 2012
Wednesday, 7 March 2012
compiling OpenLayers
Grab it from their github: https://github.com/openlayers/openlayers/zipball/master
Drop closure-compiler.jar & compiler.jar into openlayers\tools
Go to \build and ...
build.py -c closure full OpenLayers.js for regular compressed OpenLayers (700kb odd)
buildUncompressed.py full OpenLayers-uncompressed.js for phat Openlayers (2.5Mb odd)
Drop closure-compiler.jar & compiler.jar into openlayers\tools
Go to \build and ...
build.py -c closure full OpenLayers.js for regular compressed OpenLayers (700kb odd)
buildUncompressed.py full OpenLayers-uncompressed.js for phat Openlayers (2.5Mb odd)
Subscribe to:
Posts (Atom)