enoa

probleme of customization of a .csv layer

Discussion created by enoa on Jun 17, 2014
Hi everybody,

Sorry if i make mistakes when i write, i am french ;)

I am working on a map with the JS API.
My aim it's to display a layer which came from a .CSV file (loaded from my local server) :


 
 csv = new CSVLayer("myPath/myFile.csv", { 
               copyright: "myFile.copyright",
                  ...
                });  
map.addLayer(csv);


Up to now, i have no problems,  it works !

In my .csv, i have three fields : X, Y and TYPE separated by comas

In TYPE their are only two possibilities : validate, not_validate. I want to change the symbol's color when the point is validate (red) and when the point is not (blue).

Is there anyway to do that ?

I tried many methods without any results !

Partuclarly, il look the method .addBreak but when i wrotte :


var renderer = new ClassBreaksRenderer(defaultSymbol,"TYPE")



or


var renderer = new ClassBreaksRenderer(defaultSymbol, function(feature){
     return feature.attributes.STATUT;
   });


Neither of these méthods work ! I think their  is a problem with Type

What can i do ?

Thank you for your help ;)


Enoa

Outcomes