Add opacity in WMS Maps generated with gvNIX

2

Following the gvNIX reference document there is a geo component for the Layer Opacity Control that is added by including the following tag to the show.jspx view of the map

        <geo:toc-toolbar id="ps_org_cite_pese_web_Mapa_toc_toolbar"
            z="user-managed">
            <tool:opacity id="opacity_slider" z="user-managed" />
        </geo:toc-toolbar>

inside the toolbar toc-toolbar. To my base map add two more WMS layers that I would like to also have that component. I would like to know if it is possible or if I am doing the inclusion in some erroneous way, my code is as follows.

<geo:toc id="ps_org_cite_pese_web_Mapa_toc"
        z="+MeANZ7lrQ3PHfF88iYJKjjbAyE=">

        <geo:toc-toolbar id="ps_org_cite_pese_web_Mapa_toc_toolbar"
            z="user-managed">
            <tool:opacity id="opacity_slider" z="user-managed" />
        </geo:toc-toolbar>

        <layer:tile allowDisable="false"
            id="ps_org_cite_pese_web_Mapa_default_layer"
            url="http://{s}.tile.osm.org/{z}/{x}/{y}.png?bar"
            z="sKKvxQpO3LQFui93VegdYDtJKSE=" />

        <layer:entity filterType="auto" id="l_org_cite_pese_dominio_Estacion"
            path="/estacions" pk="id" selection="true"
            z="fXDq1x3/hgf9UGoxlV2AHiUbFD0=">

            <layer:entity-field field="ubicacion" icon="glyphicon-map-marker"
                iconLibrary="glyphicon"
                id="l_org_cite_pese_dominio_Estacion_ubicacion"
                labelingProperty="codPese" markerColor="darkred" showInfo="true"
                z="0oVQrurrzX/dVZ4cdNJ51XLWsoo=" />

        </layer:entity>

        <layer:wms format="image/png" 
            id="ps_org_cite_pese_web_Mapa_limitaciones"
            layers="PesePy:Limites_PY" transparent="true"
            url="http://localhost:8080/geoserver/PesePy/wms?" version="1.1.0"
            z="k8i1DhIaSY4wyNWXZ8HPQUpMR8E=" />

        <layer:wms format="image/png"
            id="ps_org_cite_pese_web_Mapa_Departamentos"
            layers="PesePy:dptos_py" transparent="true"
            url="http://localhost:8080/geoserver/PesePy/wms?" version="1.1.0"
            z="S9Y1+dZNhp6mNujRQqjTTZMJhFY=" />
    </geo:toc>
    
asked by Marty Ayala 16.02.2016 в 14:00
source

1 answer

1

I think it's a bug that is fixed in the final version.

Try the following:

  • edit the file leaflet.ext.gvnix.map.js of your project.
  • Copy from the line 3842 to the 3863 or what is the same, the functions fnSetOpacity and fnGetOpacity .
  • Paste them before the line 3755 or what is the same, within the prototype of the wms layer object.
  • As of that moment, when selecting the WMS layers in the TOC, the opacity control should be activated.

    Good luck!

        
    answered by 25.02.2016 / 21:12
    source