Setting Renderer on GraphicsLayer

3149
3
02-29-2016 04:48 AM
CesarRevilla
New Contributor III

Hello, Im trying to set a renderer on a new GraphicsLayer. The GraphicsLayer hat a group of graphics with their own Symbols. The renderer symbol are not applied to this graphics.

GraphicsLayer gLayer = new GraphicsLayer(webmercator, projected_extent, GraphicsLayer.RenderingMode.DYNAMIC);
Graphic pointGraphic = new Graphic(point_projected, new SimpleMarkerSymbol(Color.BLUE, 10, CIRCLE));
gLayer.addGraphic(pointGraphic);

SimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbol(Color.RED, 20, CIRCLE);
SimpleRenderer simpleRenderer = new SimpleRenderer(simpleMarkerSymbol);

gLayer.setRenderer(simpleRenderer);

mapView.addLayer(gLayer);

After addLayer the graphics uses the blue circle symbol instead the renderer with red circles symbol.

Thanks for the help and best Regards,

Cesar

0 Kudos
3 Replies
WillCrick
Occasional Contributor

Symbols defined at the Graphic level always override symbols defined in a renderer.

CesarRevilla
New Contributor III

Ok, that means I can instance a Graphic with null Symbol (because all constructors require Symbol). I Would try it. Thank your for your Answer.

BrianJohnston4
New Contributor III

Did that work for you?  I just tried it and it did not work for me.

0 Kudos