Hi,
How do I add multiple graphics (side by side) on the same point (rather than on top of each other) in ArcGIS .Net SDK.
Thanks, Billyson
You can use OffsetX property of MarkerSymbol. In the sample below, graphics share the same geometry, which is the tapped location, but x offset is added to the symbol for the succeeding graphics.
xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013">
<Grid>
<esri:MapView x:Name="MyMapView" GeoViewTapped="MyMapView_GeoViewTapped"/>
</Grid>
public MainWindow()
{
InitializeComponent();
MyMapView.Map = new Map(Basemap.CreateTopographic());
MyMapView.GraphicsOverlays.Add(new GraphicsOverlay());
}
private void MyMapView_GeoViewTapped(object sender, GeoViewInputEventArgs e)
{
var mp = e.Location;
var overlay = MyMapView.GraphicsOverlays[0];
for (int i = 0; i < 5; i++)
{
var sms = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Circle, Colors.Red, 10d);
sms.OffsetX = sms.Size * i;
overlay.Graphics.Add(new Graphic(mp, sms));
}
}
Thanks for the reply.
How do I do this if I will use PictureMarkerSymbol?
Properties OffsetX and OffsetY are also available for PicturemarkerSymbol. You can use the properties same way for PictureMarkerSymbol also.