AnsweredAssumed Answered

Create SimpleMakerSymbol from Json

Question asked by aquesi on Nov 26, 2014

Hi!

What is the correct way to build a Jsonnode to create a SimpleMakerSymbol ?

 

This code don't work

File Json

 

{

  "style" : "TRIANGLE",

  "color" : -9888944,

    "width" : 18,

    "height" : 18,

    "angle" : 0,

    "offsetx" : 0,

    "offsety" : 0,

  "size" : 18

}

 

In Android SDK

 

ObjectMapper mapper = new ObjectMapper();

BufferedReader fileReader = new BufferedReader( new FileReader("path-to-json-file"));

JsonNode rootNode = mapper.readTree(fileReader);

SimpleMarkerSymbol pointSymbol = new SimpleMarkerSymbol(rootNode);

uvRenderer = new SimpleRenderer(pointSymbol);

featureLayer.setRenderer(uvRenderer);

mapView.addLayer(featureLayer);

 

Thank you

 

Regards

Abel

Outcomes