Select to view content in your preferred language

how to create a composite symbol from 2 simple marker symbols for point data???

3097
4
07-28-2011 07:03 AM
grahamcooke
Regular Contributor
I have some point data (representing barriers) that is symbolised in my application using a uniquevaluerenderer according to the status of the barrier. In the application barriers that are closed during the day are red squares and those closed at night are blue triangles.

All is working fine but now my user wants a new status to be applied to the barriers layer.  the new status is for barriers closed by day and night and to easily symbolise this they want a blue triangle inside a redsquare for this new status.

obviously blue triangles and red squares are simple symbols, but this new symbol is not something you get "out of the box". Creating the graphic itself is easy enough to do in a graphics package but how do i then use the resulting png inside my flex application and tell the uniquevaluerenderer to use that symbol??

(i am using flexviewer 2.3.1)

hope someone can help

thanks,

Graham
Tags (2)
0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
Graham,

  Is your symbology for these symbols right now coming from code or just the MapService?
0 Kudos
grahamcooke
Regular Contributor
Hi Robert.

It is all done in the widget code. The map service is queried and the returned points are symbolized via the uvr.the simple marker symbols are created in the declarations section of the widget
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Graham,

  So simply the way you use a Simple marker symbol now for the UniqueValueInfo you would build a CompositeSymbol

var cSymbol:CompositeSymbol = new CompositeSymbol();
var squareSym:SimpleMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_SQUARE, 20, 0x000099);
var triangleSym:SimpleMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_TRIANGLE, 18, 0x000000);
cSymbol.symbols = [squareSym, triangleSym];
0 Kudos
grahamcooke
Regular Contributor
Oh, that's embarrassing! I hadn't realised there was actually a composite symbol object available! Thank u very much Robert. This works great!
0 Kudos