Click or drag to resize

GraphicsOverlayCollection Class

A collection of GraphicsOverlays
Inheritance Hierarchy

Namespace:  Esri.ArcGISRuntime.UI
Assembly:  Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: 100.11.0
public sealed class GraphicsOverlayCollection : RuntimeObservableCollection<GraphicsOverlay>

The GraphicsOverlayCollection type exposes the following members.

Public methodGraphicsOverlayCollection
Initializes a new instance of the GraphicsOverlayCollection class.
Public methodCode exampleAdd
Adds an item to the collection.
(Inherited from RuntimeCollectionT.)
Public methodAddRange (Inherited from RuntimeObservableCollectionT.)
Public methodCode exampleClear
Removes all items from the collection
(Inherited from RuntimeCollectionT.)
Public methodCode exampleContains
Determines whether the collection contains a specific value.
(Inherited from RuntimeCollectionT.)
Public methodCopyTo
Copies the elements of the collection to an Array, starting at a particular Array index.
(Inherited from RuntimeCollectionT.)
Public methodCode exampleGetEnumerator
Returns an enumerator that iterates through the collection.
(Inherited from RuntimeCollectionT.)
Public methodCode exampleIndexOf
Determines the index of a specific item in the collection.
(Inherited from RuntimeCollectionT.)
Public methodCode exampleInsert
Inserts an item to the collection at the specified index.
(Inherited from RuntimeCollectionT.)
Public methodMove
Moves the item at the specified index to a new location in the collection.
(Inherited from RuntimeCollectionT.)
Public methodCode exampleRemove
Removes the first occurrence of a specific object from the collection
(Inherited from RuntimeCollectionT.)
Public methodCode exampleRemoveAt
Removes the item at the specified index.
(Inherited from RuntimeCollectionT.)


Example Name: RenderPictureMarkers

Use pictures for markers.

Code example screen shot.

// Copyright 2016 Esri.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
// language governing permissions and limitations under the License.

using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Mapping;
using Esri.ArcGISRuntime.Symbology;
using Esri.ArcGISRuntime.UI;
using System;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;
using System.Windows;

