How to make a Circle shape PictureSymbol

275
3
08-06-2017 11:52 PM
Highlighted
New Contributor III

Hi ,

when I build a Graphic with PictureMarkSymbol, the shape of Graphic is Rectangle, I want to make a Circle shape Graphic with PictureSymbol, Anyone who know how to do it ?

Tags (1)
Reply
0 Kudos
3 Replies
Highlighted
Occasional Contributor III

Hi Yan,

PictureMarkerSymbol has the height and width and doesn't have any Style propery like SimpleMarkerSymbol.
In that case I believe you may create a CompositeSymbol using both SimpleMarkerSymbol with Style "Circle" and PIctureMarkerSymbol as below:

/////////

var symbol = new CompositeSymbol();
symbol.Symbols.Add(new SimpleMarkerSymbol() { Style = SimpleMarkerSymbolStyle.Circle, Color = Colors.Blue, Size = 100 });

var symbolUri = new Uri(
"http://sampleserver6.arcgisonline.com/arcgis/rest/services/Recreation/FeatureServer/0/images/e82f744...");

PictureMarkerSymbol campsiteSymbol = new PictureMarkerSymbol(symbolUri);

campsiteSymbol.Height = 40;
campsiteSymbol.Width = 40;

symbol.Symbols.Add(campsiteSymbol);

// Create location for the campsite
MapPoint campsitePoint = new MapPoint(-223560, 6552021, SpatialReferences.WebMercator);

// Create graphic with the location and symbol
// Graphic campsiteGraphic = new Graphic(campsitePoint, campsiteSymbol);

Graphic campsiteGraphic = new Graphic(campsitePoint, symbol);

////////

I have used "RendererPictureMarkers" sample to test. Hope that helps. 

NagmaCompositeSymbol

Reply
0 Kudos
Highlighted
New Contributor III

Thanks, Nagma

Reply
0 Kudos
Highlighted
Esri Frequent Contributor

You will need to create a PNG image with transparent pixels, so only the center parts are non-transparent. That way you can create any shape you'd like.

Reply
0 Kudos