Customize the Popup that is generated in the layer: entity-field of gvNIX

2

I would like to know how to customize the following popup that rises in <layer:entity-field> I found the function fnPrepareInfo within layer but I do not know if That would be the function that I need and I do not know how to use it, if you could help me. I would like to show only some fields of my entity such as: Codigo - Nombre - Latitud -Longitud

    
asked by Marty Ayala 03.02.2016 в 18:52
source

1 answer

0

You're on the right track ;-).

To customize the layer information you need to define a function in the .jspx file of the map:

<script>

    function myLayerInfo(oMap,
            sLayerId, sEntityPath, sGeoFieldName, sFeaturePKValue,
            oFeature, oFeatureLayer, bSelected) {

           return "<div> EL HTML que quieras mostrar</div>";

    }

</script>

and in the tag of the layer add the property:

 <layer:entity-field ... fnPrepareInfo="myLayerInfo"/>

As an example you can see the function that is used by default to generate the popup in leaflet.ext.gvnix.map.js createLayerInfoString function

Good luck!

    
answered by 04.02.2016 / 15:17
source