namespace ArcGISRuntime.WPF.Samples.RenderPictureMarkers
        name: "Picture marker symbol",
        category: "Symbology",
        description: "Use pictures for markers.",
        instructions: "When launched, this sample displays a map with picture marker symbols. Pan and zoom to explore the map.",
        tags: new[] { "graphics", "marker", "picture", "symbol", "visualization" })]
    public partial class RenderPictureMarkers
        public RenderPictureMarkers()

            // Create the UI, setup the control references and execute initialization

        private async void Initialize()
            // Create new Map with basemap
            Map myMap = new Map(BasemapStyle.ArcGISTopographic);

            // Create and set initial map area
            Envelope initialLocation = new Envelope(
                -229835, 6550763, -222560, 6552021,
            myMap.InitialViewpoint = new Viewpoint(initialLocation);

            // Assign the map to the MapView
            MyMapView.Map = myMap;

            // Create overlay to where graphics are shown
            GraphicsOverlay overlay = new GraphicsOverlay();

            // Add created overlay to the MapView

            // Add graphics using different source types
                await CreatePictureMarkerSymbolFromResources(overlay);
            catch (Exception e)
                MessageBox.Show(e.ToString(), "Error");

        private void CreatePictureMarkerSymbolFromUrl(GraphicsOverlay overlay)
            // Create uri to the used image
            Uri symbolUri = new Uri(

            // Create new symbol using asynchronous factory method from uri.
            PictureMarkerSymbol campsiteSymbol = new PictureMarkerSymbol(symbolUri)
                Width = 40,
                Height = 40

            // 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);

            // Add graphic to the graphics overlay

        private async Task CreatePictureMarkerSymbolFromResources(GraphicsOverlay overlay)
            // Get current assembly that contains the image
            Assembly currentAssembly = Assembly.GetExecutingAssembly();

            // Get image as a stream from the resources
            // Picture is defined as EmbeddedResource and DoNotCopy
            Stream resourceStream = currentAssembly.GetManifestResourceStream(

            // Create new symbol using asynchronous factory method from stream
            PictureMarkerSymbol pinSymbol = await PictureMarkerSymbol.CreateAsync(resourceStream);
            pinSymbol.Width = 50;
            pinSymbol.Height = 50;

            // Create location for the pint
            MapPoint pinPoint = new MapPoint(-226773, 6550477, SpatialReferences.WebMercator);

            // Create graphic with the location and symbol
            Graphic pinGraphic = new Graphic(pinPoint, pinSymbol);

            // Add graphic to the graphics overlay
<UserControl x:Class="ArcGISRuntime.WPF.Samples.RenderPictureMarkers.RenderPictureMarkers"
             d:DesignHeight="300" d:DesignWidth="300">
        <esri:MapView x:Name="MyMapView"/>
See Also
Additional Examples
Hyperlink to ExampleDescription
AddGraphicsRendererA renderer allows you to change the style of all graphics in a graphics overlay by referencing a single symbol style.
AddGraphicsWithSymbolsUse a symbol style to display a graphic on a graphics overlay.
AnalyzeViewshedCalculate a viewshed using a geoprocessing service, in this case showing what parts of a landscape are visible from points on mountainous terrain.
Animate3DGraphicAn `OrbitGeoElementCameraController` follows a graphic while the graphic's position and rotation are animated.
BufferCreate a buffer around a map point and display the results as a `Graphic`
BufferListGenerate multiple individual buffers or a single unioned buffer around multiple points.
ChooseCameraControllerControl the behavior of the camera in a scene.
ClipGeometryClip a geometry with another geometry.
ClosestFacilityFind a route to the closest facility from a location.
ClosestFacilityStaticFind routes from several locations to the respective closest facility.
ConvexHullCreate a convex hull for a given set of points. The convex hull is a polygon with shortest perimeter that encloses a set of points. As a visual analogy, consider a set of points as nails in a board. The convex hull of the points would be like a rubber band stretched around the outermost nails.
ConvexHullListGenerate convex hull polygon(s) from multiple input geometries.
CreateGeometriesCreate simple geometry types.
CutGeometryCut a geometry along a polyline.
DensifyAndGeneralizeA multipart geometry can be densified by adding interpolated points at regular intervals. Generalizing multipart geometry simplifies it while preserving its general shape. Densifying a multipart geometry adds more vertices at regular intervals.
DictionaryRendererGraphicsOverlayThis sample demonstrates applying a dictionary renderer to graphics, in order to display military symbology without the need for a feature table.
DisplayUtilityAssociationsCreate graphics for utility associations in a utility network.
EditAndSyncFeaturesSynchronize offline edits with a feature service.
ExportTilesDownload tiles to a local tile cache file stored on the device.
FindAddressFind the location for an address.
FindPlaceFind places of interest near a location or within a specific area.
FindRouteDisplay directions for a route between two points.
FindServiceAreaFind the service area within a network from a given point.
FindServiceAreasForMultipleFacilitiesFind the service areas of several facilities from a feature service.
FormatCoordinatesFormat coordinates in a variety of common notations.
GenerateGeodatabaseGenerate a local geodatabase from an online feature service.
GenerateOfflineMapTake a web map offline.
GenerateOfflineMapWithOverridesTake a web map offline with additional options for each layer.
GeodesicOperationsCalculate a geodesic path between two points and measure its distance.
GetElevationAtPointGet the elevation for a given point on a surface in a scene.
IdentifyGraphicsDisplay an alert message when a graphic is clicked.
LineOfSightGeoElementShow a line of sight between two moving objects.
ListTransformationsGet a list of suitable transformations for projecting a geometry between two spatial references with different horizontal datums.
MapImageLayerTablesFind features in a spatial table related to features in a non-spatial table.
MapImageSublayerQueryFind features in a sublayer based on attributes and location.
MobileMapSearchAndRouteDisplay maps and use locators to enable search and routing offline using a Mobile Map Package.
NavigateRouteUse a routing service to navigate between points.
NavigateRouteReroutingNavigate between two points and dynamically recalculate an alternate route when the original route is unavailable.
NearestVertexFind the closest vertex and coordinate of a geometry to a point.
OfflineBasemapByReferenceUse the `OfflineMapTask` to take a web map offline, but instead of downloading an online basemap, use one which is already on the device.
OfflineGeocodeGeocode addresses to locations and reverse geocode locations to addresses offline.
OfflineRoutingSolve a route on-the-fly using offline data.
PerformValveIsolationTraceRun a filtered trace to locate operable features that will isolate an area from the flow of network resources.
ProjectProject a point from one spatial reference to another.
RenderPictureMarkersUse pictures for markers.
RenderSimpleMarkersShow a simple marker symbol on a map.
ReverseGeocodeUse an online service to find the address for a tapped point.
RouteAroundBarriersFind a route that reaches all stops without crossing any barriers.
ScenePropertiesExpressionsUpdate the orientation of a graphic using expressions based on its attributes.
SceneSymbolsShow various kinds of 3D symbols in a scene.
ShowLocationHistoryDisplay your location history on the map.
SimpleRenderersDisplay common symbols for all graphics in a graphics overlay with a renderer.
SketchOnMapUse the Sketch Editor to edit or sketch a new point, line, or polygon geometry on to a map.
SpatialOperationsFind the union, intersection, or difference of two geometries.
SpatialRelationshipsDetermine spatial relationships between two geometries.
SurfacePlacementsPosition graphics relative to a surface using different surface placement modes.
SymbolsFromMobileStyleCombine multiple symbols from a mobile style file into a single symbol.
TraceUtilityNetworkDiscover connected features in a utility network using connected, subnetwork, upstream, and downstream traces.
UseDistanceCompositeSymChange a graphic's symbol based on the camera's proximity to it.
ViewshedGeoElementAnalyze the viewshed for an object (GeoElement) in a scene.
ViewshedLocationPerform a viewshed analysis from a defined vantage point.