[OpenLayers-Users] como mostrar capas no base como radio button?
Jorge Gustavo Rocha
jgr at di.uminho.pt
Sun Jul 15 10:10:18 PDT 2012
Hi Salo,
0) Do you want all layers (base+overlays) in a single radio group, or
only the overlays in a separated radio group?
The fastest way to have two radio groups is to change 2 lines of code in
OpenLayers-2.11/lib/OpenLayers/Control/LayerSwitcher.js
i) Look for the 'redraw' method.
First ensure that <input> tags from base layers and from overlay layers
get different group names. Change this:
// inputElem.name = (baseLayer) ? this.id + "_baseLayers" : layer.name;
inputElem.name = (baseLayer) ? "baseLayers" : "overlays";
ii) Look for the 'onInputClick' method.
You must improve the onInputClick method, on the same file, since the
test is poorly written.
Change this:
// if (this.inputElem.type == "radio") {
if (this.layer.isBaseLayer) {
I think these two lines are the necessary changes. Please test it properly.
Regards,
Jorge
Em 15-07-2012 04:50, salo escreveu:
> Hola, como puedo mostrar en el layerswitcher capas que no son base como radio
> button para que sean excluyentes entre sí, o como puedo hacer que al
> encender una mediante checbox se apague la que esta encendida para que sean
> excluyentes?
>
> Les agradezco la colaboración que me puedan brindar.
>
> --
> View this message in context: http://osgeo-org.1560.n6.nabble.com/como-mostrar-capas-no-base-como-radio-button-tp4988417.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
--
Jorge Gustavo Rocha
Departamento de Informática
Universidade do Minho
4710-057 Braga
Tel: +351 253604480
Fax: +351 253604471
Móvel: +351 910333888
skype: nabocudnosor
More information about the Users
mailing list