Hey, I have a pretty simple question. My customer want me to customize the
LayerSwitcher. Do you think it's possible ?
In fact, here is want I want to do:
In the layer switcher you have a list of baseLayer associated with a
radiobutton and a list of the other layers associated with a checkbox. My
client want me to add a radio button beside the checkbox of the layers to allow
him to specify witch layer to use for a given action. I open OpenLayer.js and
modify the js to add a radiobutton. For the visual part it's ok, I see them and
it's working. On the first display, if I click on a radio, it works, but after,
If I want to change (by clicking to another one) nothing is happening. I've
debug with firebug and if I go step by step, I see that my radio is changing,
but for some reason, it's going back to the first one right after.
Do you have any idea of how I can make it work ?
Here is the code I added:
if(!baseLayer)
{
var inputElemSelectedLayer = document.createElement("input");
inputElemSelectedLayer.id = "inputSelectedLayer_" + layer.name;
inputElemSelectedLayer.name = "selectedLayer";
inputElemSelectedLayer.type = "radio";
OpenLayers.Event.observe(inputElemSelectedLayer, "click",
OpenLayers.Function.bindAsEventListener(this.onSelectedLayerClick,
inputElemSelectedLayer));
groupDiv.appendChild(inputElemSelectedLayer);
}
in the redraw function.
...
onSelectedLayerClick: function(e) {
if (!this.inputElem.disabled) {
this.inputElem.checked = true;
}
OpenLayers.Event.stop(e);
}
Thx a lot
Fred_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users