Add Photo Overlay in ArcGIS SDK for .NET

08-03-2015 12:46 PM
New Contributor III

I am new to the ArcGIS SDK and I can't seem to find how to add a picture on top of the map, using 4-coner coordinates. In the snippet below, coords has the coordiantes for 4 points. I know all I try to do in this example is to fill a polygon with a picture, so if anyone has an example on how to overlay a picture over the map, I would appreciate it. Thanks.

System.Uri myPictureUri = new System.Uri("");

Esri.ArcGISRuntime.Symbology.PictureFillSymbol pictureFillSymbol = new Esri.ArcGISRuntime.Symbology.PictureFillSymbol();

var graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as Esri.ArcGISRuntime.Layers.GraphicsLayer;
if (graphicsLayer == null)
  graphicsLayer = new Esri.ArcGISRuntime.Layers.GraphicsLayer();
  graphicsLayer.ID = "MyGraphicsLayer";

System.Collections.ObjectModel.ObservableCollection<Esri.ArcGISRuntime.Geometry.PointCollection> rings =
  new System.Collections.ObjectModel.ObservableCollection<Esri.ArcGISRuntime.Geometry.PointCollection>();
Esri.ArcGISRuntime.Geometry.PointCollection pointCollection = new Esri.ArcGISRuntime.Geometry.PointCollection(MyMapView.SpatialReference);

for (int i = 0; i < coords.Length-2; i = i + 2)
  Esri.ArcGISRuntime.Geometry.MapPoint point;
  point = Esri.ArcGISRuntime.Geometry.ConvertCoordinate.FromDecimalDegrees(coords.ToString() + " " + coords[i + 1].ToString(), MyMapView.SpatialReference);


//Set Geometry
Esri.ArcGISRuntime.Geometry.Polygon p = new Esri.ArcGISRuntime.Geometry.Polygon(rings, MyMap.SpatialReference);
var overlayGraphic = new Esri.ArcGISRuntime.Layers.Graphic();
overlayGraphic.Geometry = p;
overlayGraphic.Symbol = pictureFillSymbol;

0 Kudos
3 Replies
Esri Frequent Contributor


The Photo Overlay you have sounds like an aerial photograph. We're working on a new high performance "RasterLayer" type which will be able to directly read image/raster files. Until then the best alternative may actually to use KML? Below is an example:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="">
  <name>Ground Overlays</name>
  <description>Examples of ground overlays</description>
  <name>Large-scale overlay on terrain</name>
  <description>Overlay shows Mount Etna erupting
  on July 13th, 2001.</description>

You the approach you have discovered so far is unlikely to give the desired effect, because the PictureFillSymbol is simply tiling the image to fill the area of the polygon. Therefore you cannot guarantee the image will be correctly geo-referenced on the ground.



New Contributor III

Thanks, Mike. Is there a way to add this Kml from a string parameter or a local file in .Net? Also, can href be a local file?

0 Kudos
New Contributor III

Just to be on the same page. What I want to do is similar as in this picture

Can the KmlGroundOverlay class be used for this?

0 Kudos