{"id":1845082,"date":"2023-04-19T10:00:07","date_gmt":"2023-04-19T17:00:07","guid":{"rendered":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=1845082"},"modified":"2024-04-12T02:39:01","modified_gmt":"2024-04-12T09:39:01","slug":"create-real-time-apps-with-arcgis-maps-sdks-for-native-apps","status":"publish","type":"blog","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps","title":{"rendered":"Eight essential real-time techniques with ArcGIS Maps SDKs for Native Apps"},"author":8512,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"_searchwp_excluded":""},"categories":[738191,37121],"tags":[768202,23451],"industry":[],"product":[761642,769142,36601],"class_list":["post-1845082","blog","type-blog","status-publish","format-standard","hentry","category-developers","category-real-time","tag-arcgis-maps-sdks-for-native-apps","tag-arcgis-runtime","product-platform","product-sdk-net","product-developers"],"acf":{"authors":[{"ID":8512,"user_firstname":"Thad","user_lastname":"Tilton","nickname":"Thad Tilton","user_nicename":"ttilton","display_name":"Thad Tilton","user_email":"TTilton@esri.com","user_url":"","user_registered":"2018-11-05 21:12:45","user_description":"I'm a product engineer on the ArcGIS Maps SDKs for Native Apps team, where I help create and maintain developer guides and API reference documentation. I enjoy .NET programming, helping our customers solve problems, and exploring creative ways of using ArcGIS.","user_avatar":"<img alt='' src='https:\/\/secure.gravatar.com\/avatar\/ca357c472fe1cfc0327aad444d36ceff475526bff5e5afe118b7fba02dda2d14?s=96&#038;d=blank&#038;r=g' srcset='https:\/\/secure.gravatar.com\/avatar\/ca357c472fe1cfc0327aad444d36ceff475526bff5e5afe118b7fba02dda2d14?s=192&#038;d=blank&#038;r=g 2x' class='avatar avatar-96 photo' height='96' width='96' loading='lazy' decoding='async'\/>"}],"short_description":"Illustrates the use of ArcGIS Maps SDKs for Native Apps to consume data from a feed and dynamically update geoelement location and attributes.","flexible_content":[{"acf_fc_layout":"content","content":"<p>It wasn\u2019t long ago that maps were strictly static documents whose information was quickly out-of-date. In the last few decades, GIS and the internet have revolutionized the map, turning it from a static document into a dynamic online resource. To provide data that is relevant and up-to-date, mobile data collection and crowdsourcing now ensure data updates occur quickly and efficiently. Despite such advances, traditional GIS data updates are still not frequent or consistent enough for some use cases.<\/p>\n"},{"acf_fc_layout":"content","content":"<p>In this article, I walk through creating an application that highlights some common workflows for processing data in real-time using ArcGIS Maps SDKs for Native Apps. I use .NET (C#) code to show some examples, but the concepts apply to each of the Native SDKs that support consuming data from a stream.<\/p>\n<ol>\n<li><a href=\"#connect_to_stream\">Connect to a data stream<\/a><\/li>\n<li><a href=\"#filter_stream_data\">Filter data coming from a stream<\/a><\/li>\n<li><a href=\"#display_stream_data\">Display stream data<\/a><\/li>\n<li><a href=\"#listen_for_updates\">Listen for stream data updates<\/a><\/li>\n<li><a href=\"#get_unique_values\">Find unique values for a set of stream objects<\/a><\/li>\n<li><a href=\"#scale_dependent_rendering\">Keep the display tidy with scale-dependent rendering<\/a><\/li>\n<li><a href=\"#select_and_identify\">Select and identify objects from the stream<\/a><\/li>\n<li><a href=\"#track_one_entity\">Listen for updates to a specific stream object<\/a><\/li>\n<\/ol>\n<p>For an overview of creating real-time apps using your preferred Native SDK, see the <em>Real-time<\/em> topic in the developer guide: <strong><a href=\"https:\/\/developers.arcgis.com\/java\/real-time\/\">Java<\/a><\/strong> | <a href=\"https:\/\/developers.arcgis.com\/net\/real-time\/\"><strong>.NET<\/strong><\/a> | <strong><a href=\"https:\/\/developers.arcgis.com\/qt\/real-time\/\">Qt<\/a><\/strong> | <strong><a href=\"https:\/\/developers.arcgis.com\/swift\/real-time\/\">Swift<\/a><\/strong>.<\/p>\n"},{"acf_fc_layout":"content","content":"<h2>Keeping it real<\/h2>\n<p>Sometimes, data-driven decisions require information for current (or very recent) conditions in a quickly changing environment. Real-time apps rely on data that is updated frequently to show its current (or nearly current) state. This data commonly comes from GPS and other sensors that provide location and attribute updates. You can connect to a data stream to bring data updates directly into your ArcGIS Maps SDK for Native Apps application and process them in real time. Once established, a connection to a data stream continues to deliver updates until the connection is closed.<br \/>\nThe following are examples of real-time apps in various application areas:<\/p>\n<ul>\n<li><strong>Utilities<\/strong>\u2014Monitor power consumption across the grid to respond quickly to demand changes or outages.<\/li>\n<li><strong>Public safety<\/strong>\u2014Identify responders in the area best suited to respond to an incoming emergency.<\/li>\n<li><strong>Environmental<\/strong>\u2014Monitor stream gauges and current weather conditions to assess the risk of floods.<\/li>\n<li><strong>Transportation<\/strong>\u2014Track vehicles across public transportation routes so riders can anticipate delays.<\/li>\n<\/ul>\n<p>Real-time apps may receive and interpret observations from various data streams, including stationary sensors like weather stations, moving assets like vehicles, or point-in-time events like crime and accidents.<\/p>\n"},{"acf_fc_layout":"sidebar","content":"<p>Use <em>ArcGIS Maps SDKs for Native Apps<\/em> (formerly <em>ArcGIS Runtime SDKs)<\/em> to build apps for a variety of platforms. These SDKs include:<\/p>\n<ul>\n<li><a href=\"https:\/\/developers.arcgis.com\/java\/\">ArcGIS Maps SDK for Java<\/a><\/li>\n<li><a href=\"https:\/\/developers.arcgis.com\/kotlin\/\">ArcGIS Maps SDK for Kotlin<\/a><\/li>\n<li><a href=\"https:\/\/developers.arcgis.com\/net\/\">ArcGIS Maps SDK for .NET<\/a><\/li>\n<li><a href=\"https:\/\/developers.arcgis.com\/qt\/\">ArcGIS Maps SDK for Qt<\/a><\/li>\n<li><a href=\"https:\/\/developers.arcgis.com\/swift\/\">ArcGIS Maps SDK for Swift<\/a><\/li>\n<\/ul>\n<p>The dynamic entities API described in this article was introduced at version 200.1 for all SDKs except Maps SDK for Kotlin. It was introduced for that SDK at version 200.2.<\/p>\n","image_reference":false,"layout":"standard","image_reference_figure":"","snippet":"","spotlight_name":"","section_title":"","position":"Right","spotlight_image":false},{"acf_fc_layout":"content","content":"<h2>API overview<\/h2>\n<div>ArcGIS Maps SDKs for Native Apps hide much of the complexity of processing and displaying data coming from a feed. With a few lines of code, you can connect to a supported stream data source. Display objects from the stream (known as <em>dynamic entities<\/em>) in a layer designed for real-time display. While reading and displaying stream data requires no further work, you can also handle data source events. These events give you more fine-grained control of the data updates, connection status, and so on.<\/div>\n<ul>\n<li><a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.RealTime.DynamicEntityDataSource.html\"><code>DynamicEntityDataSource<\/code><\/a> connects to a stream data source and provides notifications for data updates and connection status changes. The connection is maintained (automatically reconnected as needed, for example) to make sure data continues to flow.<\/li>\n<li><a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.RealTime.DynamicEntity.html\"><code>DynamicEntity<\/code><\/a> represents one of the real-world objects described by the data source.<\/li>\n<li><a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.RealTime.DynamicEntityObservation.html\"><code>DynamicEntityObservation<\/code><\/a> represents a snapshot in time of the state (attributes and location) of a dynamic entity.<\/li>\n<li><a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.Mapping.DynamicEntityLayer.html\"><code>DynamicEntityLayer<\/code><\/a> displays dynamic entities and observations and updates them as data is received.<\/li>\n<\/ul>\n"},{"acf_fc_layout":"content","content":"<h2>A flight-tracking example<\/h2>\n<p>I include an app that illustrates some of the essential concepts, and perhaps a few pitfalls, you may encounter. The app uses a stream service created with <a href=\"https:\/\/www.esri.com\/en-us\/arcgis\/products\/arcgis-geoevent-server\">ArcGIS GeoEvent Server<\/a> with global flight updates from a <a href=\"https:\/\/flightaware.com\/\" target=\"_blank\" rel=\"noopener\">FlightAware<\/a> data feed. You can filter the stream to only show dynamic entities in the current map extent and list all flights going to a selected airport. Selecting a specific flight shows attributes for the entity (airline, speed, altitude, origin, destination, and so on). The selected flight is also displayed as a graphic that is tracked in an inset scene view. Click a dynamic entity in the map to see a callout with its flight number and departure and arrival airports.<\/p>\n<p>Download the code and try it yourself: <a href=\"https:\/\/github.com\/ThadT\/flight-dynamic-entities\"><strong>flight-dynamic-entities<\/strong><\/a><\/p>\n"},{"acf_fc_layout":"image","image":{"ID":1864612,"id":1864612,"title":"dyn-entities-flight-app","filename":"dyn-entities-flight-app.png","filesize":403977,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-flight-app.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps\/dyn-entities-flight-app","alt":"Flight tracking app that uses dynamic entities","author":"8512","description":"The app connects to an ArcGIS stream service that provides flight tracking info from FlightAware and displays it in the map.","caption":"A flight tracking app that illustrates working with dynamic entities from an ArcGIS stream service.","name":"dyn-entities-flight-app","status":"inherit","uploaded_to":1845082,"date":"2023-03-03 19:31:47","modified":"2023-03-03 19:33:28","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":800,"height":448,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-flight-app-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-flight-app.png","medium-width":464,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-flight-app.png","medium_large-width":768,"medium_large-height":430,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-flight-app.png","large-width":800,"large-height":448,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-flight-app.png","1536x1536-width":800,"1536x1536-height":448,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-flight-app.png","2048x2048-width":800,"2048x2048-height":448,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-flight-app.png","card_image-width":800,"card_image-height":448,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-flight-app.png","wide_image-width":800,"wide_image-height":448}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"sidebar","content":"<h3>Real-time apps<\/h3>\n<p>Even in an ideal situation, data has to travel at the speed of light and undergo some type of processing before making it to your device. While that may be close enough to call &#8220;real-time&#8221;, in most cases a stream does not send updates immediately. Instead, it sends them at a specified interval (cadence). For example, every few seconds, every hour, every day at midnight, and so on.<\/p>\n<p>The term <em>real-time<\/em> better describes an app rather than the data it consumes. When new observations arrive from a stream, a <em>real-time app<\/em> processes them immediately.<\/p>\n","image_reference":false,"layout":"standard","image_reference_figure":"","snippet":"","spotlight_name":"","section_title":"","position":"Right","spotlight_image":false},{"acf_fc_layout":"content","content":"<h2 id=\"connect_to_stream\">Connect to a data stream<\/h2>\n<div>\n<div>At version 200.1, an ArcGIS stream service is the only supported dynamic entity data source, represented by <a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.RealTime.ArcGISStreamService.html\"><code>ArcGISStreamService<\/code><\/a>. For information about creating a stream service, see the <a href=\"https:\/\/doc.arcgis.com\/en\/iot\/get-started\/what-is-arcgis-velocity.htm\">ArcGIS Velocity<\/a> or <a href=\"https:\/\/enterprise.arcgis.com\/en\/geoevent\/latest\/get-started\/what-is-arcgis-geoevent-server.htm\">ArcGIS GeoEvent Server<\/a> documentation. Each of those products allows you to configure a data source using a variety of data feed formats and expose them as a stream service. Supported formats include AWS, Azure, HTTP polling, and many more. To explore custom dynamic entity data sources (using version 200.2 of the SDK), see my article <a href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/craft-your-own-dynamic-entity-data-source-for-arcgis-maps-sdks-for-native-apps\/\">Craft your own dynamic entity data source for ArcGIS Maps SDKs for Native Apps<\/a>.<\/div>\n<\/div>\n<p>The constructor for an <a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.RealTime.ArcGISStreamService.html\"><code>ArcGISStreamService<\/code><\/a> requires the service URI. If the service requires authentication, you&#8217;ll need to handle providing the appropriate credentials or challenging the user for them. See the <a href=\"https:\/\/developers.arcgis.com\/net\/wpf\/sample-code\/authenticate-with-oauth\/\">ArcGIS Maps SDK for .NET OAuth sample<\/a> for an example.<\/p>\n<p>Properties on the <a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.RealTime.ArcGISStreamService.html\"><code>ArcGISStreamService<\/code><\/a> control connection behavior, define how long previous observations are stored, and listen to notifications. Note that the service won&#8217;t start streaming data until it&#8217;s loaded and connected. You can do this explicitly by calling <code>LoadAsync()<\/code> and <code>ConnectAsync()<\/code>. It can also happen implicitly when you add a layer that uses the stream service as its data source. Creating a <code>DynamicEntityLayer<\/code> from a stream data source is discussed later in this article.<\/p>\n<details>\n<summary><span style=\"color: purple; font-style: bold;\">\u2295\u00a0Show code &#8230;<\/span><\/summary>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div>\n<pre style=\"background: #FBFBF9; overflow: auto; width: 100%; height: 100%; border: solid purple; border-width: 0em 0em 0em .3em; padding: .1em .1em; margin: 0; line-height: 125%; font-size: smaller;\">  \r\n  <span style=\"color: #008000;\">\/\/ Create the stream service from the service URL.<\/span>\r\n  <span style=\"color: #2b91af;\">var<\/span> streamService = <span style=\"color: #0000ff;\">new<\/span> ArcGISStreamService(<span style=\"color: #0000ff;\">new<\/span> Uri(serviceUrl));\r\n\r\n  <span style=\"color: #008000;\">\/\/ Set option to purge updates older than 12 hours.<\/span>\r\n  streamService.PurgeOptions.MaximumDuration = <span style=\"color: #0000ff;\">new<\/span> TimeSpan(12, 0, 0);\r\n\r\n  <span style=\"color: #008000;\">\/\/ Set the max reconnection interval time and max reconnect attempts.<\/span>\r\n  streamService.ReconnectionInterval = <span style=\"color: #0000ff;\">new<\/span> TimeSpan(0, 0, 15); \r\n  streamService.MaximumReconnectionAttempts = 6;\r\n\r\n  <span style=\"color: #008000;\">\/\/ Handle changes to the connection status.<\/span>\r\n  streamService.ConnectionStatusChanged += ConnectionStatusChanged;\r\n\r\n<\/pre>\n<\/div>\n<\/details>\n<p>&nbsp;<\/p>\n<h2 id=\"filter_stream_data\">Filter data from the stream<\/h2>\n<p>Apply a <a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.RealTime.ArcGISStreamServiceFilter.html\"><code>ArcGISStreamServiceFilter<\/code><\/a> to the data source to filter the data received from the stream. You can filter based on a specific area (envelope) or with an attribute expression (or both). The filter is applied on the server to limit the data sent to the client. Applying a filter to the stream can reduce the amount of data stored locally.<\/p>\n<details>\n<summary><span style=\"color: purple; font-style: bold;\">\u2295\u00a0Show code &#8230;<\/span><\/summary>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div>\n<pre style=\"background: #FBFBF9; overflow: auto; width: 100%; height: 100%; border: solid purple; border-width: 0em 0em 0em .3em; padding: .1em .1em; margin: 0; line-height: 125%; font-size: smaller;\">     \r\n  <span style=\"color: #008000;\">\/\/ Filter to show flights higher than 10,000 ft within the map extent<\/span>\r\n  <span style=\"color: #008000;\">\/\/ (define this before calling LoadAsync() on the service).<\/span>\r\n  <span style=\"color: #2b91af;\">var<\/span> streamFilter = <span style=\"color: #0000ff;\">new<\/span> ArcGISStreamServiceFilter\r\n  {\r\n      Geometry = currentMapExtent,\r\n      WhereClause = <span style=\"color: #a31515;\">\"alt &gt;= 10000\"<\/span>\r\n  };\r\n  streamService.Filter = streamFilter;\r\n\r\n  <span style=\"color: #0000ff;\">await<\/span> streamService.LoadAsync();\r\n\r\n<\/pre>\n<\/div>\n<\/details>\n"},{"acf_fc_layout":"sidebar","content":"<p>You cannot set the filter (or change it) after the service has loaded. If no data comes from the service when testing your app, try removing any filter defined for the service.<\/p>\n","image_reference":false,"layout":"standard","image_reference_figure":"","snippet":"","spotlight_name":"","section_title":"","position":"Center","spotlight_image":false},{"acf_fc_layout":"content","content":"<h2 id=\"display_stream_data\">Display data coming from the stream<\/h2>\n<p>Once the dynamic entity data source connection is loaded and connected, data will begin to flow from the stream. Create a <a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.Mapping.DynamicEntityLayer.html\"><code>DynamicEntityLayer<\/code><\/a> from the data source and add it to your map or scene to see dynamic entities appear. If you create a <a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.Mapping.DynamicEntityLayer.html\"><code>DynamicEntityLayer<\/code><\/a> with a data connection that is not loaded or connected, the connection will load and connect automatically when the layer is added to the map or scene. Like other layers you may have worked with (such as <code>FeatureLayer<\/code>), you can control rendering (symbols), labeling, and various other display properties. The layer&#8217;s <a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.Mapping.TrackDisplayProperties.html\"><code>TrackDisplayProperties<\/code><\/a> allows you to control the display of previous observations. You can set a maximum number of observations to show, connect them with a <em>track line<\/em>, and render the observations and\/or track lines.<\/p>\n<details>\n<summary><span style=\"color: purple; font-style: bold;\">\u2295\u00a0Show code &#8230;<\/span><\/summary>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #FBFBF9; overflow: auto; width: 100%; height: 100%; border: solid purple; border-width: 0em 0em 0em .3em; padding: .1em .1em; margin: 0; line-height: 125%; font-size: smaller;\">\n<pre style=\"margin: 0; line-height: 125%;\">  <span style=\"color: #008000;\">\/\/ Create a dynamic entity layer.<\/span>\r\n  _dynamicEntityLayer = <span style=\"color: #0000ff;\">new<\/span> DynamicEntityLayer(streamService)\r\n  {\r\n      <span style=\"color: #008000;\">\/\/ Create and apply a simple renderer.<\/span>\r\n      Renderer = <span style=\"color: #0000ff;\">new<\/span> SimpleRenderer(\r\n      <span style=\"color: #0000ff;\">new<\/span> SimpleMarkerSymbol(SimpleMarkerSymbolStyle.Circle, \r\n                              System.Drawing.Color.Red, \r\n                              6))\r\n  };\r\n\r\n  <span style=\"color: #008000;\">\/\/ Turn tracks, entities, and labels off initially<\/span>\r\n  <span style=\"color: #008000;\">\/\/ (The app will manage the display according to the current map scale).<\/span>\r\n  _dynamicEntityLayer.TrackDisplayProperties.ShowPreviousObservations = <span style=\"color: #0000ff;\">false<\/span>;\r\n  _dynamicEntityLayer.TrackDisplayProperties.ShowTrackLine = <span style=\"color: #0000ff;\">false<\/span>;\r\n  _dynamicEntityLayer.LabelsEnabled = <span style=\"color: #0000ff;\">false<\/span>;\r\n\r\n  <span style=\"color: #008000;\">\/\/ Add the layer to the map.<\/span>\r\n  MainMapView.Map.OperationalLayers.Add(_dynamicEntityLayer);\r\n\r\n<\/pre>\n<\/div>\n<\/details>\n<p>&nbsp;<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":1864582,"id":1864582,"title":"dyn-entities-load-flights","filename":"dyn-entities-load-flights.gif","filesize":6808073,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-load-flights.gif","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps\/dyn-entities-load-flights","alt":"Dynamic entities layer loading data from a stream","author":"8512","description":"A dynamic entity layer loads entities from a data source when it's loaded.","caption":"Flights appear in the dynamic entity layer when the stream service is loaded.","name":"dyn-entities-load-flights","status":"inherit","uploaded_to":1845082,"date":"2023-03-03 18:54:12","modified":"2023-03-03 18:56:21","menu_order":0,"mime_type":"image\/gif","type":"image","subtype":"gif","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":800,"height":448,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-load-flights-213x200.gif","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-load-flights.gif","medium-width":464,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-load-flights.gif","medium_large-width":768,"medium_large-height":430,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-load-flights.gif","large-width":800,"large-height":448,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-load-flights.gif","1536x1536-width":800,"1536x1536-height":448,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-load-flights.gif","2048x2048-width":800,"2048x2048-height":448,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-load-flights.gif","card_image-width":800,"card_image-height":448,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-load-flights.gif","wide_image-width":800,"wide_image-height":448}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<p>Depending on the nature of your data, you may want to toggle additional display settings according to the current map scale. For example, labels, previous observations, and track lines might clutter the display at a small scale. Often, that level of detail is only meaningful and clear at a larger (more zoomed-in) scale.<\/p>\n"},{"acf_fc_layout":"content","content":"<h2 id=\"listen_for_updates\">Listen for when dynamic entities are added or removed<\/h2>\n<p>As information comes from the stream, the local data store adds or removes dynamic entities as needed. Initial observations mean a new flight, while flights with no more associated observations are removed (purged). While the <a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.Mapping.DynamicEntityLayer.html\"><code>DynamicEntityLayer<\/code><\/a> manages the display of the dynamic entities, you can handle the <a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.RealTime.DynamicEntityDataSource.DynamicEntityReceived.html\"><code>DynamicEntityReceived<\/code><\/a> and <a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.RealTime.DynamicEntityDataSource.DynamicEntityPurged.html\"><code>DynamicEntityPurged<\/code><\/a> events for notifications about dynamic entities added or removed from the local data store.<\/p>\n<p>As a simple example, you could increment or decrement a count to keep track of the current number of entities. I use a variable called <em>DynamicEntityCount<\/em> to keep track of the number of flights currently in the data store and display that value in a label.<\/p>\n<details>\n<summary><span style=\"color: purple; font-style: bold;\">\u2295\u00a0Show code &#8230;<\/span><\/summary>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div>\n<pre style=\"background: #FBFBF9; overflow: auto; width: 100%; height: 100%; border: solid purple; border-width: 0em 0em 0em .3em; padding: .1em .1em; margin: 0; line-height: 125%; font-size: smaller;\">  <span style=\"color: #0000ff;\">private<\/span> <span style=\"color: #0000ff;\">void<\/span> StreamService_DynamicEntityReceived(<span style=\"color: #2b91af;\">object?<\/span> s, DynamicEntityEventArgs e)\r\n  {\r\n      DynamicEntityCount++;\r\n  }\r\n\r\n  <span style=\"color: #0000ff;\">private<\/span> <span style=\"color: #0000ff;\">void<\/span> StreamService_DynamicEntityPurged(<span style=\"color: #2b91af;\">object?<\/span> s, DynamicEntityEventArgs e)\r\n  {\r\n      DynamicEntityCount--;\r\n  }\r\n\r\n<\/pre>\n<\/div>\n<\/details>\n<p>&nbsp;<\/p>\n"},{"acf_fc_layout":"content","content":"<h2 id=\"get_unique_values\">Get a list of unique values for the current dynamic entities<\/h2>\n<p>Getting unique values for an attribute is a common workflow when using geographic data. With dynamic entities, however, it can be a bit trickier for a couple of reasons. First, you can\u2019t query the dynamic entity data source directly. Second, the values coming from the stream are not always predictable and may change rapidly. For example, working with flight data from around the globe, I can\u2019t know for sure which destination airports will appear in the feed for a given time, especially if I allow the user to filter the data with a map extent. I could build out a master list of all possible airports and provide that in my app, but that adds too much clutter to the list. A much better experience for the user is to only show the relevant values for current data from the feed.<\/p>\n"},{"acf_fc_layout":"content","content":"<p>What you can do instead is listen to update notifications from the stream. Use them to maintain a list of unique values from the observations as they come in. First, you need to handle one of the following events that are raised when data is received:<\/p>\n<ul>\n<li><a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.RealTime.DynamicEntityDataSource.DynamicEntityReceived.html\"><code>DynamicEntityReceived<\/code><\/a> notifies when a new dynamic entity is received from the stream.<\/li>\n<li><a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.RealTime.DynamicEntityDataSource.DynamicEntityObservationReceived.html\"><code>DynamicEntityObservationReceived<\/code><\/a> notifies of a new observation, either for a new or existing dynamic entity, is received.<\/li>\n<\/ul>\n<h3>Get unique destination airports<\/h3>\n<p>In my app, the user can change the selected airport anytime, perhaps after most of the dynamic entities are received. I therefore handle the observation received event. To work as expected in a multi-threaded environment, my code uses a <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/api\/system.collections.concurrent.concurrentdictionary-2?view=net-7.0\"><code>ConcurrentDictionary<\/code><\/a> (rather than a plain <code>Dictionary<\/code>) with the airport code as the unique key. When an observation is received, the dictionary is used to see if the airport code has already been added. If it&#8217;s a new airport code, it&#8217;s added to an <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/api\/system.collections.objectmodel.observablecollection-1?view=net-7.0\"><code>ObservableCollection&lt;string&gt;<\/code><\/a>. The observable collection is bound to a <code>ComboBox<\/code> to display the unique airport codes currently in the layer.<\/p>\n<details>\n<summary><span style=\"color: purple; font-style: bold;\">\u2295\u00a0Show code &#8230;<\/span><\/summary>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div style=\"background: #FBFBF9; overflow: auto; width: 100%; height: 100%; border: solid purple; border-width: 0em 0em 0em .3em; padding: .1em .1em; margin: 0; line-height: 125%; font-size: smaller;\">\n<pre style=\"margin: 0; line-height: 125%;\">  <span style=\"color: #0000ff;\">private<\/span> <span style=\"color: #0000ff;\">void<\/span> StreamService_DynamicEntityObservationReceived\r\n                (<span style=\"color: #2b91af;\">object?<\/span> sender, DynamicEntityObservationEventArgs e)\r\n  {\r\n      <span style=\"color: #008000;\">\/\/ Get the attributes dictionary for this observation.<\/span>\r\n      <span style=\"color: #2b91af;\">var<\/span> attr = e.Observation.Attributes;\r\n      <span style=\"color: #008000;\">\/\/ Make sure there's a value for the destination airport.<\/span>\r\n      <span style=\"color: #0000ff;\">if<\/span> (attr[<span style=\"color: #a31515;\">\"dest\"<\/span>] != <span style=\"color: #0000ff;\">null<\/span>)\r\n    {\r\n        <span style=\"color: #008000;\">\/\/ Get the destination airport code as an upper-case string.<\/span>\r\n        <span style=\"color: #2b91af;\">var<\/span> thisVal = attr[<span style=\"color: #a31515;\">\"dest\"<\/span>].ToString().ToUpper();\r\n\r\n        <span style=\"color: #008000;\">\/\/ Call 'TryAdd' on the ConcurrentDictionary.<\/span>\r\n        <span style=\"color: #0000ff;\">if<\/span> (_uniqueAirportCodesDictionary.TryAdd(thisVal, thisVal))\r\n          {\r\n              <span style=\"color: #008000;\">\/\/ If new code, add it to the observable collection.<\/span>\r\n              Application.Current?.Dispatcher?.Invoke(() =&gt;\r\n              {\r\n                  CurrentAirports.Add(thisVal);\r\n              });\r\n          }\r\n      }\r\n  }\r\n\r\n<\/pre>\n<\/div>\n<\/details>\n<p>This code uses the hard-coded value for the destination airport field (&#8220;dest&#8221;). You could easily modify this code to look for unique values in a field selected by the user. For example, you could also create a unique list of airlines, departure airports, or aircraft types for the current flights. You could do something more sophisticated here if you wanted, like keep a count for each destination airport. You might also handle the <a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.RealTime.DynamicEntityDataSource.DynamicEntityPurged.html\"><code>DynamicEntityPurged<\/code><\/a> event to decrement the counts (and remove airports) as appropriate.<\/p>\n"},{"acf_fc_layout":"content","content":"<h2>Find dynamic entities that match an attribute expression<\/h2>\n<p>When an airport is selected from the list, a <a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/net\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.Symbology.UniqueValueRenderer.html\"><code>UniqueValueRenderer<\/code><\/a> is applied to the layer. The renderer shows flights traveling to that airport in red and all others in blue. The selected airport is also geocoded and the inset weather map zooms to its location.<\/p>\n<p>Similar to the code above to find unique values for a field, I use the <a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.RealTime.DynamicEntityDataSource.DynamicEntityObservationReceived.html\"><code>DynamicEntityObservationReceived<\/code><\/a> event handler to get a list of flights with a selected destination airport. The logic is essentially the same: when a new observation is received from the stream, I check its attribute values and create a list of unique values. This time, it&#8217;s a list of flight numbers that have the selected airport code for their destination.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":1864942,"id":1864942,"title":"dyn-entities-select-destination","filename":"dyn-entities-select-destination.gif","filesize":8386493,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-select-destination.gif","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps\/dyn-entities-select-destination","alt":"Flights to the selected airport","author":"8512","description":"Dynamic entities that have a destination attribute that matches the selected airport are shown in the list box. The map is rendered to show those flights in red.","caption":"When the user selects a destination, the list box shows flights to that airport.","name":"dyn-entities-select-destination","status":"inherit","uploaded_to":1845082,"date":"2023-03-03 20:36:03","modified":"2023-03-03 20:40:08","menu_order":0,"mime_type":"image\/gif","type":"image","subtype":"gif","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":800,"height":448,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-select-destination-213x200.gif","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-select-destination.gif","medium-width":464,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-select-destination.gif","medium_large-width":768,"medium_large-height":430,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-select-destination.gif","large-width":800,"large-height":448,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-select-destination.gif","1536x1536-width":800,"1536x1536-height":448,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-select-destination.gif","2048x2048-width":800,"2048x2048-height":448,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-select-destination.gif","card_image-width":800,"card_image-height":448,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-select-destination.gif","wide_image-width":800,"wide_image-height":448}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<details>\n<summary><span style=\"color: purple; font-style: bold;\">\u2295\u00a0Show code &#8230;<\/span><\/summary>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div>\n<pre style=\"background: #FBFBF9; overflow: auto; width: 100%; height: 100%; border: solid purple; border-width: 0em 0em 0em .3em; padding: .1em .1em; margin: 0; line-height: 125%; font-size: smaller;\">  <span style=\"color: #0000ff;\">private<\/span> <span style=\"color: #0000ff;\">void<\/span> StreamService_DynamicEntityObservationReceived\r\n            (<span style=\"color: #2b91af;\">object?<\/span> sender, DynamicEntityObservationEventArgs e)\r\n {\r\n    <span style=\"color: #008000;\">\/\/ Get the attributes dictionary for this observation.<\/span>\r\n    <span style=\"color: #2b91af;\">var<\/span> attr = e.Observation.Attributes;\r\n    <span style=\"color: #008000;\">\/\/ Make sure there's a value for the destination airport.<\/span>\r\n    <span style=\"color: #0000ff;\">if<\/span> (attr[<span style=\"color: #a31515;\">\"dest\"<\/span>] != <span style=\"color: #0000ff;\">null<\/span>)\r\n    {\r\n        <span style=\"color: #008000;\">\/\/ Get the destination airport code as an upper-case string.<\/span>\r\n        <span style=\"color: #2b91af;\">var<\/span> thisVal = attr[<span style=\"color: #a31515;\">\"dest\"<\/span>].ToString().ToUpper();\u00a0 \u00a0 \u00a0 \u00a0\r\n<span style=\"color: #008000;\">\r\n        \/\/ ...&lt; code here to get unique airport destinations &gt;...\r\n<\/span>\r\n<span style=\"color: #008000;\">        \/\/ Does the destination (\"dest\") match the selected airport?<\/span>\r\n        <span style=\"color: #0000ff;\">if<\/span> (_findAirport <span style=\"color: #0000ff;\">is<\/span> not <span style=\"color: #0000ff;\">null<\/span> &amp;&amp; thisVal == _findAirport)\r\n        {\r\n            <span style=\"color: #008000;\">\/\/ The \"ident\" field holds the flight ID (\"DAL1234\", eg).<\/span>\r\n            <span style=\"color: #2b91af;\">var<\/span> displayId = attr[<span style=\"color: #a31515;\">\"ident\"<\/span>]?.ToString();\r\n\r\n            <span style=\"color: #0000ff;\">if<\/span> (!<span style=\"color: #2b91af;\">string<\/span>.IsNullOrEmpty(displayId))\r\n            {\r\n                <span style=\"color: #008000;\">\/\/ Get the dynamic entity for this observation.<\/span>\r\n                <span style=\"color: #2b91af;\">var<\/span> dynamicEntity = e.Observation.GetDynamicEntity();\r\n                <span style=\"color: #008000;\">\/\/ Try to add it to the ConcurrentDictionary.<\/span>\r\n                <span style=\"color: #0000ff;\">if<\/span> (_dynamicEntityIdDictionary.TryAdd(displayId, dynamicEntity.EntityId))\r\n                {\r\n                    <span style=\"color: #008000;\">\/\/ If a new ID, add it to the collection.<\/span>\r\n                    Application.Current?.Dispatcher?.Invoke(() =&gt;\r\n                    {\r\n                        DynamicEntityCollection.Add(dynamicEntity);\r\n                    });\r\n                }\r\n            }\r\n        }\r\n    }\r\n }\r\n\r\n<\/pre>\n<\/div>\n<\/details>\n<p>Notice that you can get the dynamic entity from an observation. Likewise, you can get the collection of observations that belong to a dynamic entity.<\/p>\n<p>To accurately track the <strong>current<\/strong> set of flights to the selected airport, I also handle the <a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.RealTime.DynamicEntityDataSource.DynamicEntityPurged.html\"><code>DynamicEntityPurged<\/code><\/a> event to check for entities that are no longer displayed (flights that have landed, for example). If an entity from the list is purged, I remove it from the collection.<\/p>\n<details>\n<summary><span style=\"color: purple; font-style: bold;\">\u2295\u00a0Show code &#8230;<\/span><\/summary>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div>\n<pre style=\"background: #FBFBF9; overflow: auto; width: 100%; height: 100%; border: solid purple; border-width: 0em 0em 0em .3em; padding: .1em .1em; margin: 0; line-height: 125%; font-size: smaller;\">  <span style=\"color: #0000ff;\">private<\/span> <span style=\"color: #0000ff;\">void<\/span> StreamService_DynamicEntityPurged\r\n            (<span style=\"color: #2b91af;\">object?<\/span> sender, DynamicEntityEventArgs e)\r\n {\r\n    DynamicEntityCount--;\r\n\r\n    <span style=\"color: #008000;\">\/\/ Get the dynamic entity being purged.<\/span>\r\n    <span style=\"color: #2b91af;\">var<\/span> dynamicEntity = e.DynamicEntity;\r\n\r\n    <span style=\"color: #008000;\">\/\/ Get the flight ID.<\/span>\r\n    <span style=\"color: #2b91af;\">var<\/span> displayId = dynamicEntity.Attributes[<span style=\"color: #a31515;\">\"ident\"<\/span>]?.ToString();\r\n\r\n    <span style=\"color: #0000ff;\">if<\/span> (!<span style=\"color: #2b91af;\">string<\/span>.IsNullOrEmpty(displayId))\r\n    {\r\n        <span style=\"color: #008000;\">\/\/ Try to remove it from the ConcurrentDictionary.<\/span>\r\n        <span style=\"color: #0000ff;\">if<\/span> (_dynamicEntityIdDictionary.TryRemove(displayId, <span style=\"color: #0000ff;\">out<\/span> <span style=\"color: #2b91af;\">long<\/span> entityId))\r\n        {\r\n            <span style=\"color: #008000;\">\/\/ If removed, also remove from the collection.<\/span>\r\n            Application.Current?.Dispatcher?.Invoke(() =&gt;\r\n            {\r\n                DynamicEntityCollection.Remove(dynamicEntity);\r\n            });\r\n        }\r\n    }\r\n }\r\n\r\n<\/pre>\n<\/div>\n<\/details>\n<p>&nbsp;<\/p>\n"},{"acf_fc_layout":"content","content":"<h2 id=\"scale_dependent_rendering\">Show more details when zoomed in<\/h2>\n<p>When displaying a lot of dynamic entities on the map, it might not make sense to display additional details. Previous observations, track lines, and labels might be informative with a handful of dynamic entities on the display. However, these can clutter the display when there are several hundred or thousands of entities. A good technique is to show additional information only at large scales (when zoomed in). At smaller scales (when zoomed out), hide that information to help declutter the display.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":1864832,"id":1864832,"title":"dyn-entities-scaledep-tracks","filename":"dyn-entities-scaledep-tracks.gif","filesize":7185768,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-scaledep-tracks.gif","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps\/dyn-entities-scaledep-tracks","alt":"Scale-dependent display of dynamic entity tracks and labels","author":"8512","description":"With a lot of dynamic entities and observations, the map can be more readable if observations, track lines, and labels are only shown when a limited number of entities are on the display.","caption":"Dynamic entity observations, track lines, and labels only show at large scales.","name":"dyn-entities-scaledep-tracks","status":"inherit","uploaded_to":1845082,"date":"2023-03-03 20:26:05","modified":"2023-03-03 20:29:22","menu_order":0,"mime_type":"image\/gif","type":"image","subtype":"gif","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":800,"height":448,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-scaledep-tracks-213x200.gif","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-scaledep-tracks.gif","medium-width":464,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-scaledep-tracks.gif","medium_large-width":768,"medium_large-height":430,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-scaledep-tracks.gif","large-width":800,"large-height":448,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-scaledep-tracks.gif","1536x1536-width":800,"1536x1536-height":448,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-scaledep-tracks.gif","2048x2048-width":800,"2048x2048-height":448,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-scaledep-tracks.gif","card_image-width":800,"card_image-height":448,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-scaledep-tracks.gif","wide_image-width":800,"wide_image-height":448}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<p>&nbsp;<\/p>\n<p>The flight-tracking map shows lots of dynamic entities at small scales. I decided to show and hide previous observations, track lines, and labels according to the current map scale. I did this by handling the <code>ViewpointChanged<\/code> event on the <code>MapView<\/code>.<\/p>\n<details>\n<summary><span style=\"color: purple; font-style: bold;\">\u2295\u00a0Show code &#8230;<\/span><\/summary>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div>\n<pre style=\"background: #FBFBF9; overflow: auto; width: 100%; height: 100%; border: solid purple; border-width: 0em 0em 0em .3em; padding: .1em .1em; margin: 0; line-height: 125%; font-size: smaller;\"><span style=\"color: #0000ff;\">\r\n\r\n  private<\/span> <span style=\"color: #0000ff;\">void<\/span> MainMapView_ViewpointChanged(<span style=\"color: #2b91af;\">object<\/span> sender, System.EventArgs e)\r\n  {\r\n    <span style=\"color: #008000;\">\/\/ Get the current map scale.<\/span>\r\n    <span style=\"color: #2b91af;\">var<\/span> currentScale = MainMapView.MapScale;\r\n    <span style=\"color: #008000;\">\/\/ Show tracks at scales larger than 1\/400000<\/span>\r\n    <span style=\"color: #008000;\">\/\/ (otherwise hide them).<\/span>\r\n    <span style=\"color: #2b91af;\">var<\/span> showTracks = (currentScale &lt;= 400000);\r\n\r\n    <span style=\"color: #008000;\">\/\/ Layer might not be loaded yet.<\/span>\r\n    <span style=\"color: #0000ff;\">if<\/span> (_dynamicEntityLayer != <span style=\"color: #0000ff;\">null<\/span>)\r\n    {\r\n      <span style=\"color: #008000;\">\/\/ Toggle tracks, observations, and labels.<\/span>\r\n      _dynamicEntityLayer.TrackDisplayProperties.ShowTrackLine = showTracks;\r\n      _dynamicEntityLayer.TrackDisplayProperties.ShowPreviousObservations = showTracks;\r\n      _dynamicEntityLayer.LabelsEnabled = showTracks;\r\n    }\r\n  }\r\n\r\n<\/pre>\n<\/div>\n<\/details>\n<p>&nbsp;<\/p>\n"},{"acf_fc_layout":"content","content":"<h2 id=\"select_and_identify\">Select or identify dynamic entities<\/h2>\n<p>Like any other geoelement, you can identify dynamic entities with a tap (or click) on the view. You can also select (and unselect) dynamic entities (and dynamic entity observations) in a <a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.Mapping.DynamicEntityLayer.html\"><code>DynamicEntityLayer<\/code><\/a>.<\/p>\n<p>When a flight is selected in the <code>ListBox<\/code>, I use the following code to select it on the map. The <a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.Mapping.DynamicEntityLayer.html\"><code>DynamicEntityLayer<\/code><\/a> also provides methods for selecting or unselecting a set of entities (rather than just one) and for getting the currently selected entities.<\/p>\n<details>\n<summary><span style=\"color: purple; font-style: bold;\">\u2295\u00a0Show code &#8230;<\/span><\/summary>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div>\n<pre style=\"background: #FBFBF9; overflow: auto; width: 100%; height: 100%; border: solid purple; border-width: 0em 0em 0em .3em; padding: .1em .1em; margin: 0; line-height: 125%; font-size: smaller;\">  <span style=\"color: #008000;\">\/\/ Get the item selected in the ListBox.<\/span>\r\n  SelectedFlight = e.AddedItems[0] <span style=\"color: #0000ff;\">as<\/span> DynamicEntity;\r\n  <span style=\"color: #0000ff;\">if<\/span> (SelectedFlight == <span style=\"color: #0000ff;\">null<\/span>) { <span style=\"color: #0000ff;\">return<\/span>; }\r\n\r\n  <span style=\"color: #008000;\">\/\/ Clear any currently selected flights.<\/span>\r\n  _dynamicEntityLayer.ClearSelection();\r\n\r\n  <span style=\"color: #008000;\">\/\/ Select the flight in the layer.<\/span>\r\n  _dynamicEntityLayer.SelectDynamicEntity(SelectedFlight);\r\n\r\n<\/pre>\n<\/div>\n<\/details>\n<p>The following code identifies a dynamic entity <strong>observation<\/strong> when the <code>MapView<\/code> is tapped. From the observation, you can get the dynamic entity it applies to. This technique allows the user to click any observation and have the callout jump to the dynamic entity itself (essentially, the most current observation). As the dynamic entity location is updated, the callout will move with it (no additional code or logic is required).<\/p>\n<details>\n<summary><span style=\"color: purple; font-style: bold;\">\u2295\u00a0Show code &#8230;<\/span><\/summary>\n<p><!-- HTML generated using hilite.me --><\/p>\n<div>\n<pre style=\"background: #FBFBF9; overflow: auto; width: 100%; height: 100%; border: solid purple; border-width: 0em 0em 0em .3em; padding: .1em .1em; margin: 0; line-height: 125%; font-size: smaller;\"><span style=\"color: #0000ff;\">\r\n\r\n  private<\/span> <span style=\"color: #0000ff;\">async<\/span> <span style=\"color: #0000ff;\">void<\/span> MainMapView_Tapped\r\n            (<span style=\"color: #2b91af;\">object<\/span> sender, Esri.ArcGISRuntime.UI.Controls.GeoViewInputEventArgs e)\r\n  {\r\n    <span style=\"color: #008000;\">\/\/ First dismiss any existing callout (previous identify, eg).<\/span>\r\n    MainMapView.DismissCallout();\r\n\r\n    <span style=\"color: #0000ff;\">if<\/span>(_dynamicEntityLayer <span style=\"color: #0000ff;\">is<\/span> <span style=\"color: #0000ff;\">null<\/span>) { <span style=\"color: #0000ff;\">return<\/span>; }\r\n\r\n    <span style=\"color: #008000;\">\/\/ Identify the dynamic entity layer using the tap\/click location.<\/span>\r\n    <span style=\"color: #2b91af;\">var<\/span> idResult = <span style=\"color: #0000ff;\">await<\/span> MainMapView.IdentifyLayerAsync\r\n                   (_dynamicEntityLayer, \r\n                    e.Position, \r\n                    4, \r\n                    <span style=\"color: #0000ff;\">false<\/span>, \r\n                    1);\r\n\r\n    <span style=\"color: #008000;\">\/\/ Get the first DynamicEntityObservation from the results.<\/span>\r\n    <span style=\"color: #2b91af;\">var<\/span> obs = idResult.GeoElements.FirstOrDefault() <span style=\"color: #0000ff;\">as<\/span> DynamicEntityObservation;\r\n\r\n    <span style=\"color: #008000;\">\/\/ Get the DynamicEntity for this observation.<\/span>\r\n    <span style=\"color: #008000;\">\/\/ (if the user clicked a previous observation,<\/span>\r\n    <span style=\"color: #008000;\">\/\/ this will \"jump\" the callout to the last one).<\/span>\r\n    <span style=\"color: #2b91af;\">var<\/span> de = obs?.GetDynamicEntity();\r\n\r\n    <span style=\"color: #0000ff;\">if<\/span> (de != <span style=\"color: #0000ff;\">null<\/span>)\r\n    {\r\n        <span style=\"color: #008000;\">\/\/ Get the flight ID, departure and arrival airports.<\/span>\r\n        <span style=\"color: #2b91af;\">var<\/span> flight = de.Attributes[<span style=\"color: #a31515;\">\"ident\"<\/span>]?.ToString();\r\n        <span style=\"color: #2b91af;\">var<\/span> <span style=\"color: #0000ff;\">from<\/span> = de.Attributes[<span style=\"color: #a31515;\">\"orig\"<\/span>]?.ToString();\r\n        <span style=\"color: #2b91af;\">var<\/span> to = de.Attributes[<span style=\"color: #a31515;\">\"dest\"<\/span>]?.ToString();\r\n        <span style=\"color: #2b91af;\">var<\/span> fromTo = <span style=\"border: 1px solid #FF0000;\">$<\/span><span style=\"color: #a31515;\">\"From '{from}' To '{to}'\"<\/span>;\r\n\r\n        <span style=\"color: #008000;\">\/\/ Show the flight info in a callout at the entity location.<\/span>\r\n        <span style=\"color: #2b91af;\">var<\/span> calloutDef = <span style=\"color: #0000ff;\">new<\/span> CalloutDefinition(flight, fromTo);\r\n        MainMapView.ShowCalloutForGeoElement(de, e.Position, calloutDef);\r\n    }\r\n  }\r\n\r\n<\/pre>\n<\/div>\n<\/details>\n<p>&nbsp;<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":1863792,"id":1863792,"title":"dyn-entities-callout","filename":"dyn-entities-callout.gif","filesize":1693759,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-callout.gif","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps\/dyn-entities-callout","alt":"A callout moving with the dynamic entity it describes","author":"8512","description":"A callout will move to match the location of a dynamic entity when its location is updated.","caption":"A callout moving with the dynamic entity it describes.","name":"dyn-entities-callout","status":"inherit","uploaded_to":1845082,"date":"2023-03-03 01:06:23","modified":"2023-03-03 01:08:03","menu_order":0,"mime_type":"image\/gif","type":"image","subtype":"gif","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":800,"height":448,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-callout-213x200.gif","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-callout.gif","medium-width":464,"medium-height":261,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-callout.gif","medium_large-width":768,"medium_large-height":430,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-callout.gif","large-width":800,"large-height":448,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-callout.gif","1536x1536-width":800,"1536x1536-height":448,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-callout.gif","2048x2048-width":800,"2048x2048-height":448,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-callout.gif","card_image-width":800,"card_image-height":448,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-callout.gif","wide_image-width":800,"wide_image-height":448}},"image_position":"left-center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<h2 id=\"track_one_entity\">Handle updates for one dynamic entity<\/h2>\n<p>Listen for updates to a specific dynamic entity by handling its <a href=\"https:\/\/developers.arcgis.com\/net\/api-reference\/api\/netwin\/Esri.ArcGISRuntime\/Esri.ArcGISRuntime.RealTime.DynamicEntity.DynamicEntityChanged.html\"><code>DynamicEntityChanged<\/code><\/a> event. In the event handler, you can respond to observations received or purged for the entity. You can also be notified when the entity itself is purged. In my app, I subscribe to this event for the selected flight. When I get an update (received observation), I use it to update a graphic in an inset <code>SceneView<\/code>. The graphic is used to track the selected flight&#8217;s location, altitude, and heading. There are other ways you could do this, such as creating another stream data source and filtering it for the one entity you&#8217;re interested in, then creating another dynamic entity layer to display it. I felt like manually updating the graphic was the most straightforward approach for my needs.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":1863932,"id":1863932,"title":"dyn-entities-flight-scene","filename":"dyn-entities-flight-scene.png","filesize":85625,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-flight-scene.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps\/dyn-entities-flight-scene","alt":"Scene view airplane graphic updated with a dynamic entity's location.","author":"8512","description":"Listen to the DynamicEntityChanged event to get updates for a specific dynamic entity.","caption":"A graphic in a scene view that's updated with the selected dynamic entity's location.","name":"dyn-entities-flight-scene","status":"inherit","uploaded_to":1845082,"date":"2023-03-03 02:53:40","modified":"2023-03-03 02:57:12","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":350,"height":196,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-flight-scene-213x196.png","thumbnail-width":213,"thumbnail-height":196,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-flight-scene.png","medium-width":350,"medium-height":196,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-flight-scene.png","medium_large-width":350,"medium_large-height":196,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-flight-scene.png","large-width":350,"large-height":196,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-flight-scene.png","1536x1536-width":350,"1536x1536-height":196,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-flight-scene.png","2048x2048-width":350,"2048x2048-height":196,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-flight-scene.png","card_image-width":350,"card_image-height":196,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-flight-scene.png","wide_image-width":350,"wide_image-height":196}},"image_position":"right-center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<details>\n<summary><span style=\"color: purple; font-style: bold;\">\u2295\u00a0Show code &#8230;<\/span><\/summary>\n<div>\n<pre style=\"background: #FBFBF9; border: solid purple; border-width: 0em 0em 0em .3em; padding: .1em .1em; margin: 0; line-height: 125%; font-size: smaller; overflow: auto;\"><span style=\"color: #0000ff;\">\r\n\r\n  private<\/span> <span style=\"color: #0000ff;\">void<\/span> SelectedFlight_DynamicEntityChanged\r\n            (<span style=\"color: #2b91af;\">object?<\/span> sender, DynamicEntityChangedEventArgs e)\r\n  {\r\n    <span style=\"color: #008000;\">\/\/ Get updates from a new observation.<\/span>\r\n    <span style=\"color: #2b91af;\">var<\/span> obs = e.ReceivedObservation;\r\n    <span style=\"color: #0000ff;\">if<\/span>(obs != <span style=\"color: #0000ff;\">null<\/span>)\r\n    {\r\n      <span style=\"color: #008000;\">\/\/ Get the updated altitude for the graphic point z-value.<\/span>\r\n      <span style=\"color: #2b91af;\">double<\/span> planeAltitude = 0.0;\r\n      <span style=\"color: #2b91af;\">double<\/span>.TryParse(obs.Attributes[<span style=\"color: #a31515;\">\"alt\"<\/span>]?.ToString(),  <span style=\"color: #0000ff;\">out<\/span> planeAltitude);\r\n\r\n      <span style=\"color: #2b91af;\">var<\/span> updatedLocation = obs.Geometry <span style=\"color: #0000ff;\">as<\/span> MapPoint;\r\n      <span style=\"color: #2b91af;\">var<\/span> pointZ = <span style=\"color: #0000ff;\">new<\/span> MapPoint\r\n                       (updatedLocation.X, \r\n                        updatedLocation.Y, \r\n                        planeAltitude, \r\n                        updatedLocation.SpatialReference);\r\n\r\n      Dispatcher.Invoke(() =&gt;\r\n      {\r\n          <span style=\"color: #008000;\">\/\/ Update the geometry and the heading attribute.<\/span>\r\n          _planeGraphic.Geometry = pointZ;\r\n          _planeGraphic.Attributes[<span style=\"color: #a31515;\">\"heading\"<\/span>] = obs.Attributes[<span style=\"color: #a31515;\">\"heading\"<\/span>];\r\n      });\r\n    }\r\n  }\r\n\r\n<\/pre>\n<\/div>\n<\/details>\n<p>&nbsp;<\/p>\n"},{"acf_fc_layout":"content","content":"<h2>Summary<\/h2>\n<p>ArcGIS Maps SDKs for Native Apps abstract much of the work required to consume data from a feed, process it in real time, and display it dynamically in your app. Use the API to connect to a supported stream data source and it can automatically display and update dynamic entities created from the stream. While no other work is required to read and display the data, several events exposed by the data source provide fine-grained control of the data updates and connection status.<\/p>\n<p>The nature of stream data can vary widely: delivering a few or several thousands of entities, describing moving or stationary objects, receiving updates extremely frequently or occasionally, and so on. Hopefully, this article has given you an idea of the types of apps you can create and some of the common techniques you can use to consume a variety of data.<\/p>\n<h2>Try it yourself!<\/h2>\n<ul>\n<li><a href=\"https:\/\/github.com\/ThadT\/flight-dynamic-entities\"><strong>flight-dynamic-entities<\/strong><\/a> [GitHub repo]: the project described in this article<\/li>\n<li><strong>Add dynamic entity layer<\/strong> [Native SDKs Sample]: <strong><a href=\"https:\/\/developers.arcgis.com\/java\/sample-code\/add-dynamic-entity-layer\/\">Java<\/a><\/strong> | <strong><a href=\"https:\/\/developers.arcgis.com\/net\/wpf\/sample-code\/add-dynamic-entity-layer\/\">.NET<\/a> <\/strong>| <strong><a href=\"https:\/\/developers.arcgis.com\/qt\/cpp\/sample-code\/add-dynamic-entity-layer\/\">Qt<\/a><\/strong> | <strong><a href=\"https:\/\/developers.arcgis.com\/swift\/sample-code\/add-dynamic-entity-layer\/\">Swift<\/a><\/strong><\/li>\n<li><strong>Work with dynamic entities<\/strong> [Native SDKs Guide Doc]: <strong><a href=\"https:\/\/developers.arcgis.com\/java\/real-time\/work-with-dynamic-entities\/\">Java<\/a><\/strong> | <strong><a href=\"https:\/\/developers.arcgis.com\/net\/real-time\/work-with-dynamic-entities\/\">.NET<\/a><\/strong> | <strong><a href=\"https:\/\/developers.arcgis.com\/qt\/real-time\/work-with-dynamic-entities\/\">Qt<\/a><\/strong> | <strong><a href=\"https:\/\/developers.arcgis.com\/swift\/real-time\/work-with-dynamic-entities\/\">Swift<\/a><\/strong><\/li>\n<li><strong><a href=\"https:\/\/enterprise.arcgis.com\/en\/server\/latest\/publish-services\/windows\/stream-services.htm\">Stream services<\/a><\/strong> [ArcGIS Enterprise Doc]<\/li>\n<li><a href=\"https:\/\/learn.arcgis.com\/en\/paths\/get-started-with-arcgis-velocity\/\"><strong>Get started with ArcGIS Velocity<\/strong><\/a> [Tutorials, Articles, and Videos]<\/li>\n<li><a href=\"https:\/\/enterprise.arcgis.com\/en\/geoevent\/\"><strong>GeoEvent Server<\/strong><\/a> [ArcGIS Enterprise Doc]<\/li>\n<\/ul>\n"}],"related_articles":[{"ID":1186192,"post_author":"207622","post_date":"2021-04-07 08:51:06","post_date_gmt":"2021-04-07 15:51:06","post_content":"","post_title":"Dev Summit 2021: Consume and analyze real-time data using ArcGIS Velocity","post_excerpt":"","post_status":"publish","comment_status":"closed","ping_status":"closed","post_password":"","post_name":"consume-and-analyze-real-time-data-using-arcgis-velocity","to_ping":"","pinged":"","post_modified":"2021-09-02 05:10:15","post_modified_gmt":"2021-09-02 12:10:15","post_content_filtered":"","post_parent":0,"guid":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=1186192","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"0","filter":"raw"},{"ID":1493582,"post_author":"290632","post_date":"2022-03-24 05:00:10","post_date_gmt":"2022-03-24 12:00:10","post_content":"","post_title":"A Real-Time Framework for Winter Weather Operations Using ArcGIS Velocity","post_excerpt":"","post_status":"publish","comment_status":"open","ping_status":"closed","post_password":"","post_name":"a-real-time-framework-for-winter-weather-operation-using-arcgis-velocity","to_ping":"","pinged":"","post_modified":"2023-09-26 06:46:03","post_modified_gmt":"2023-09-26 13:46:03","post_content_filtered":"","post_parent":0,"guid":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=1493582","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"0","filter":"raw"},{"ID":2068762,"post_author":"8512","post_date":"2023-09-14 09:00:14","post_date_gmt":"2023-09-14 16:00:14","post_content":"","post_title":"Craft your own dynamic entity data source for ArcGIS Maps SDKs for Native Apps","post_excerpt":"","post_status":"publish","comment_status":"open","ping_status":"closed","post_password":"","post_name":"craft-your-own-dynamic-entity-data-source-for-arcgis-maps-sdks-for-native-apps","to_ping":"","pinged":"","post_modified":"2024-04-12 01:15:24","post_modified_gmt":"2024-04-12 08:15:24","post_content_filtered":"","post_parent":0,"guid":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=2068762","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"0","filter":"raw"}],"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-blog-card.png","wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-blog-banner.png"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Eight essential real-time techniques with ArcGIS Maps SDKs for Native Apps<\/title>\n<meta name=\"description\" content=\"ArcGIS Maps SDKs for Native Apps can consume data from a feed and dynamically update the location and attributes for geoelements.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Eight essential real-time techniques with ArcGIS Maps SDKs for Native Apps\" \/>\n<meta property=\"og:description\" content=\"ArcGIS Maps SDKs for Native Apps can consume data from a feed and dynamically update the location and attributes for geoelements.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps\" \/>\n<meta property=\"og:site_name\" content=\"ArcGIS Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/esrigis\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-12T09:39:01+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@ESRI\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps\"},\"author\":{\"name\":\"Thad Tilton\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/68e8fc10434ed22705c26033bc89f131\"},\"headline\":\"Eight essential real-time techniques with ArcGIS Maps SDKs for Native Apps\",\"datePublished\":\"2023-04-19T17:00:07+00:00\",\"dateModified\":\"2024-04-12T09:39:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps\"},\"wordCount\":11,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"keywords\":[\"ArcGIS Maps SDKs for Native Apps\",\"ArcGIS Runtime\"],\"articleSection\":[\"Developers\",\"Real-Time Visualization &amp; Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps\",\"name\":\"Eight essential real-time techniques with ArcGIS Maps SDKs for Native Apps\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\"},\"datePublished\":\"2023-04-19T17:00:07+00:00\",\"dateModified\":\"2024-04-12T09:39:01+00:00\",\"description\":\"ArcGIS Maps SDKs for Native Apps can consume data from a feed and dynamically update the location and attributes for geoelements.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.esri.com\/arcgis-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Eight essential real-time techniques with ArcGIS Maps SDKs for Native Apps\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"name\":\"ArcGIS Blog\",\"description\":\"Get insider info from Esri product teams\",\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\",\"name\":\"Esri\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"width\":400,\"height\":400,\"caption\":\"Esri\"},\"image\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/esrigis\/\",\"https:\/\/x.com\/ESRI\",\"https:\/\/www.linkedin.com\/company\/5311\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/68e8fc10434ed22705c26033bc89f131\",\"name\":\"Thad Tilton\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ca357c472fe1cfc0327aad444d36ceff475526bff5e5afe118b7fba02dda2d14?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ca357c472fe1cfc0327aad444d36ceff475526bff5e5afe118b7fba02dda2d14?s=96&d=blank&r=g\",\"caption\":\"Thad Tilton\"},\"description\":\"I'm a product engineer on the ArcGIS Maps SDKs for Native Apps team, where I help create and maintain developer guides and API reference documentation. I enjoy .NET programming, helping our customers solve problems, and exploring creative ways of using ArcGIS.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/thad-tilton-2ba4a92\/\"],\"url\":\"\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Eight essential real-time techniques with ArcGIS Maps SDKs for Native Apps","description":"ArcGIS Maps SDKs for Native Apps can consume data from a feed and dynamically update the location and attributes for geoelements.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps","og_locale":"en_US","og_type":"article","og_title":"Eight essential real-time techniques with ArcGIS Maps SDKs for Native Apps","og_description":"ArcGIS Maps SDKs for Native Apps can consume data from a feed and dynamically update the location and attributes for geoelements.","og_url":"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps","og_site_name":"ArcGIS Blog","article_publisher":"https:\/\/www.facebook.com\/esrigis\/","article_modified_time":"2024-04-12T09:39:01+00:00","twitter_card":"summary_large_image","twitter_site":"@ESRI","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps#article","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps"},"author":{"name":"Thad Tilton","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/68e8fc10434ed22705c26033bc89f131"},"headline":"Eight essential real-time techniques with ArcGIS Maps SDKs for Native Apps","datePublished":"2023-04-19T17:00:07+00:00","dateModified":"2024-04-12T09:39:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps"},"wordCount":11,"commentCount":0,"publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"keywords":["ArcGIS Maps SDKs for Native Apps","ArcGIS Runtime"],"articleSection":["Developers","Real-Time Visualization &amp; Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps","url":"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps","name":"Eight essential real-time techniques with ArcGIS Maps SDKs for Native Apps","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#website"},"datePublished":"2023-04-19T17:00:07+00:00","dateModified":"2024-04-12T09:39:01+00:00","description":"ArcGIS Maps SDKs for Native Apps can consume data from a feed and dynamically update the location and attributes for geoelements.","breadcrumb":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/sdk-net\/developers\/create-real-time-apps-with-arcgis-maps-sdks-for-native-apps#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.esri.com\/arcgis-blog\/"},{"@type":"ListItem","position":2,"name":"Eight essential real-time techniques with ArcGIS Maps SDKs for Native Apps"}]},{"@type":"WebSite","@id":"https:\/\/www.esri.com\/arcgis-blog\/#website","url":"https:\/\/www.esri.com\/arcgis-blog\/","name":"ArcGIS Blog","description":"Get insider info from Esri product teams","publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization","name":"Esri","url":"https:\/\/www.esri.com\/arcgis-blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","width":400,"height":400,"caption":"Esri"},"image":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/esrigis\/","https:\/\/x.com\/ESRI","https:\/\/www.linkedin.com\/company\/5311\/"]},{"@type":"Person","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/68e8fc10434ed22705c26033bc89f131","name":"Thad Tilton","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ca357c472fe1cfc0327aad444d36ceff475526bff5e5afe118b7fba02dda2d14?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ca357c472fe1cfc0327aad444d36ceff475526bff5e5afe118b7fba02dda2d14?s=96&d=blank&r=g","caption":"Thad Tilton"},"description":"I'm a product engineer on the ArcGIS Maps SDKs for Native Apps team, where I help create and maintain developer guides and API reference documentation. I enjoy .NET programming, helping our customers solve problems, and exploring creative ways of using ArcGIS.","sameAs":["https:\/\/www.linkedin.com\/in\/thad-tilton-2ba4a92\/"],"url":""}]}},"text_date":"April 19, 2023","author_name":"Thad Tilton","author_page":false,"custom_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2023\/03\/dyn-entities-blog-banner.png","primary_product":"ArcGIS Maps SDK for .NET","tag_data":[{"term_id":768202,"name":"ArcGIS Maps SDKs for Native Apps","slug":"arcgis-maps-sdks-for-native-apps","term_group":0,"term_taxonomy_id":768202,"taxonomy":"post_tag","description":"","parent":0,"count":30,"filter":"raw"},{"term_id":23451,"name":"ArcGIS Runtime","slug":"arcgis-runtime","term_group":0,"term_taxonomy_id":23451,"taxonomy":"post_tag","description":"","parent":0,"count":91,"filter":"raw"}],"category_data":[{"term_id":738191,"name":"Developers","slug":"developers","term_group":0,"term_taxonomy_id":738191,"taxonomy":"category","description":"","parent":0,"count":421,"filter":"raw"},{"term_id":37121,"name":"Real-Time Visualization &amp; Analytics","slug":"real-time","term_group":0,"term_taxonomy_id":37121,"taxonomy":"category","description":"","parent":0,"count":166,"filter":"raw"}],"product_data":[{"term_id":761642,"name":"ArcGIS Location Platform","slug":"platform","term_group":0,"term_taxonomy_id":761642,"taxonomy":"product","description":"","parent":36601,"count":213,"filter":"raw"},{"term_id":769142,"name":"ArcGIS Maps SDK for .NET","slug":"sdk-net","term_group":0,"term_taxonomy_id":769142,"taxonomy":"product","description":"","parent":36601,"count":39,"filter":"raw"},{"term_id":36601,"name":"Developers","slug":"developers","term_group":0,"term_taxonomy_id":36601,"taxonomy":"product","description":"","parent":0,"count":763,"filter":"raw"}],"primary_product_link":"https:\/\/www.esri.com\/arcgis-blog\/?s=#&products=sdk-net","_links":{"self":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/1845082","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/users\/8512"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/comments?post=1845082"}],"version-history":[{"count":0,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/1845082\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/media?parent=1845082"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/categories?post=1845082"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/tags?post=1845082"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/industry?post=1845082"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/product?post=1845082"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}