I have a map with some features, but I want to shoe them depending on al field.
May be
if [fieldname] = 0 --> color = RED else --> color = blue
Could anyone give a clue where to start?
Searching at leaflet documentation I managed to program
function getColor(d) {
return d = 0 ? '#3182bd' :
d = 1 ? '#31a354' :
'#FFEDA0';
}
function style(feature) {
return {
fillColor: getColor(feature.properties.*fieldname*),
};
}
But I'm not sure how to integer it, if I'm on the way or there's something easier with gvnix
Thanks all Javier
In your gvNIX view you can customize the symbol used to draw a geometry using the attribute
fnAjustRender
ofentity-field
tagx. Using this method you must declare ascript
in .jspx page and register it in the attribute.By example, in show.jspx entity fied definition you should change:
Then create a
myJSFunction
in jspx like this:Warning: no tested code
Good luck!