From 27aa41f26e08694bbc9724ceb44898ad897d98e4 Mon Sep 17 00:00:00 2001 From: Morten Nielsen Date: Thu, 7 Aug 2025 15:28:43 -0700 Subject: [PATCH 01/45] Rewrites the NMEA simulator to provide a proper stream without threading issues (#1649) --- .../LocationWithNMEA/LocationWithNMEA.xaml.cs | 162 +++++++++--------- .../LocationWithNMEA/LocationWithNMEA.xaml.cs | 161 +++++++++-------- .../LocationWithNMEA/LocationWithNMEA.xaml.cs | 161 +++++++++-------- 3 files changed, 238 insertions(+), 246 deletions(-) diff --git a/src/MAUI/Maui.Samples/Samples/Location/LocationWithNMEA/LocationWithNMEA.xaml.cs b/src/MAUI/Maui.Samples/Samples/Location/LocationWithNMEA/LocationWithNMEA.xaml.cs index bd19a00fae..bb783af112 100644 --- a/src/MAUI/Maui.Samples/Samples/Location/LocationWithNMEA/LocationWithNMEA.xaml.cs +++ b/src/MAUI/Maui.Samples/Samples/Location/LocationWithNMEA/LocationWithNMEA.xaml.cs @@ -11,7 +11,9 @@ using Esri.ArcGISRuntime.Geometry; using Esri.ArcGISRuntime.Location; using Esri.ArcGISRuntime.Mapping; +using Esri.ArcGISRuntime.Maui; using Esri.ArcGISRuntime.UI; +using System.Text; using System.Timers; using Location = Esri.ArcGISRuntime.Location.Location; using Timer = System.Timers.Timer; @@ -29,8 +31,6 @@ public partial class LocationWithNMEA : ContentPage, IDisposable { private NmeaLocationDataSource _nmeaSource; - private NMEAStreamSimulator _simulatedNMEADataSource; - public LocationWithNMEA() { InitializeComponent(); @@ -44,11 +44,10 @@ private async Task Initialize() MyMapView.SetViewpoint(new Viewpoint(new MapPoint(-117.191, 34.0306, SpatialReferences.Wgs84), 100000)); // Create the data simulation using stored mock data. - _simulatedNMEADataSource = new NMEAStreamSimulator(6.0); - _simulatedNMEADataSource.NmeaMessageChanged += UpdateNmeaMessageLabel; + string nmeaMockDataPath = DataManager.GetDataFolder("d5bad9f4fee9483791e405880fb466da", "Redlands.nmea"); // Create the NMEA data source. - _nmeaSource = new NmeaLocationDataSource(SpatialReferences.Wgs84); + _nmeaSource = NmeaLocationDataSource.FromStreamCreator((datasource) => Task.FromResult(new SimulatedNmeaStream(nmeaMockDataPath))); // Android and WinUI: // To create a NmeaLocationDataSource for a bluetooth device, use the `FromBluetooth` constructor. https://developers.arcgis.com/net/api-reference/api/android/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Location.NmeaLocationDataSource.FromBluetooth.html @@ -57,33 +56,34 @@ private async Task Initialize() // iOS: // When using an NMEA device on iOS, use the `NmeaLocationDataSource.FromAccessory` constructor. https://developers.arcgis.com/net/api-reference/api/ios/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Location.NmeaLocationDataSource.FromAccessory.html - // Set the location data source to use the stream from the simulator. - Stream messageStream = _simulatedNMEADataSource.MessageStream; - _nmeaSource.NmeaDataStream = messageStream; - // Create an event handler to update the UI when the location changes. _nmeaSource.SatellitesChanged += SatellitesChanged; _nmeaSource.LocationChanged += LocationChanged; + _nmeaSource.SentenceReceived += UpdateNmeaMessageLabel; + + // Load the map and assign the location data source. + MyMapView.PropertyChanged += (s, e) => + { + if (e.PropertyName == nameof(MapView.LocationDisplay)) + MyMapView.LocationDisplay.DataSource = _nmeaSource; + }; - // Start the location data source. try { await MyMapView.Map.LoadAsync(); - MyMapView.LocationDisplay.DataSource = _nmeaSource; - await _nmeaSource.StartAsync(); } catch (Exception ex) { - await Application.Current.Windows[0].Page.DisplayAlert(ex.Message.GetType().Name, ex.Message, "OK"); + await DisplayAlert(ex.Message.GetType().Name, ex.Message, "OK"); } } - private void UpdateNmeaMessageLabel(object sender, NmeaMessageEventArgs e) + private void UpdateNmeaMessageLabel(object sender, string message) { - Microsoft.Maui.ApplicationModel.MainThread.BeginInvokeOnMainThread(() => + if (message.StartsWith("$GPRMC")) // Display the latest RMC message { - NmeaMessageLabel.Text = e.NmeaMessage; - }); + Dispatcher.Dispatch(() => NmeaMessageLabel.Text = message ); + } } private void SatellitesChanged(object sender, IReadOnlyList infos) @@ -98,7 +98,7 @@ private void SatellitesChanged(object sender, IReadOnlyList i uniqueSatelliteIds.Add(info.Id); } - Microsoft.Maui.ApplicationModel.MainThread.BeginInvokeOnMainThread(() => + Dispatcher.Dispatch(() => { // Show the status information in the UI. CountLabel.Text = $"Satellite count: {infos.Count}"; @@ -109,7 +109,7 @@ private void SatellitesChanged(object sender, IReadOnlyList i private void LocationChanged(object sender, Location loc) { - Microsoft.Maui.ApplicationModel.MainThread.BeginInvokeOnMainThread(() => + Dispatcher.Dispatch(() => { // Show the status information in the UI. AccuracyLabel.Text = $"Accuracy: Horizontal {string.Format("{0:0.00}", loc.HorizontalAccuracy)} meters, Vertical {string.Format("{0:0.00}", loc.VerticalAccuracy)} meters"; @@ -121,7 +121,7 @@ private void LocationChanged(object sender, Location loc) private void StartClick(object sender, EventArgs e) { - _simulatedNMEADataSource.Start(); + _nmeaSource.StartAsync(); AccuracyLabel.Text = string.Empty; } @@ -132,8 +132,7 @@ private void RecenterClick(object sender, EventArgs e) private void ResetClick(object sender, EventArgs e) { - _simulatedNMEADataSource.Stop(); - _simulatedNMEADataSource.Reset(); + _nmeaSource.StopAsync(); // Reset the labels. AccuracyLabel.Text = "Simulation reset."; @@ -147,92 +146,99 @@ public void Dispose() { // Stop the location data source. MyMapView.LocationDisplay?.DataSource?.StopAsync(); - _simulatedNMEADataSource?.Dispose(); } } /* * This class uses mock data (an edited recording of a real NMEA data stream) to simulate live NMEA data and create a stream. * For NMEA location data sources created from a Bluetooth device or serial input, you may not need to create your own stream. - * For any other case, you can write the data to a memory stream like below. + * For any other case, you can simulate the datastream from a file like below */ - public class NMEAStreamSimulator : IDisposable + public class SimulatedNmeaStream : Stream { - private Timer _timer; - - public Stream MessageStream; - - private int _lineCounter = 0; + // The default interval in milliseconds between bursts of NMEA data. private const int DefaultInterval = 1000; - private string[] _nmeaStrings; + private readonly Timer _timer; - public event EventHandler NmeaMessageChanged; + private readonly StreamReader _sr; - public NMEAStreamSimulator(double speed = 1.0) - { - _timer = new Timer(DefaultInterval / speed); + private int _pendingBursts = 0; + public SimulatedNmeaStream(string file) + { // Populate an array with all of the mock NMEA data. - string nmeaMockDataPath = DataManager.GetDataFolder("d5bad9f4fee9483791e405880fb466da", "Redlands.nmea"); - _nmeaStrings = File.ReadAllText(nmeaMockDataPath).Split('\n'); - - // Create a data stream for the `NmeaLocationDataSource` to use. - MessageStream = new MemoryStream(); - + _sr = new StreamReader(file); + _timer = new Timer(DefaultInterval); _timer.Elapsed += TimerElapsed; - } - - public void Start() - { _timer.Start(); } - public void Stop() + private void TimerElapsed(object sender, ElapsedEventArgs e) => Interlocked.Increment(ref _pendingBursts); + + protected override void Dispose(bool disposing) { - _timer.Stop(); + if (disposing) + { + // Dispose of the timer and stream. + _timer.Stop(); + _timer.Dispose(); + _sr.Dispose(); + } + base.Dispose(disposing); } - public void Reset() + #region Implementation of a custom System.IO.Stream + + public override int Read(byte[] buffer, int offset, int count) { - _timer.Stop(); - _lineCounter = 0; + if (_pendingBursts == 0) + // Nothing in the buffer to read. + return 0; + + // Read all the pending bursts of data until we fill up the buffer. + var start = _sr.BaseStream.Position; + StringBuilder sb = new StringBuilder(); + while (sb.Length < count && !_sr.EndOfStream && _pendingBursts > 0) + { + string line = _sr.ReadLine(); + // In this sample we pause the burst of messages for each GGA message to simulate the break in the nmea stream on a receiver. + if (line.StartsWith("$GPGGA,") && Interlocked.Decrement(ref _pendingBursts) == 0) + { + break; + } + sb.AppendLine(line); + } + + if (sb.Length == 0) + return 0; + byte[] data = System.Text.Encoding.UTF8.GetBytes(sb.ToString()); + count = Math.Min(count, data.Length); + Array.Copy(data, 0, buffer, offset, count); + // Move the stream position forward only the amount of data we read. + _sr.BaseStream.Seek(start + count, SeekOrigin.Begin); + return count; } - private void TimerElapsed(object sender, ElapsedEventArgs e) - { - // Get the next NMEA string and append return and newline characters to it. - string nmeaString = $"{_nmeaStrings[_lineCounter]}\r\n"; + public override bool CanRead => true; - NmeaMessageChanged?.Invoke(this, new NmeaMessageEventArgs { NmeaMessage = nmeaString }); + public override bool CanSeek => false; - // Check if the start of a new location message. - if (nmeaString.StartsWith("$GPGGA")) - { - // Flush any existing NMEA data from the stream. - MessageStream.Flush(); - } + public override bool CanWrite => false; - // Write the string to the stream. - byte[] data = System.Text.Encoding.UTF8.GetBytes(nmeaString); - MessageStream.Write(data, 0, data.Length); + public override long Length => -1; - // Increment the line counter. - _lineCounter = (_lineCounter + 1) % _nmeaStrings.Length; - } + public override long Position { get => _sr.BaseStream.Position; set => throw new NotImplementedException(); } - public void Dispose() - { - // Dispose of the timer and stream. - _timer.Stop(); - _timer.Dispose(); - MessageStream.Dispose(); - } - } + public override void Flush() => throw new NotImplementedException(); - public class NmeaMessageEventArgs : EventArgs - { - public string NmeaMessage { get; set; } + public override long Seek(long offset, SeekOrigin origin) => throw new NotImplementedException(); + + public override void SetLength(long value) => throw new NotImplementedException(); + + public override void Write(byte[] buffer, int offset, int count) => throw new NotImplementedException(); + + #endregion } } \ No newline at end of file diff --git a/src/WPF/WPF.Viewer/Samples/Location/LocationWithNMEA/LocationWithNMEA.xaml.cs b/src/WPF/WPF.Viewer/Samples/Location/LocationWithNMEA/LocationWithNMEA.xaml.cs index af79100b80..d4c3532fd8 100644 --- a/src/WPF/WPF.Viewer/Samples/Location/LocationWithNMEA/LocationWithNMEA.xaml.cs +++ b/src/WPF/WPF.Viewer/Samples/Location/LocationWithNMEA/LocationWithNMEA.xaml.cs @@ -16,6 +16,8 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Text; +using System.Threading; using System.Threading.Tasks; using System.Timers; using System.Windows; @@ -33,15 +35,13 @@ public partial class LocationWithNMEA { private NmeaLocationDataSource _nmeaSource; - private NMEAStreamSimulator _simulatedNMEADataSource; - public LocationWithNMEA() { InitializeComponent(); - _ = Initialize(); + Initialize(); } - private async Task Initialize() + private void Initialize() { // Add event handler for when this sample is unloaded. Unloaded += SampleUnloaded; @@ -51,40 +51,27 @@ private async Task Initialize() MyMapView.SetViewpoint(new Viewpoint(new MapPoint(-117.191, 34.0306, SpatialReferences.Wgs84), 100000)); // Create the data simulation using stored mock data. - _simulatedNMEADataSource = new NMEAStreamSimulator(6.0); - _simulatedNMEADataSource.NmeaMessageChanged += UpdateNmeaMessageLabel; + string nmeaMockDataPath = DataManager.GetDataFolder("d5bad9f4fee9483791e405880fb466da", "Redlands.nmea"); // Create the NMEA data source. - _nmeaSource = new NmeaLocationDataSource(SpatialReferences.Wgs84); + _nmeaSource = NmeaLocationDataSource.FromStreamCreator((datasource) => Task.FromResult(new SimulatedNmeaStream(nmeaMockDataPath))); // To create a NmeaLocationDataSource for a bluetooth device, use the `FromBluetooth` constructor. https://developers.arcgis.com/net/api-reference/api/netwin/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Location.NmeaLocationDataSource.FromBluetooth.html // To create a NmeaLocationDataSource from a serial port, use the `FromSerialPort` constructor. https://developers.arcgis.com/net/api-reference/api/netwin/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Location.NmeaLocationDataSource.FromSerialPort.html - // Set the location data source to use the stream from the simulator. - Stream messageStream = _simulatedNMEADataSource.MessageStream; - _nmeaSource.NmeaDataStream = messageStream; - // Create an event handler to update the UI when the location changes. _nmeaSource.SatellitesChanged += SatellitesChanged; _nmeaSource.LocationChanged += LocationChanged; + _nmeaSource.SentenceReceived += UpdateNmeaMessageLabel; - // Start the location data source. - try - { - MyMapView.LocationDisplay.DataSource = _nmeaSource; - await _nmeaSource.StartAsync(); - } - catch (Exception ex) - { - MessageBox.Show(ex.Message, ex.Message.GetType().Name, MessageBoxButton.OK, MessageBoxImage.Error); - } + MyMapView.LocationDisplay.DataSource = _nmeaSource; } - private void UpdateNmeaMessageLabel(object sender, NmeaMessageEventArgs e) + private void UpdateNmeaMessageLabel(object sender, string message) { - Dispatcher.BeginInvoke(new Action(() => + if (message.StartsWith("$GPRMC")) // Display the latest RMC message { - NmeaMessageLabel.Content = e.NmeaMessage; - })); + Dispatcher.BeginInvoke(new Action(() => NmeaMessageLabel.Content = message )); + } } private void SatellitesChanged(object sender, IReadOnlyList infos) @@ -122,14 +109,13 @@ private void LocationChanged(object sender, Location loc) private void StartClick(object sender, RoutedEventArgs e) { - _simulatedNMEADataSource.Start(); + _nmeaSource.StartAsync(); AccuracyLabel.Content = string.Empty; } private void ResetClick(object sender, RoutedEventArgs e) { - _simulatedNMEADataSource.Stop(); - _simulatedNMEADataSource.Reset(); + _nmeaSource.StopAsync(); // Reset the labels. AccuracyLabel.Content = "Simulation reset."; @@ -143,92 +129,99 @@ private void SampleUnloaded(object sender, RoutedEventArgs e) { // Stop the location data source. MyMapView.LocationDisplay?.DataSource?.StopAsync(); - _simulatedNMEADataSource?.Dispose(); } } /* * This class uses mock data (an edited recording of a real NMEA data stream) to simulate live NMEA data and create a stream. * For NMEA location data sources created from a Bluetooth device or serial input, you may not need to create your own stream. - * For any other case, you can write the data to a memory stream like below. + * For any other case, you can simulate the datastream from a file like below */ - public class NMEAStreamSimulator : IDisposable + public class SimulatedNmeaStream : Stream { - private Timer _timer; - - public Stream MessageStream; - - private int _lineCounter = 0; + // The default interval in milliseconds between bursts of NMEA data. private const int DefaultInterval = 1000; - private string[] _nmeaStrings; + private readonly System.Timers.Timer _timer; - public event EventHandler NmeaMessageChanged; + private readonly StreamReader _sr; - public NMEAStreamSimulator(double speed = 1.0) - { - _timer = new Timer(DefaultInterval / speed); + private int _pendingBursts = 0; + public SimulatedNmeaStream(string file) + { // Populate an array with all of the mock NMEA data. - string nmeaMockDataPath = DataManager.GetDataFolder("d5bad9f4fee9483791e405880fb466da", "Redlands.nmea"); - _nmeaStrings = File.ReadAllText(nmeaMockDataPath).Split('\n'); - - // Create a data stream for the `NmeaLocationDataSource` to use. - MessageStream = new MemoryStream(); - + _sr = new StreamReader(file); + _timer = new System.Timers.Timer(DefaultInterval); _timer.Elapsed += TimerElapsed; - } - - public void Start() - { _timer.Start(); } - public void Stop() + private void TimerElapsed(object sender, ElapsedEventArgs e) => _pendingBursts++; + + protected override void Dispose(bool disposing) { - _timer.Stop(); + if (disposing) + { + // Dispose of the timer and stream. + _timer.Stop(); + _timer.Dispose(); + _sr.Dispose(); + } + base.Dispose(disposing); } - public void Reset() + #region Implementation of a custom System.IO.Stream + + public override int Read(byte[] buffer, int offset, int count) { - _timer.Stop(); - _lineCounter = 0; + if (_pendingBursts == 0) + // Nothing in the buffer to read. + return 0; + + // Read all the pending bursts of data until we fill up the buffer. + var start = _sr.BaseStream.Position; + StringBuilder sb = new StringBuilder(); + while (sb.Length < count && !_sr.EndOfStream && _pendingBursts > 0) + { + string line = _sr.ReadLine(); + // In this sample we pause the burst of messages for each GGA message to simulate the break in the nmea stream on a receiver. + if (line.StartsWith("$GPGGA,") && Interlocked.Decrement(ref _pendingBursts) == 0) + { + break; + } + sb.AppendLine(line); + } + + if (sb.Length == 0) + return 0; + byte[] data = System.Text.Encoding.UTF8.GetBytes(sb.ToString()); + count = Math.Min(count, data.Length); + Array.Copy(data, 0, buffer, offset, count); + // Move the stream position forward only the amount of data we read. + _sr.BaseStream.Seek(start + count, SeekOrigin.Begin); + return count; } - private void TimerElapsed(object sender, ElapsedEventArgs e) - { - // Get the next NMEA string and append return and newline characters to it. - string nmeaString = $"{_nmeaStrings[_lineCounter]}\r\n"; + public override bool CanRead => true; - NmeaMessageChanged?.Invoke(this, new NmeaMessageEventArgs { NmeaMessage = nmeaString }); + public override bool CanSeek => false; - // Check if the start of a new location message. - if (nmeaString.StartsWith("$GPGGA")) - { - // Flush any existing NMEA data from the stream. - MessageStream.Flush(); - } + public override bool CanWrite => false; - // Write the string to the stream. - byte[] data = System.Text.Encoding.UTF8.GetBytes(nmeaString); - MessageStream.Write(data, 0, data.Length); + public override long Length => -1; - // Increment the line counter. - _lineCounter = (_lineCounter + 1) % _nmeaStrings.Length; - } + public override long Position { get => _sr.BaseStream.Position; set => throw new NotImplementedException(); } - public void Dispose() - { - // Dispose of the timer and stream. - _timer.Stop(); - _timer.Dispose(); - MessageStream.Dispose(); - } - } + public override void Flush() => throw new NotImplementedException(); - public class NmeaMessageEventArgs : EventArgs - { - public string NmeaMessage { get; set; } + public override long Seek(long offset, SeekOrigin origin) => throw new NotImplementedException(); + + public override void SetLength(long value) => throw new NotImplementedException(); + + public override void Write(byte[] buffer, int offset, int count) => throw new NotImplementedException(); + + #endregion } } \ No newline at end of file diff --git a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Location/LocationWithNMEA/LocationWithNMEA.xaml.cs b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Location/LocationWithNMEA/LocationWithNMEA.xaml.cs index 7e2e875535..7a5dc0a2bf 100644 --- a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Location/LocationWithNMEA/LocationWithNMEA.xaml.cs +++ b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/Location/LocationWithNMEA/LocationWithNMEA.xaml.cs @@ -18,6 +18,8 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Text; +using System.Threading; using System.Threading.Tasks; using System.Timers; @@ -34,55 +36,40 @@ public partial class LocationWithNMEA : IDisposable { private NmeaLocationDataSource _nmeaSource; - private NMEAStreamSimulator _simulatedNMEADataSource; - public LocationWithNMEA() { InitializeComponent(); - _ = Initialize(); + Initialize(); } - private async Task Initialize() + private void Initialize() { // Create the map. MyMapView.Map = new Map(BasemapStyle.ArcGISNavigation); MyMapView.SetViewpoint(new Viewpoint(new MapPoint(-117.191, 34.0306, SpatialReferences.Wgs84), 100000)); // Create the data simulation using stored mock data. - _simulatedNMEADataSource = new NMEAStreamSimulator(6.0); - _simulatedNMEADataSource.NmeaMessageChanged += UpdateNmeaMessageLabel; + string nmeaMockDataPath = DataManager.GetDataFolder("d5bad9f4fee9483791e405880fb466da", "Redlands.nmea"); // Create the NMEA data source. - _nmeaSource = new NmeaLocationDataSource(SpatialReferences.Wgs84); + _nmeaSource = NmeaLocationDataSource.FromStreamCreator((datasource) => Task.FromResult(new SimulatedNmeaStream(nmeaMockDataPath))); // To create a NmeaLocationDataSource for a bluetooth device, use the `FromBluetooth` constructor. https://developers.arcgis.com/net/api-reference/api/uwp/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Location.NmeaLocationDataSource.FromBluetooth.html // To create a NmeaLocationDataSource from a serial port, use the `FromSerialPort` constructor. https://developers.arcgis.com/net/api-reference/api/uwp/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Location.NmeaLocationDataSource.FromSerialPort.html - // Set the location data source to use the stream from the simulator. - Stream messageStream = _simulatedNMEADataSource.MessageStream; - _nmeaSource.NmeaDataStream = messageStream; - // Create an event handler to update the UI when the location changes. _nmeaSource.SatellitesChanged += SatellitesChanged; _nmeaSource.LocationChanged += LocationChanged; + _nmeaSource.SentenceReceived += UpdateNmeaMessageLabel; - // Start the location data source. - try - { - MyMapView.LocationDisplay.DataSource = _nmeaSource; - await _nmeaSource.StartAsync(); - } - catch (Exception ex) - { - await new MessageDialog2(ex.Message, ex.Message.GetType().Name).ShowAsync(); - } + MyMapView.LocationDisplay.DataSource = _nmeaSource; } - private void UpdateNmeaMessageLabel(object sender, NmeaMessageEventArgs e) + private void UpdateNmeaMessageLabel(object sender, string message) { - DispatcherQueue.TryEnqueue(DispatcherQueuePriority.Normal, () => + if (message.StartsWith("$GPRMC")) // Display the latest RMC message { - NmeaMessageLabel.Text = e.NmeaMessage; - }); + DispatcherQueue.TryEnqueue(DispatcherQueuePriority.Normal, () => NmeaMessageLabel.Text = message); + } } private void SatellitesChanged(object sender, IReadOnlyList infos) @@ -120,14 +107,13 @@ private void LocationChanged(object sender, Location loc) private void StartClick(object sender, RoutedEventArgs e) { - _simulatedNMEADataSource.Start(); + _nmeaSource.StartAsync(); AccuracyLabel.Text = string.Empty; } private void ResetClick(object sender, RoutedEventArgs e) { - _simulatedNMEADataSource.Stop(); - _simulatedNMEADataSource.Reset(); + _nmeaSource.StopAsync(); // Reset the labels. AccuracyLabel.Text = "Simulation reset."; @@ -141,92 +127,99 @@ public void Dispose() { // Stop the location data source. MyMapView.LocationDisplay?.DataSource?.StopAsync(); - _simulatedNMEADataSource?.Dispose(); } } /* * This class uses mock data (an edited recording of a real NMEA data stream) to simulate live NMEA data and create a stream. * For NMEA location data sources created from a Bluetooth device or serial input, you may not need to create your own stream. - * For any other case, you can write the data to a memory stream like below. + * For any other case, you can simulate the datastream from a file like below */ - public class NMEAStreamSimulator : IDisposable + public class SimulatedNmeaStream : Stream { - private Timer _timer; - - public Stream MessageStream; - - private int _lineCounter = 0; + // The default interval in milliseconds between bursts of NMEA data. private const int DefaultInterval = 1000; - private string[] _nmeaStrings; + private readonly System.Timers.Timer _timer; - public event EventHandler NmeaMessageChanged; + private readonly StreamReader _sr; - public NMEAStreamSimulator(double speed = 1.0) - { - _timer = new Timer(DefaultInterval / speed); + private int _pendingBursts = 0; + public SimulatedNmeaStream(string file) + { // Populate an array with all of the mock NMEA data. - string nmeaMockDataPath = DataManager.GetDataFolder("d5bad9f4fee9483791e405880fb466da", "Redlands.nmea"); - _nmeaStrings = File.ReadAllText(nmeaMockDataPath).Split('\n'); - - // Create a data stream for the `NmeaLocationDataSource` to use. - MessageStream = new MemoryStream(); - + _sr = new StreamReader(file); + _timer = new System.Timers.Timer(DefaultInterval); _timer.Elapsed += TimerElapsed; - } - - public void Start() - { _timer.Start(); } - public void Stop() + private void TimerElapsed(object sender, ElapsedEventArgs e) => Interlocked.Increment(ref _pendingBursts); + + protected override void Dispose(bool disposing) { - _timer.Stop(); + if (disposing) + { + // Dispose of the timer and stream. + _timer.Stop(); + _timer.Dispose(); + _sr.Dispose(); + } + base.Dispose(disposing); } - public void Reset() + #region Implementation of a custom System.IO.Stream + + public override int Read(byte[] buffer, int offset, int count) { - _timer.Stop(); - _lineCounter = 0; + if (_pendingBursts == 0) + // Nothing in the buffer to read. + return 0; + + // Read all the pending bursts of data until we fill up the buffer. + var start = _sr.BaseStream.Position; + StringBuilder sb = new StringBuilder(); + while (sb.Length < count && !_sr.EndOfStream && _pendingBursts > 0) + { + string line = _sr.ReadLine(); + // In this sample we pause the burst of messages for each GGA message to simulate the break in the nmea stream on a receiver. + if (line.StartsWith("$GPGGA,") && Interlocked.Decrement(ref _pendingBursts) == 0) + { + break; + } + sb.AppendLine(line); + } + + if (sb.Length == 0) + return 0; + byte[] data = System.Text.Encoding.UTF8.GetBytes(sb.ToString()); + count = Math.Min(count, data.Length); + Array.Copy(data, 0, buffer, offset, count); + // Move the stream position forward only the amount of data we read. + _sr.BaseStream.Seek(start + count, SeekOrigin.Begin); + return count; } - private void TimerElapsed(object sender, ElapsedEventArgs e) - { - // Get the next NMEA string and append return and newline characters to it. - string nmeaString = $"{_nmeaStrings[_lineCounter]}\r\n"; + public override bool CanRead => true; - NmeaMessageChanged?.Invoke(this, new NmeaMessageEventArgs { NmeaMessage = nmeaString }); + public override bool CanSeek => false; - // Check if the start of a new location message. - if (nmeaString.StartsWith("$GPGGA")) - { - // Flush any existing NMEA data from the stream. - MessageStream.Flush(); - } + public override bool CanWrite => false; - // Write the string to the stream. - byte[] data = System.Text.Encoding.UTF8.GetBytes(nmeaString); - MessageStream.Write(data, 0, data.Length); + public override long Length => -1; - // Increment the line counter. - _lineCounter = (_lineCounter + 1) % _nmeaStrings.Length; - } + public override long Position { get => _sr.BaseStream.Position; set => throw new NotImplementedException(); } - public void Dispose() - { - // Dispose of the timer and stream. - _timer.Stop(); - _timer.Dispose(); - MessageStream.Dispose(); - } - } + public override void Flush() => throw new NotImplementedException(); - public class NmeaMessageEventArgs : EventArgs - { - public string NmeaMessage { get; set; } + public override long Seek(long offset, SeekOrigin origin) => throw new NotImplementedException(); + + public override void SetLength(long value) => throw new NotImplementedException(); + + public override void Write(byte[] buffer, int offset, int count) => throw new NotImplementedException(); + + #endregion } } \ No newline at end of file From 9eeaf7111d26169371ff8c2552b3a4c38f5db00b Mon Sep 17 00:00:00 2001 From: Praveenaa Kulandhaivel Date: Wed, 3 Sep 2025 13:12:02 -0700 Subject: [PATCH 02/45] Replace deprecated portal items in NavigateRouteRerouting and OfflineRouting samples (#1655) --- .../NavigateRouteRerouting/NavigateRouteRerouting.xaml.cs | 4 ++-- .../NetworkAnalysis/NavigateRouteRerouting/readme.md | 2 +- .../NavigateRouteRerouting/readme.metadata.json | 2 +- .../NetworkAnalysis/OfflineRouting/OfflineRouting.xaml.cs | 6 +++--- .../Samples/NetworkAnalysis/OfflineRouting/readme.md | 2 +- .../NetworkAnalysis/OfflineRouting/readme.metadata.json | 2 +- .../NavigateRouteRerouting/NavigateRouteRerouting.xaml.cs | 4 ++-- .../NetworkAnalysis/NavigateRouteRerouting/readme.md | 2 +- .../NavigateRouteRerouting/readme.metadata.json | 2 +- .../NetworkAnalysis/OfflineRouting/OfflineRouting.xaml.cs | 6 +++--- .../Samples/NetworkAnalysis/OfflineRouting/readme.md | 2 +- .../NetworkAnalysis/OfflineRouting/readme.metadata.json | 2 +- .../NavigateRouteRerouting/NavigateRouteRerouting.xaml.cs | 4 ++-- .../NetworkAnalysis/NavigateRouteRerouting/readme.md | 2 +- .../NavigateRouteRerouting/readme.metadata.json | 2 +- .../NetworkAnalysis/OfflineRouting/OfflineRouting.xaml.cs | 6 +++--- .../Samples/NetworkAnalysis/OfflineRouting/readme.md | 2 +- .../NetworkAnalysis/OfflineRouting/readme.metadata.json | 2 +- 18 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/NavigateRouteRerouting/NavigateRouteRerouting.xaml.cs b/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/NavigateRouteRerouting/NavigateRouteRerouting.xaml.cs index 785733737f..d893b29a8f 100644 --- a/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/NavigateRouteRerouting/NavigateRouteRerouting.xaml.cs +++ b/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/NavigateRouteRerouting/NavigateRouteRerouting.xaml.cs @@ -27,7 +27,7 @@ namespace ArcGIS.Samples.NavigateRouteRerouting description: "Navigate between two points and dynamically recalculate an alternate route when the original route is unavailable.", instructions: "Tap 'Navigate' to simulate traveling and to receive directions from a preset starting point to a preset destination. Observe how the route is recalculated when the simulation does not follow the suggested route. Tap 'Recenter' to refocus on the location display.", tags: new[] { "directions", "maneuver", "navigation", "route", "turn-by-turn", "voice" })] - [ArcGIS.Samples.Shared.Attributes.OfflineData("567e14f3420d40c5a206e5c0284cf8fc")] + [ArcGIS.Samples.Shared.Attributes.OfflineData("df193653ed39449195af0c9725701dca")] public partial class NavigateRouteRerouting : ContentPage, IDisposable { // Variables for tracking the navigation route. @@ -57,7 +57,7 @@ public partial class NavigateRouteRerouting : ContentPage, IDisposable private readonly string _tourPolylineJSON = "{\"paths\":[[[ -117.160386727066026, 32.706608204740171 ], [ -117.160205336548898, 32.706508733108137 ], [ -117.16002394693011, 32.706409261365152 ], [ -117.159842556412997, 32.706309788755419 ], [ -117.159651667110055, 32.706216667017223 ], [ -117.159454444684357, 32.706127778166461 ], [ -117.159257222258688, 32.706038889227095 ], [ -117.159059999833019, 32.705950000199223 ], [ -117.158902856642044, 32.705835713852132 ], [ -117.158739999267553, 32.705720000231665 ], [ -117.158576363053726, 32.705604545733003 ], [ -117.158417272315205, 32.70549090901352 ], [ -117.158256250198832, 32.705376874547866 ], [ -117.158087499876075, 32.70526125028416 ], [ -117.157918750451643, 32.70514562511471 ], [ -117.1577500001289, 32.705029999795485 ], [ -117.157600000341063, 32.704940000101111 ], [ -117.157425000438906, 32.704823332883613 ], [ -117.157250000536706, 32.704706666269544 ], [ -117.15707875020253, 32.70459250003033 ], [ -117.156909999879787, 32.704480000413547 ], [ -117.156741250455326, 32.704367499899007 ], [ -117.156569643489959, 32.704254999998568 ], [ -117.156393750662403, 32.704142500712138 ], [ -117.156217857834818, 32.70403000128394 ], [ -117.156041965007248, 32.703917501713846 ], [ -117.155866072179691, 32.703805002001992 ], [ -117.155690179352078, 32.703692502148236 ], [ -117.155514286524522, 32.703580002152705 ], [ -117.155338393696923, 32.7034675020153 ], [ -117.155162499971055, 32.703355001736114 ], [ -117.154986607143471, 32.703242501315046 ], [ -117.154810714315886, 32.703130000752203 ], [ -117.154635517682649, 32.703016896826178 ], [ -117.154463104030171, 32.702901379868429 ], [ -117.154290690377692, 32.702785862761147 ], [ -117.154118275826903, 32.702670345504323 ], [ -117.153945862174425, 32.702554828097959 ], [ -117.153773448521946, 32.702439310542076 ], [ -117.153599428681744, 32.702323429238 ], [ -117.153423000458261, 32.702207001250933 ], [ -117.153246571336439, 32.702090573867849 ], [ -117.15307014311297, 32.701974145576926 ], [ -117.152893714889458, 32.701857717134175 ], [ -117.152717285767665, 32.701741289295413 ], [ -117.152540857544182, 32.701624860548854 ], [ -117.152364428422359, 32.701508432406285 ], [ -117.152188000198905, 32.701392003355934 ], [ -117.152011571077097, 32.701275574909566 ], [ -117.151835142853614, 32.701159145555422 ], [ -117.15165871463013, 32.701042716049322 ], [ -117.151482285508337, 32.70092628714734 ], [ -117.151305857284839, 32.700809857337454 ], [ -117.151133333139583, 32.700694999722828 ], [ -117.150966666009978, 32.700582500484039 ], [ -117.150799999778684, 32.700470000347529 ], [ -117.150666666434319, 32.700606666276805 ], [ -117.150550000431735, 32.700739999832187 ], [ -117.150413637069931, 32.700887727693875 ], [ -117.150277272809774, 32.701035455311022 ], [ -117.150140909447984, 32.701183182683579 ], [ -117.150004546086151, 32.70133090905572 ], [ -117.149866667266465, 32.701474445066133 ], [ -117.149727777842074, 32.701615186178799 ], [ -117.149588889315993, 32.701755927069449 ], [ -117.149449999891601, 32.701896667738154 ], [ -117.14931111046721, 32.702037408184886 ], [ -117.149171785359911, 32.702179286074646 ], [ -117.149030713927701, 32.702325715147047 ], [ -117.148889642495448, 32.702472143979179 ], [ -117.148748571063251, 32.702618572571104 ], [ -117.148607499631026, 32.702765000922703 ], [ -117.148466428198816, 32.702911428278099 ], [ -117.148324285076455, 32.703055714638857 ], [ -117.148181427793475, 32.703198572087189 ], [ -117.148038571408776, 32.703341429306768 ], [ -117.147895714125781, 32.703484287053563 ], [ -117.147752856842757, 32.703627143815801 ], [ -117.147609999559762, 32.70377000034928 ], [ -117.147775789035336, 32.703888421897091 ], [ -117.147941578510924, 32.704006842531832 ], [ -117.148107367986498, 32.704125263765263 ], [ -117.148270999708757, 32.704241999926992 ], [ -117.148426000417771, 32.704352000065626 ], [ -117.148584000601517, 32.704464000191109 ], [ -117.148754000480821, 32.704584000655537 ], [ -117.148924000360154, 32.704704000958593 ], [ -117.149094000239444, 32.704824001100256 ], [ -117.149264000118777, 32.704944000324637 ], [ -117.149407499697205, 32.705072500228539 ], [ -117.149343333036455, 32.705169047379755 ], [ -117.14912666657645, 32.705166666300379 ], [ -117.14891000011643, 32.705164285976849 ], [ -117.148693333656425, 32.705161904897288 ], [ -117.148478888730111, 32.70516111120412 ], [ -117.148273333531876, 32.705166666300379 ], [ -117.148064000019531, 32.705171999918136 ], [ -117.147848999934354, 32.705177000184506 ], [ -117.147633999849205, 32.705181999694666 ], [ -117.147418999764071, 32.705186999960468 ], [ -117.147200769337161, 32.705185384606324 ], [ -117.146977692499263, 32.705173846577395 ], [ -117.146754615661365, 32.70516230779107 ], [ -117.146708461120397, 32.705286154077442 ], [ -117.146700768846614, 32.705466923690707 ], [ -117.146693076572859, 32.705647692937767 ], [ -117.146683999995219, 32.705830000815943 ], [ -117.146673999949485, 32.706013334065815 ], [ -117.146663999903751, 32.706196666939007 ], [ -117.146664285567994, 32.70638142881964 ], [ -117.146671428072821, 32.706567143490375 ], [ -117.146678571475945, 32.706752857018657 ], [ -117.146740000071702, 32.706929999956024 ], [ -117.146814999516465, 32.707105000372742 ], [ -117.146889999859525, 32.707279999690257 ], [ -117.146924210400499, 32.70746421055955 ], [ -117.146958420941473, 32.707648421804457 ], [ -117.146992631482419, 32.707832631913085 ], [ -117.147028333226785, 32.708011666927277 ], [ -117.14706999978462, 32.708169999740647 ], [ -117.147123125252193, 32.708315313142343 ], [ -117.147188749878651, 32.708491876248765 ], [ -117.147254375403406, 32.70866843900572 ], [ -117.147320000029879, 32.708845002169127 ], [ -117.14738562465628, 32.709021564227307 ], [ -117.147451250181092, 32.709198125936041 ], [ -117.147516874807508, 32.709374687295316 ], [ -117.14752833371729, 32.709551667052253 ], [ -117.147520000046384, 32.709710000156058 ], [ -117.147520000046384, 32.709893333747829 ], [ -117.147520000046384, 32.710076666962848 ], [ -117.147520000046384, 32.71026200054947 ], [ -117.147520000046384, 32.710448667076598 ], [ -117.147520000046384, 32.710635333213204 ], [ -117.147515909118582, 32.710823182620821 ], [ -117.147509090905601, 32.71101181922716 ], [ -117.147502272692577, 32.711200455434678 ], [ -117.147495454479568, 32.711389091999187 ], [ -117.147485142718423, 32.71157742885061 ], [ -117.14746085676471, 32.711764573341057 ], [ -117.147436571709335, 32.711951716683039 ], [ -117.147412285755621, 32.712138859632439 ], [ -117.147387999801936, 32.712326002189215 ], [ -117.147363713848208, 32.712513145109241 ], [ -117.147339428792819, 32.712700286880825 ], [ -117.147316521753055, 32.712886522016262 ], [ -117.147299130369177, 32.713069131040328 ], [ -117.147281738985257, 32.71325173969052 ], [ -117.147264347601379, 32.713434348722721 ], [ -117.147246956217472, 32.713616956625302 ], [ -117.147232058556796, 32.713802941936294 ], [ -117.147218823677719, 32.713991177701793 ], [ -117.147205587900316, 32.714179413825953 ], [ -117.147192353021239, 32.71436764955282 ], [ -117.147179117243851, 32.714555884126625 ], [ -117.147165882364774, 32.714744119059084 ], [ -117.147152647485697, 32.714932352838417 ], [ -117.147153636530803, 32.715120909708922 ], [ -117.147158182006137, 32.715309546296893 ], [ -117.147162727481486, 32.715498182485916 ], [ -117.147167272956835, 32.715686818275991 ], [ -117.147173404856957, 32.715875319889243 ], [ -117.147181915495963, 32.716063619303895 ], [ -117.147190425236644, 32.716251918321021 ], [ -117.14719893587565, 32.716440216940612 ], [ -117.147207446514642, 32.716628515162668 ], [ -117.147215957153648, 32.716816812987197 ], [ -117.147224467792654, 32.717005110414192 ], [ -117.147232978431632, 32.717193407443645 ], [ -117.147241489070623, 32.717381704075564 ], [ -117.147249999709629, 32.717570000309962 ], [ -117.147249999709629, 32.717738750619532 ], [ -117.147332500087032, 32.717837500042386 ], [ -117.147538750581333, 32.717831250407393 ], [ -117.147756000047934, 32.717830000329201 ], [ -117.147976000155978, 32.717833999974772 ], [ -117.148195999365697, 32.717839000287256 ], [ -117.148399999580192, 32.717848889054309 ], [ -117.148599999596726, 32.717859999933836 ], [ -117.148792857108432, 32.717859999933836 ], [ -117.149002857170714, 32.717855714600553 ], [ -117.149221110953832, 32.717848889054309 ], [ -117.149426667050406, 32.717843333236125 ], [ -117.149629999816653, 32.717840000198528 ], [ -117.149834794141881, 32.717839725846488 ], [ -117.150058766600068, 32.717838356353404 ], [ -117.150282739058298, 32.717836986104565 ], [ -117.150506712414838, 32.717835616611495 ], [ -117.150730684873039, 32.717834246362614 ], [ -117.150954657331255, 32.717832876869451 ], [ -117.151178629789484, 32.71783150662052 ], [ -117.151402602247686, 32.717830137127372 ], [ -117.151626575604226, 32.717828766878398 ], [ -117.151850548062413, 32.717827397385207 ], [ -117.152074520520642, 32.717826027136198 ], [ -117.152298492978844, 32.717824657642915 ], [ -117.152522466335384, 32.717823287393841 ], [ -117.152746438793599, 32.717821917900579 ], [ -117.1529704112518, 32.717820547651478 ], [ -117.153186000631806, 32.717819999702947 ], [ -117.153393000321032, 32.717819999702947 ], [ -117.153598000360432, 32.717819999702947 ], [ -117.153680000376198, 32.717931250560419 ], [ -117.153680000376198, 32.718116667591957 ], [ -117.153680000376198, 32.71830208423809 ], [ -117.153680000376198, 32.718487500498668 ], [ -117.153680000376198, 32.71867291637377 ], [ -117.153680000376198, 32.718853999719613 ], [ -117.153691764713159, 32.719040589315924 ], [ -117.153706471032677, 32.719228825364496 ], [ -117.153721176453885, 32.719417061015754 ], [ -117.153735882773404, 32.719605296269705 ], [ -117.153750588194583, 32.719793531126342 ], [ -117.153765294514116, 32.719981765585658 ], [ -117.153779999935324, 32.720169999647716 ], [ -117.153724444524883, 32.720347777996373 ], [ -117.15365916664814, 32.720522916848374 ], [ -117.153554999804427, 32.720687501074849 ], [ -117.153450833859011, 32.720852084241734 ], [ -117.153346667015299, 32.721016667104912 ], [ -117.153242500171572, 32.721181250420067 ], [ -117.153129999656983, 32.721337142933685 ], [ -117.153004999983494, 32.721480000582972 ], [ -117.152880000310034, 32.721622857247624 ], [ -117.152759999761116, 32.72175500006324 ], [ -117.152636666462485, 32.721883333669965 ], [ -117.152503333118148, 32.722016666414483 ], [ -117.152369999773768, 32.722149999715342 ], [ -117.152266296460738, 32.722315741775319 ], [ -117.152162592249397, 32.722481484282923 ], [ -117.152058888936367, 32.722647225726703 ], [ -117.15195518472504, 32.722812966862485 ], [ -117.151851481411995, 32.722978708445886 ], [ -117.151747778098965, 32.723144448965456 ], [ -117.151644073887638, 32.723310189177035 ], [ -117.151540370574594, 32.723475929836226 ], [ -117.151436666363239, 32.723641669431601 ], [ -117.151332963050237, 32.723807408718947 ], [ -117.151234999971862, 32.72397250002998 ], [ -117.151160000527099, 32.724135000367234 ], [ -117.151080000161144, 32.724297500408319 ], [ -117.150996667045533, 32.724460000153258 ], [ -117.150913333929878, 32.724623889395701 ], [ -117.150829999915885, 32.724793333722438 ], [ -117.150746666800273, 32.724962778482904 ], [ -117.150663333684619, 32.725132222165605 ], [ -117.150569142632122, 32.725297714582261 ], [ -117.150467713853416, 32.725460572230027 ], [ -117.150366285972964, 32.725623430335979 ], [ -117.150264857194259, 32.7257862873888 ], [ -117.150163428415524, 32.725949144144138 ], [ -117.150062000535129, 32.726112000602008 ], [ -117.149960571756395, 32.726274857518128 ], [ -117.149810286304302, 32.726402571732081 ], [ -117.149627428838329, 32.726506857771184 ], [ -117.149444571372356, 32.726611143688253 ], [ -117.149261713906355, 32.726715429483335 ], [ -117.149078857338722, 32.726819715156495 ], [ -117.148895999872721, 32.726924000707605 ], [ -117.148713142406748, 32.727028286136743 ], [ -117.148527500163411, 32.727107499935954 ], [ -117.148341999853869, 32.727179999922392 ], [ -117.148156999905936, 32.727254999741994 ], [ -117.147970000308177, 32.727333332937185 ], [ -117.147782499450514, 32.727412499611347 ], [ -117.147604782144612, 32.727511304068443 ], [ -117.147441738818856, 32.727639565155108 ], [ -117.1472786954931, 32.727767826057253 ], [ -117.147115652167315, 32.727896086774876 ], [ -117.146952608841573, 32.728024347307972 ], [ -117.14683238101891, 32.728179524297857 ], [ -117.146722856622844, 32.728341429031481 ], [ -117.14661333312506, 32.728503334226737 ], [ -117.146503809627319, 32.728665238372294 ], [ -117.146433750018303, 32.728838750495896 ], [ -117.146389999369021, 32.729020001365825 ], [ -117.146346249618063, 32.72920125111154 ], [ -117.146302499867119, 32.729382501244444 ], [ -117.146258749217793, 32.729563750253142 ], [ -117.146400000313093, 32.729589999948736 ], [ -117.146600000329613, 32.729668571401881 ], [ -117.146679999797271, 32.729808571287677 ], [ -117.146679999797271, 32.729989523956149 ], [ -117.146679999797271, 32.730170477013012 ], [ -117.146679999797271, 32.730351428946854 ]]],\"spatialReference\":{\"wkid\":4326,\"latestWkid\":4326}}"; // Path to the network geodatabase for San Diego. - private readonly string _networkGeodatabasePath = DataManager.GetDataFolder("567e14f3420d40c5a206e5c0284cf8fc", "sandiego.geodatabase"); + private readonly string _networkGeodatabasePath = DataManager.GetDataFolder("df193653ed39449195af0c9725701dca", "sandiego.geodatabase"); public NavigateRouteRerouting() { diff --git a/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.md b/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.md index 62c494dea0..30dc9eb4a4 100644 --- a/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.md +++ b/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.md @@ -43,7 +43,7 @@ Tap 'Navigate' to simulate traveling and to receive directions from a preset sta ## Offline data -A geodatabase contains a road network for San Diego. [San Diego Geodatabase](https://arcgisruntime.maps.arcgis.com/home/item.html?id=567e14f3420d40c5a206e5c0284cf8fc) +A geodatabase contains a road network for San Diego. [San Diego Geodatabase](https://arcgisruntime.maps.arcgis.com/home/item.html?id=df193653ed39449195af0c9725701dca) ## About the data diff --git a/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.metadata.json b/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.metadata.json index 15ebcaebab..e36814e22f 100644 --- a/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.metadata.json +++ b/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.metadata.json @@ -15,7 +15,7 @@ "voice" ], "offline_data": [ - "567e14f3420d40c5a206e5c0284cf8fc" + "df193653ed39449195af0c9725701dca" ], "redirect_from": [ "/net/latest/maui/sample-code/navigate-route-with-rerouting.htm" diff --git a/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/OfflineRouting/OfflineRouting.xaml.cs b/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/OfflineRouting/OfflineRouting.xaml.cs index ac28d1c68a..4c1fe15c6d 100644 --- a/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/OfflineRouting/OfflineRouting.xaml.cs +++ b/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/OfflineRouting/OfflineRouting.xaml.cs @@ -25,7 +25,7 @@ namespace ArcGIS.Samples.OfflineRouting description: "Solve a route on-the-fly using offline data.", instructions: "Tap near a road to start adding a stop to the route, tap again to place it on the map. A number graphic will show its order in the route. After adding at least 2 stops, a route will display. Choose \"Fastest\" or \"Shortest\" to control how the route is optimized. The route will update on-the-fly while moving stops. The green box marks the boundary of the routable area provided by the offline data. This sample limits routes to 5 stops for performance reasons.", tags: new[] { "connectivity", "disconnected", "fastest", "locator", "navigation", "network analysis", "offline", "routing", "shortest", "turn-by-turn" })] - [ArcGIS.Samples.Shared.Attributes.OfflineData("567e14f3420d40c5a206e5c0284cf8fc")] + [ArcGIS.Samples.Shared.Attributes.OfflineData("df193653ed39449195af0c9725701dca")] public partial class OfflineRouting : ContentPage { // Graphics overlays for holding graphics. @@ -54,8 +54,8 @@ private async Task Initialize() try { // Get the paths to resources used by the sample. - string basemapTilePath = DataManager.GetDataFolder("567e14f3420d40c5a206e5c0284cf8fc", "streetmap_SD.tpkx"); - string networkGeodatabasePath = DataManager.GetDataFolder("567e14f3420d40c5a206e5c0284cf8fc", "sandiego.geodatabase"); + string basemapTilePath = DataManager.GetDataFolder("df193653ed39449195af0c9725701dca", "streetmap_SD.tpkx"); + string networkGeodatabasePath = DataManager.GetDataFolder("df193653ed39449195af0c9725701dca", "sandiego.geodatabase"); // Create the tile cache representing the offline basemap. TileCache tiledBasemapCache = new TileCache(basemapTilePath); diff --git a/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/OfflineRouting/readme.md b/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/OfflineRouting/readme.md index 5530cb600a..cb87531965 100644 --- a/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/OfflineRouting/readme.md +++ b/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/OfflineRouting/readme.md @@ -31,7 +31,7 @@ Tap near a road to start adding a stop to the route, tap again to place it on th ## Offline data -The data used by this sample is available on [ArcGIS Online](https://arcgisruntime.maps.arcgis.com/home/item.html?id=567e14f3420d40c5a206e5c0284cf8fc). +The data used by this sample is available on [ArcGIS Online](https://arcgisruntime.maps.arcgis.com/home/item.html?id=df193653ed39449195af0c9725701dca). ## About the data diff --git a/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/OfflineRouting/readme.metadata.json b/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/OfflineRouting/readme.metadata.json index 0d55e70eb0..67a8c4aeea 100644 --- a/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/OfflineRouting/readme.metadata.json +++ b/src/MAUI/Maui.Samples/Samples/NetworkAnalysis/OfflineRouting/readme.metadata.json @@ -19,7 +19,7 @@ "turn-by-turn" ], "offline_data": [ - "567e14f3420d40c5a206e5c0284cf8fc" + "df193653ed39449195af0c9725701dca" ], "redirect_from": [ "/net/latest/maui/sample-code/offline-routing.htm" diff --git a/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/NavigateRouteRerouting.xaml.cs b/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/NavigateRouteRerouting.xaml.cs index 4590f8a2ca..d090b2ed47 100644 --- a/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/NavigateRouteRerouting.xaml.cs +++ b/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/NavigateRouteRerouting.xaml.cs @@ -30,7 +30,7 @@ namespace ArcGIS.WPF.Samples.NavigateRouteRerouting description: "Navigate between two points and dynamically recalculate an alternate route when the original route is unavailable.", instructions: "Click 'Navigate' to simulate traveling and to receive directions from a preset starting point to a preset destination. Observe how the route is recalculated when the simulation does not follow the suggested route. Click 'Recenter' to refocus on the location display.", tags: new[] { "directions", "maneuver", "navigation", "route", "turn-by-turn", "voice" })] - [ArcGIS.Samples.Shared.Attributes.OfflineData("567e14f3420d40c5a206e5c0284cf8fc")] + [ArcGIS.Samples.Shared.Attributes.OfflineData("df193653ed39449195af0c9725701dca")] public partial class NavigateRouteRerouting { // Variables for tracking the navigation route. @@ -60,7 +60,7 @@ public partial class NavigateRouteRerouting private readonly string _tourPolylineJSON = "{\"paths\":[[[ -117.160386727066026, 32.706608204740171 ], [ -117.160205336548898, 32.706508733108137 ], [ -117.16002394693011, 32.706409261365152 ], [ -117.159842556412997, 32.706309788755419 ], [ -117.159651667110055, 32.706216667017223 ], [ -117.159454444684357, 32.706127778166461 ], [ -117.159257222258688, 32.706038889227095 ], [ -117.159059999833019, 32.705950000199223 ], [ -117.158902856642044, 32.705835713852132 ], [ -117.158739999267553, 32.705720000231665 ], [ -117.158576363053726, 32.705604545733003 ], [ -117.158417272315205, 32.70549090901352 ], [ -117.158256250198832, 32.705376874547866 ], [ -117.158087499876075, 32.70526125028416 ], [ -117.157918750451643, 32.70514562511471 ], [ -117.1577500001289, 32.705029999795485 ], [ -117.157600000341063, 32.704940000101111 ], [ -117.157425000438906, 32.704823332883613 ], [ -117.157250000536706, 32.704706666269544 ], [ -117.15707875020253, 32.70459250003033 ], [ -117.156909999879787, 32.704480000413547 ], [ -117.156741250455326, 32.704367499899007 ], [ -117.156569643489959, 32.704254999998568 ], [ -117.156393750662403, 32.704142500712138 ], [ -117.156217857834818, 32.70403000128394 ], [ -117.156041965007248, 32.703917501713846 ], [ -117.155866072179691, 32.703805002001992 ], [ -117.155690179352078, 32.703692502148236 ], [ -117.155514286524522, 32.703580002152705 ], [ -117.155338393696923, 32.7034675020153 ], [ -117.155162499971055, 32.703355001736114 ], [ -117.154986607143471, 32.703242501315046 ], [ -117.154810714315886, 32.703130000752203 ], [ -117.154635517682649, 32.703016896826178 ], [ -117.154463104030171, 32.702901379868429 ], [ -117.154290690377692, 32.702785862761147 ], [ -117.154118275826903, 32.702670345504323 ], [ -117.153945862174425, 32.702554828097959 ], [ -117.153773448521946, 32.702439310542076 ], [ -117.153599428681744, 32.702323429238 ], [ -117.153423000458261, 32.702207001250933 ], [ -117.153246571336439, 32.702090573867849 ], [ -117.15307014311297, 32.701974145576926 ], [ -117.152893714889458, 32.701857717134175 ], [ -117.152717285767665, 32.701741289295413 ], [ -117.152540857544182, 32.701624860548854 ], [ -117.152364428422359, 32.701508432406285 ], [ -117.152188000198905, 32.701392003355934 ], [ -117.152011571077097, 32.701275574909566 ], [ -117.151835142853614, 32.701159145555422 ], [ -117.15165871463013, 32.701042716049322 ], [ -117.151482285508337, 32.70092628714734 ], [ -117.151305857284839, 32.700809857337454 ], [ -117.151133333139583, 32.700694999722828 ], [ -117.150966666009978, 32.700582500484039 ], [ -117.150799999778684, 32.700470000347529 ], [ -117.150666666434319, 32.700606666276805 ], [ -117.150550000431735, 32.700739999832187 ], [ -117.150413637069931, 32.700887727693875 ], [ -117.150277272809774, 32.701035455311022 ], [ -117.150140909447984, 32.701183182683579 ], [ -117.150004546086151, 32.70133090905572 ], [ -117.149866667266465, 32.701474445066133 ], [ -117.149727777842074, 32.701615186178799 ], [ -117.149588889315993, 32.701755927069449 ], [ -117.149449999891601, 32.701896667738154 ], [ -117.14931111046721, 32.702037408184886 ], [ -117.149171785359911, 32.702179286074646 ], [ -117.149030713927701, 32.702325715147047 ], [ -117.148889642495448, 32.702472143979179 ], [ -117.148748571063251, 32.702618572571104 ], [ -117.148607499631026, 32.702765000922703 ], [ -117.148466428198816, 32.702911428278099 ], [ -117.148324285076455, 32.703055714638857 ], [ -117.148181427793475, 32.703198572087189 ], [ -117.148038571408776, 32.703341429306768 ], [ -117.147895714125781, 32.703484287053563 ], [ -117.147752856842757, 32.703627143815801 ], [ -117.147609999559762, 32.70377000034928 ], [ -117.147775789035336, 32.703888421897091 ], [ -117.147941578510924, 32.704006842531832 ], [ -117.148107367986498, 32.704125263765263 ], [ -117.148270999708757, 32.704241999926992 ], [ -117.148426000417771, 32.704352000065626 ], [ -117.148584000601517, 32.704464000191109 ], [ -117.148754000480821, 32.704584000655537 ], [ -117.148924000360154, 32.704704000958593 ], [ -117.149094000239444, 32.704824001100256 ], [ -117.149264000118777, 32.704944000324637 ], [ -117.149407499697205, 32.705072500228539 ], [ -117.149343333036455, 32.705169047379755 ], [ -117.14912666657645, 32.705166666300379 ], [ -117.14891000011643, 32.705164285976849 ], [ -117.148693333656425, 32.705161904897288 ], [ -117.148478888730111, 32.70516111120412 ], [ -117.148273333531876, 32.705166666300379 ], [ -117.148064000019531, 32.705171999918136 ], [ -117.147848999934354, 32.705177000184506 ], [ -117.147633999849205, 32.705181999694666 ], [ -117.147418999764071, 32.705186999960468 ], [ -117.147200769337161, 32.705185384606324 ], [ -117.146977692499263, 32.705173846577395 ], [ -117.146754615661365, 32.70516230779107 ], [ -117.146708461120397, 32.705286154077442 ], [ -117.146700768846614, 32.705466923690707 ], [ -117.146693076572859, 32.705647692937767 ], [ -117.146683999995219, 32.705830000815943 ], [ -117.146673999949485, 32.706013334065815 ], [ -117.146663999903751, 32.706196666939007 ], [ -117.146664285567994, 32.70638142881964 ], [ -117.146671428072821, 32.706567143490375 ], [ -117.146678571475945, 32.706752857018657 ], [ -117.146740000071702, 32.706929999956024 ], [ -117.146814999516465, 32.707105000372742 ], [ -117.146889999859525, 32.707279999690257 ], [ -117.146924210400499, 32.70746421055955 ], [ -117.146958420941473, 32.707648421804457 ], [ -117.146992631482419, 32.707832631913085 ], [ -117.147028333226785, 32.708011666927277 ], [ -117.14706999978462, 32.708169999740647 ], [ -117.147123125252193, 32.708315313142343 ], [ -117.147188749878651, 32.708491876248765 ], [ -117.147254375403406, 32.70866843900572 ], [ -117.147320000029879, 32.708845002169127 ], [ -117.14738562465628, 32.709021564227307 ], [ -117.147451250181092, 32.709198125936041 ], [ -117.147516874807508, 32.709374687295316 ], [ -117.14752833371729, 32.709551667052253 ], [ -117.147520000046384, 32.709710000156058 ], [ -117.147520000046384, 32.709893333747829 ], [ -117.147520000046384, 32.710076666962848 ], [ -117.147520000046384, 32.71026200054947 ], [ -117.147520000046384, 32.710448667076598 ], [ -117.147520000046384, 32.710635333213204 ], [ -117.147515909118582, 32.710823182620821 ], [ -117.147509090905601, 32.71101181922716 ], [ -117.147502272692577, 32.711200455434678 ], [ -117.147495454479568, 32.711389091999187 ], [ -117.147485142718423, 32.71157742885061 ], [ -117.14746085676471, 32.711764573341057 ], [ -117.147436571709335, 32.711951716683039 ], [ -117.147412285755621, 32.712138859632439 ], [ -117.147387999801936, 32.712326002189215 ], [ -117.147363713848208, 32.712513145109241 ], [ -117.147339428792819, 32.712700286880825 ], [ -117.147316521753055, 32.712886522016262 ], [ -117.147299130369177, 32.713069131040328 ], [ -117.147281738985257, 32.71325173969052 ], [ -117.147264347601379, 32.713434348722721 ], [ -117.147246956217472, 32.713616956625302 ], [ -117.147232058556796, 32.713802941936294 ], [ -117.147218823677719, 32.713991177701793 ], [ -117.147205587900316, 32.714179413825953 ], [ -117.147192353021239, 32.71436764955282 ], [ -117.147179117243851, 32.714555884126625 ], [ -117.147165882364774, 32.714744119059084 ], [ -117.147152647485697, 32.714932352838417 ], [ -117.147153636530803, 32.715120909708922 ], [ -117.147158182006137, 32.715309546296893 ], [ -117.147162727481486, 32.715498182485916 ], [ -117.147167272956835, 32.715686818275991 ], [ -117.147173404856957, 32.715875319889243 ], [ -117.147181915495963, 32.716063619303895 ], [ -117.147190425236644, 32.716251918321021 ], [ -117.14719893587565, 32.716440216940612 ], [ -117.147207446514642, 32.716628515162668 ], [ -117.147215957153648, 32.716816812987197 ], [ -117.147224467792654, 32.717005110414192 ], [ -117.147232978431632, 32.717193407443645 ], [ -117.147241489070623, 32.717381704075564 ], [ -117.147249999709629, 32.717570000309962 ], [ -117.147249999709629, 32.717738750619532 ], [ -117.147332500087032, 32.717837500042386 ], [ -117.147538750581333, 32.717831250407393 ], [ -117.147756000047934, 32.717830000329201 ], [ -117.147976000155978, 32.717833999974772 ], [ -117.148195999365697, 32.717839000287256 ], [ -117.148399999580192, 32.717848889054309 ], [ -117.148599999596726, 32.717859999933836 ], [ -117.148792857108432, 32.717859999933836 ], [ -117.149002857170714, 32.717855714600553 ], [ -117.149221110953832, 32.717848889054309 ], [ -117.149426667050406, 32.717843333236125 ], [ -117.149629999816653, 32.717840000198528 ], [ -117.149834794141881, 32.717839725846488 ], [ -117.150058766600068, 32.717838356353404 ], [ -117.150282739058298, 32.717836986104565 ], [ -117.150506712414838, 32.717835616611495 ], [ -117.150730684873039, 32.717834246362614 ], [ -117.150954657331255, 32.717832876869451 ], [ -117.151178629789484, 32.71783150662052 ], [ -117.151402602247686, 32.717830137127372 ], [ -117.151626575604226, 32.717828766878398 ], [ -117.151850548062413, 32.717827397385207 ], [ -117.152074520520642, 32.717826027136198 ], [ -117.152298492978844, 32.717824657642915 ], [ -117.152522466335384, 32.717823287393841 ], [ -117.152746438793599, 32.717821917900579 ], [ -117.1529704112518, 32.717820547651478 ], [ -117.153186000631806, 32.717819999702947 ], [ -117.153393000321032, 32.717819999702947 ], [ -117.153598000360432, 32.717819999702947 ], [ -117.153680000376198, 32.717931250560419 ], [ -117.153680000376198, 32.718116667591957 ], [ -117.153680000376198, 32.71830208423809 ], [ -117.153680000376198, 32.718487500498668 ], [ -117.153680000376198, 32.71867291637377 ], [ -117.153680000376198, 32.718853999719613 ], [ -117.153691764713159, 32.719040589315924 ], [ -117.153706471032677, 32.719228825364496 ], [ -117.153721176453885, 32.719417061015754 ], [ -117.153735882773404, 32.719605296269705 ], [ -117.153750588194583, 32.719793531126342 ], [ -117.153765294514116, 32.719981765585658 ], [ -117.153779999935324, 32.720169999647716 ], [ -117.153724444524883, 32.720347777996373 ], [ -117.15365916664814, 32.720522916848374 ], [ -117.153554999804427, 32.720687501074849 ], [ -117.153450833859011, 32.720852084241734 ], [ -117.153346667015299, 32.721016667104912 ], [ -117.153242500171572, 32.721181250420067 ], [ -117.153129999656983, 32.721337142933685 ], [ -117.153004999983494, 32.721480000582972 ], [ -117.152880000310034, 32.721622857247624 ], [ -117.152759999761116, 32.72175500006324 ], [ -117.152636666462485, 32.721883333669965 ], [ -117.152503333118148, 32.722016666414483 ], [ -117.152369999773768, 32.722149999715342 ], [ -117.152266296460738, 32.722315741775319 ], [ -117.152162592249397, 32.722481484282923 ], [ -117.152058888936367, 32.722647225726703 ], [ -117.15195518472504, 32.722812966862485 ], [ -117.151851481411995, 32.722978708445886 ], [ -117.151747778098965, 32.723144448965456 ], [ -117.151644073887638, 32.723310189177035 ], [ -117.151540370574594, 32.723475929836226 ], [ -117.151436666363239, 32.723641669431601 ], [ -117.151332963050237, 32.723807408718947 ], [ -117.151234999971862, 32.72397250002998 ], [ -117.151160000527099, 32.724135000367234 ], [ -117.151080000161144, 32.724297500408319 ], [ -117.150996667045533, 32.724460000153258 ], [ -117.150913333929878, 32.724623889395701 ], [ -117.150829999915885, 32.724793333722438 ], [ -117.150746666800273, 32.724962778482904 ], [ -117.150663333684619, 32.725132222165605 ], [ -117.150569142632122, 32.725297714582261 ], [ -117.150467713853416, 32.725460572230027 ], [ -117.150366285972964, 32.725623430335979 ], [ -117.150264857194259, 32.7257862873888 ], [ -117.150163428415524, 32.725949144144138 ], [ -117.150062000535129, 32.726112000602008 ], [ -117.149960571756395, 32.726274857518128 ], [ -117.149810286304302, 32.726402571732081 ], [ -117.149627428838329, 32.726506857771184 ], [ -117.149444571372356, 32.726611143688253 ], [ -117.149261713906355, 32.726715429483335 ], [ -117.149078857338722, 32.726819715156495 ], [ -117.148895999872721, 32.726924000707605 ], [ -117.148713142406748, 32.727028286136743 ], [ -117.148527500163411, 32.727107499935954 ], [ -117.148341999853869, 32.727179999922392 ], [ -117.148156999905936, 32.727254999741994 ], [ -117.147970000308177, 32.727333332937185 ], [ -117.147782499450514, 32.727412499611347 ], [ -117.147604782144612, 32.727511304068443 ], [ -117.147441738818856, 32.727639565155108 ], [ -117.1472786954931, 32.727767826057253 ], [ -117.147115652167315, 32.727896086774876 ], [ -117.146952608841573, 32.728024347307972 ], [ -117.14683238101891, 32.728179524297857 ], [ -117.146722856622844, 32.728341429031481 ], [ -117.14661333312506, 32.728503334226737 ], [ -117.146503809627319, 32.728665238372294 ], [ -117.146433750018303, 32.728838750495896 ], [ -117.146389999369021, 32.729020001365825 ], [ -117.146346249618063, 32.72920125111154 ], [ -117.146302499867119, 32.729382501244444 ], [ -117.146258749217793, 32.729563750253142 ], [ -117.146400000313093, 32.729589999948736 ], [ -117.146600000329613, 32.729668571401881 ], [ -117.146679999797271, 32.729808571287677 ], [ -117.146679999797271, 32.729989523956149 ], [ -117.146679999797271, 32.730170477013012 ], [ -117.146679999797271, 32.730351428946854 ]]],\"spatialReference\":{\"wkid\":4326,\"latestWkid\":4326}}"; // Path to the network geodatabase for San Diego. - private readonly string _networkGeodatabasePath = DataManager.GetDataFolder("567e14f3420d40c5a206e5c0284cf8fc", "sandiego.geodatabase"); + private readonly string _networkGeodatabasePath = DataManager.GetDataFolder("df193653ed39449195af0c9725701dca", "sandiego.geodatabase"); public NavigateRouteRerouting() { diff --git a/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.md b/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.md index bf48e0f0cb..c5d95e634d 100644 --- a/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.md +++ b/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.md @@ -43,7 +43,7 @@ Click 'Navigate' to simulate traveling and to receive directions from a preset s ## Offline data -A geodatabase contains a road network for San Diego. [San Diego Geodatabase](https://arcgisruntime.maps.arcgis.com/home/item.html?id=567e14f3420d40c5a206e5c0284cf8fc) +A geodatabase contains a road network for San Diego. [San Diego Geodatabase](https://arcgisruntime.maps.arcgis.com/home/item.html?id=df193653ed39449195af0c9725701dca) ## About the data diff --git a/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.metadata.json b/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.metadata.json index c366eb8f99..fe6fc621c9 100644 --- a/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.metadata.json +++ b/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.metadata.json @@ -15,7 +15,7 @@ "voice" ], "offline_data": [ - "567e14f3420d40c5a206e5c0284cf8fc" + "df193653ed39449195af0c9725701dca" ], "redirect_from": [ "/net/latest/wpf/sample-code/navigate-route-with-rerouting.htm" diff --git a/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/OfflineRouting/OfflineRouting.xaml.cs b/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/OfflineRouting/OfflineRouting.xaml.cs index 68cf96a6bc..fd2e511b16 100644 --- a/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/OfflineRouting/OfflineRouting.xaml.cs +++ b/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/OfflineRouting/OfflineRouting.xaml.cs @@ -35,7 +35,7 @@ namespace ArcGIS.WPF.Samples.OfflineRouting description: "Solve a route on-the-fly using offline data.", instructions: "Click near a road to start adding a stop to the route, click again to place it on the map. A number graphic will show its order in the route. After adding at least 2 stops, a route will display. Choose \"Fastest\" or \"Shortest\" to control how the route is optimized. The route will update on-the-fly while moving stops. The green box marks the boundary of the routable area provided by the offline data. This sample limits routes to 5 stops for performance reasons.", tags: new[] { "connectivity", "disconnected", "fastest", "locator", "navigation", "network analysis", "offline", "routing", "shortest", "turn-by-turn" })] - [ArcGIS.Samples.Shared.Attributes.OfflineData("567e14f3420d40c5a206e5c0284cf8fc")] + [ArcGIS.Samples.Shared.Attributes.OfflineData("df193653ed39449195af0c9725701dca")] public partial class OfflineRouting { // Graphics overlays for holding graphics. @@ -69,8 +69,8 @@ private async Task Initialize() try { // Get the paths to resources used by the sample. - string basemapTilePath = DataManager.GetDataFolder("567e14f3420d40c5a206e5c0284cf8fc", "streetmap_SD.tpkx"); - string networkGeodatabasePath = DataManager.GetDataFolder("567e14f3420d40c5a206e5c0284cf8fc", "sandiego.geodatabase"); + string basemapTilePath = DataManager.GetDataFolder("df193653ed39449195af0c9725701dca", "streetmap_SD.tpkx"); + string networkGeodatabasePath = DataManager.GetDataFolder("df193653ed39449195af0c9725701dca", "sandiego.geodatabase"); // Create the tile cache representing the offline basemap. TileCache tiledBasemapCache = new TileCache(basemapTilePath); diff --git a/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/OfflineRouting/readme.md b/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/OfflineRouting/readme.md index 8f5746bb1c..21e826853a 100644 --- a/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/OfflineRouting/readme.md +++ b/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/OfflineRouting/readme.md @@ -31,7 +31,7 @@ Click near a road to start adding a stop to the route, click again to place it o ## Offline data -The data used by this sample is available on [ArcGIS Online](https://arcgisruntime.maps.arcgis.com/home/item.html?id=567e14f3420d40c5a206e5c0284cf8fc). +The data used by this sample is available on [ArcGIS Online](https://arcgisruntime.maps.arcgis.com/home/item.html?id=df193653ed39449195af0c9725701dca). ## About the data diff --git a/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/OfflineRouting/readme.metadata.json b/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/OfflineRouting/readme.metadata.json index 0eacbe330a..3134f6dc9d 100644 --- a/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/OfflineRouting/readme.metadata.json +++ b/src/WPF/WPF.Viewer/Samples/NetworkAnalysis/OfflineRouting/readme.metadata.json @@ -19,7 +19,7 @@ "turn-by-turn" ], "offline_data": [ - "567e14f3420d40c5a206e5c0284cf8fc" + "df193653ed39449195af0c9725701dca" ], "redirect_from": [ "/net/latest/wpf/sample-code/offline-routing.htm" diff --git a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/NavigateRouteRerouting.xaml.cs b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/NavigateRouteRerouting.xaml.cs index 3e16d4bda8..e6e138e2a0 100644 --- a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/NavigateRouteRerouting.xaml.cs +++ b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/NavigateRouteRerouting.xaml.cs @@ -29,7 +29,7 @@ namespace ArcGIS.WinUI.Samples.NavigateRouteRerouting description: "Navigate between two points and dynamically recalculate an alternate route when the original route is unavailable.", instructions: "Click 'Navigate' to simulate traveling and to receive directions from a preset starting point to a preset destination. Observe how the route is recalculated when the simulation does not follow the suggested route. Click 'Recenter' to refocus on the location display.", tags: new[] { "directions", "maneuver", "navigation", "route", "turn-by-turn", "voice" })] - [ArcGIS.Samples.Shared.Attributes.OfflineData("567e14f3420d40c5a206e5c0284cf8fc")] + [ArcGIS.Samples.Shared.Attributes.OfflineData("df193653ed39449195af0c9725701dca")] public partial class NavigateRouteRerouting { // Variables for tracking the navigation route. @@ -56,7 +56,7 @@ public partial class NavigateRouteRerouting private readonly string _tourPolylineJSON = "{\"paths\":[[[ -117.160386727066026, 32.706608204740171 ], [ -117.160205336548898, 32.706508733108137 ], [ -117.16002394693011, 32.706409261365152 ], [ -117.159842556412997, 32.706309788755419 ], [ -117.159651667110055, 32.706216667017223 ], [ -117.159454444684357, 32.706127778166461 ], [ -117.159257222258688, 32.706038889227095 ], [ -117.159059999833019, 32.705950000199223 ], [ -117.158902856642044, 32.705835713852132 ], [ -117.158739999267553, 32.705720000231665 ], [ -117.158576363053726, 32.705604545733003 ], [ -117.158417272315205, 32.70549090901352 ], [ -117.158256250198832, 32.705376874547866 ], [ -117.158087499876075, 32.70526125028416 ], [ -117.157918750451643, 32.70514562511471 ], [ -117.1577500001289, 32.705029999795485 ], [ -117.157600000341063, 32.704940000101111 ], [ -117.157425000438906, 32.704823332883613 ], [ -117.157250000536706, 32.704706666269544 ], [ -117.15707875020253, 32.70459250003033 ], [ -117.156909999879787, 32.704480000413547 ], [ -117.156741250455326, 32.704367499899007 ], [ -117.156569643489959, 32.704254999998568 ], [ -117.156393750662403, 32.704142500712138 ], [ -117.156217857834818, 32.70403000128394 ], [ -117.156041965007248, 32.703917501713846 ], [ -117.155866072179691, 32.703805002001992 ], [ -117.155690179352078, 32.703692502148236 ], [ -117.155514286524522, 32.703580002152705 ], [ -117.155338393696923, 32.7034675020153 ], [ -117.155162499971055, 32.703355001736114 ], [ -117.154986607143471, 32.703242501315046 ], [ -117.154810714315886, 32.703130000752203 ], [ -117.154635517682649, 32.703016896826178 ], [ -117.154463104030171, 32.702901379868429 ], [ -117.154290690377692, 32.702785862761147 ], [ -117.154118275826903, 32.702670345504323 ], [ -117.153945862174425, 32.702554828097959 ], [ -117.153773448521946, 32.702439310542076 ], [ -117.153599428681744, 32.702323429238 ], [ -117.153423000458261, 32.702207001250933 ], [ -117.153246571336439, 32.702090573867849 ], [ -117.15307014311297, 32.701974145576926 ], [ -117.152893714889458, 32.701857717134175 ], [ -117.152717285767665, 32.701741289295413 ], [ -117.152540857544182, 32.701624860548854 ], [ -117.152364428422359, 32.701508432406285 ], [ -117.152188000198905, 32.701392003355934 ], [ -117.152011571077097, 32.701275574909566 ], [ -117.151835142853614, 32.701159145555422 ], [ -117.15165871463013, 32.701042716049322 ], [ -117.151482285508337, 32.70092628714734 ], [ -117.151305857284839, 32.700809857337454 ], [ -117.151133333139583, 32.700694999722828 ], [ -117.150966666009978, 32.700582500484039 ], [ -117.150799999778684, 32.700470000347529 ], [ -117.150666666434319, 32.700606666276805 ], [ -117.150550000431735, 32.700739999832187 ], [ -117.150413637069931, 32.700887727693875 ], [ -117.150277272809774, 32.701035455311022 ], [ -117.150140909447984, 32.701183182683579 ], [ -117.150004546086151, 32.70133090905572 ], [ -117.149866667266465, 32.701474445066133 ], [ -117.149727777842074, 32.701615186178799 ], [ -117.149588889315993, 32.701755927069449 ], [ -117.149449999891601, 32.701896667738154 ], [ -117.14931111046721, 32.702037408184886 ], [ -117.149171785359911, 32.702179286074646 ], [ -117.149030713927701, 32.702325715147047 ], [ -117.148889642495448, 32.702472143979179 ], [ -117.148748571063251, 32.702618572571104 ], [ -117.148607499631026, 32.702765000922703 ], [ -117.148466428198816, 32.702911428278099 ], [ -117.148324285076455, 32.703055714638857 ], [ -117.148181427793475, 32.703198572087189 ], [ -117.148038571408776, 32.703341429306768 ], [ -117.147895714125781, 32.703484287053563 ], [ -117.147752856842757, 32.703627143815801 ], [ -117.147609999559762, 32.70377000034928 ], [ -117.147775789035336, 32.703888421897091 ], [ -117.147941578510924, 32.704006842531832 ], [ -117.148107367986498, 32.704125263765263 ], [ -117.148270999708757, 32.704241999926992 ], [ -117.148426000417771, 32.704352000065626 ], [ -117.148584000601517, 32.704464000191109 ], [ -117.148754000480821, 32.704584000655537 ], [ -117.148924000360154, 32.704704000958593 ], [ -117.149094000239444, 32.704824001100256 ], [ -117.149264000118777, 32.704944000324637 ], [ -117.149407499697205, 32.705072500228539 ], [ -117.149343333036455, 32.705169047379755 ], [ -117.14912666657645, 32.705166666300379 ], [ -117.14891000011643, 32.705164285976849 ], [ -117.148693333656425, 32.705161904897288 ], [ -117.148478888730111, 32.70516111120412 ], [ -117.148273333531876, 32.705166666300379 ], [ -117.148064000019531, 32.705171999918136 ], [ -117.147848999934354, 32.705177000184506 ], [ -117.147633999849205, 32.705181999694666 ], [ -117.147418999764071, 32.705186999960468 ], [ -117.147200769337161, 32.705185384606324 ], [ -117.146977692499263, 32.705173846577395 ], [ -117.146754615661365, 32.70516230779107 ], [ -117.146708461120397, 32.705286154077442 ], [ -117.146700768846614, 32.705466923690707 ], [ -117.146693076572859, 32.705647692937767 ], [ -117.146683999995219, 32.705830000815943 ], [ -117.146673999949485, 32.706013334065815 ], [ -117.146663999903751, 32.706196666939007 ], [ -117.146664285567994, 32.70638142881964 ], [ -117.146671428072821, 32.706567143490375 ], [ -117.146678571475945, 32.706752857018657 ], [ -117.146740000071702, 32.706929999956024 ], [ -117.146814999516465, 32.707105000372742 ], [ -117.146889999859525, 32.707279999690257 ], [ -117.146924210400499, 32.70746421055955 ], [ -117.146958420941473, 32.707648421804457 ], [ -117.146992631482419, 32.707832631913085 ], [ -117.147028333226785, 32.708011666927277 ], [ -117.14706999978462, 32.708169999740647 ], [ -117.147123125252193, 32.708315313142343 ], [ -117.147188749878651, 32.708491876248765 ], [ -117.147254375403406, 32.70866843900572 ], [ -117.147320000029879, 32.708845002169127 ], [ -117.14738562465628, 32.709021564227307 ], [ -117.147451250181092, 32.709198125936041 ], [ -117.147516874807508, 32.709374687295316 ], [ -117.14752833371729, 32.709551667052253 ], [ -117.147520000046384, 32.709710000156058 ], [ -117.147520000046384, 32.709893333747829 ], [ -117.147520000046384, 32.710076666962848 ], [ -117.147520000046384, 32.71026200054947 ], [ -117.147520000046384, 32.710448667076598 ], [ -117.147520000046384, 32.710635333213204 ], [ -117.147515909118582, 32.710823182620821 ], [ -117.147509090905601, 32.71101181922716 ], [ -117.147502272692577, 32.711200455434678 ], [ -117.147495454479568, 32.711389091999187 ], [ -117.147485142718423, 32.71157742885061 ], [ -117.14746085676471, 32.711764573341057 ], [ -117.147436571709335, 32.711951716683039 ], [ -117.147412285755621, 32.712138859632439 ], [ -117.147387999801936, 32.712326002189215 ], [ -117.147363713848208, 32.712513145109241 ], [ -117.147339428792819, 32.712700286880825 ], [ -117.147316521753055, 32.712886522016262 ], [ -117.147299130369177, 32.713069131040328 ], [ -117.147281738985257, 32.71325173969052 ], [ -117.147264347601379, 32.713434348722721 ], [ -117.147246956217472, 32.713616956625302 ], [ -117.147232058556796, 32.713802941936294 ], [ -117.147218823677719, 32.713991177701793 ], [ -117.147205587900316, 32.714179413825953 ], [ -117.147192353021239, 32.71436764955282 ], [ -117.147179117243851, 32.714555884126625 ], [ -117.147165882364774, 32.714744119059084 ], [ -117.147152647485697, 32.714932352838417 ], [ -117.147153636530803, 32.715120909708922 ], [ -117.147158182006137, 32.715309546296893 ], [ -117.147162727481486, 32.715498182485916 ], [ -117.147167272956835, 32.715686818275991 ], [ -117.147173404856957, 32.715875319889243 ], [ -117.147181915495963, 32.716063619303895 ], [ -117.147190425236644, 32.716251918321021 ], [ -117.14719893587565, 32.716440216940612 ], [ -117.147207446514642, 32.716628515162668 ], [ -117.147215957153648, 32.716816812987197 ], [ -117.147224467792654, 32.717005110414192 ], [ -117.147232978431632, 32.717193407443645 ], [ -117.147241489070623, 32.717381704075564 ], [ -117.147249999709629, 32.717570000309962 ], [ -117.147249999709629, 32.717738750619532 ], [ -117.147332500087032, 32.717837500042386 ], [ -117.147538750581333, 32.717831250407393 ], [ -117.147756000047934, 32.717830000329201 ], [ -117.147976000155978, 32.717833999974772 ], [ -117.148195999365697, 32.717839000287256 ], [ -117.148399999580192, 32.717848889054309 ], [ -117.148599999596726, 32.717859999933836 ], [ -117.148792857108432, 32.717859999933836 ], [ -117.149002857170714, 32.717855714600553 ], [ -117.149221110953832, 32.717848889054309 ], [ -117.149426667050406, 32.717843333236125 ], [ -117.149629999816653, 32.717840000198528 ], [ -117.149834794141881, 32.717839725846488 ], [ -117.150058766600068, 32.717838356353404 ], [ -117.150282739058298, 32.717836986104565 ], [ -117.150506712414838, 32.717835616611495 ], [ -117.150730684873039, 32.717834246362614 ], [ -117.150954657331255, 32.717832876869451 ], [ -117.151178629789484, 32.71783150662052 ], [ -117.151402602247686, 32.717830137127372 ], [ -117.151626575604226, 32.717828766878398 ], [ -117.151850548062413, 32.717827397385207 ], [ -117.152074520520642, 32.717826027136198 ], [ -117.152298492978844, 32.717824657642915 ], [ -117.152522466335384, 32.717823287393841 ], [ -117.152746438793599, 32.717821917900579 ], [ -117.1529704112518, 32.717820547651478 ], [ -117.153186000631806, 32.717819999702947 ], [ -117.153393000321032, 32.717819999702947 ], [ -117.153598000360432, 32.717819999702947 ], [ -117.153680000376198, 32.717931250560419 ], [ -117.153680000376198, 32.718116667591957 ], [ -117.153680000376198, 32.71830208423809 ], [ -117.153680000376198, 32.718487500498668 ], [ -117.153680000376198, 32.71867291637377 ], [ -117.153680000376198, 32.718853999719613 ], [ -117.153691764713159, 32.719040589315924 ], [ -117.153706471032677, 32.719228825364496 ], [ -117.153721176453885, 32.719417061015754 ], [ -117.153735882773404, 32.719605296269705 ], [ -117.153750588194583, 32.719793531126342 ], [ -117.153765294514116, 32.719981765585658 ], [ -117.153779999935324, 32.720169999647716 ], [ -117.153724444524883, 32.720347777996373 ], [ -117.15365916664814, 32.720522916848374 ], [ -117.153554999804427, 32.720687501074849 ], [ -117.153450833859011, 32.720852084241734 ], [ -117.153346667015299, 32.721016667104912 ], [ -117.153242500171572, 32.721181250420067 ], [ -117.153129999656983, 32.721337142933685 ], [ -117.153004999983494, 32.721480000582972 ], [ -117.152880000310034, 32.721622857247624 ], [ -117.152759999761116, 32.72175500006324 ], [ -117.152636666462485, 32.721883333669965 ], [ -117.152503333118148, 32.722016666414483 ], [ -117.152369999773768, 32.722149999715342 ], [ -117.152266296460738, 32.722315741775319 ], [ -117.152162592249397, 32.722481484282923 ], [ -117.152058888936367, 32.722647225726703 ], [ -117.15195518472504, 32.722812966862485 ], [ -117.151851481411995, 32.722978708445886 ], [ -117.151747778098965, 32.723144448965456 ], [ -117.151644073887638, 32.723310189177035 ], [ -117.151540370574594, 32.723475929836226 ], [ -117.151436666363239, 32.723641669431601 ], [ -117.151332963050237, 32.723807408718947 ], [ -117.151234999971862, 32.72397250002998 ], [ -117.151160000527099, 32.724135000367234 ], [ -117.151080000161144, 32.724297500408319 ], [ -117.150996667045533, 32.724460000153258 ], [ -117.150913333929878, 32.724623889395701 ], [ -117.150829999915885, 32.724793333722438 ], [ -117.150746666800273, 32.724962778482904 ], [ -117.150663333684619, 32.725132222165605 ], [ -117.150569142632122, 32.725297714582261 ], [ -117.150467713853416, 32.725460572230027 ], [ -117.150366285972964, 32.725623430335979 ], [ -117.150264857194259, 32.7257862873888 ], [ -117.150163428415524, 32.725949144144138 ], [ -117.150062000535129, 32.726112000602008 ], [ -117.149960571756395, 32.726274857518128 ], [ -117.149810286304302, 32.726402571732081 ], [ -117.149627428838329, 32.726506857771184 ], [ -117.149444571372356, 32.726611143688253 ], [ -117.149261713906355, 32.726715429483335 ], [ -117.149078857338722, 32.726819715156495 ], [ -117.148895999872721, 32.726924000707605 ], [ -117.148713142406748, 32.727028286136743 ], [ -117.148527500163411, 32.727107499935954 ], [ -117.148341999853869, 32.727179999922392 ], [ -117.148156999905936, 32.727254999741994 ], [ -117.147970000308177, 32.727333332937185 ], [ -117.147782499450514, 32.727412499611347 ], [ -117.147604782144612, 32.727511304068443 ], [ -117.147441738818856, 32.727639565155108 ], [ -117.1472786954931, 32.727767826057253 ], [ -117.147115652167315, 32.727896086774876 ], [ -117.146952608841573, 32.728024347307972 ], [ -117.14683238101891, 32.728179524297857 ], [ -117.146722856622844, 32.728341429031481 ], [ -117.14661333312506, 32.728503334226737 ], [ -117.146503809627319, 32.728665238372294 ], [ -117.146433750018303, 32.728838750495896 ], [ -117.146389999369021, 32.729020001365825 ], [ -117.146346249618063, 32.72920125111154 ], [ -117.146302499867119, 32.729382501244444 ], [ -117.146258749217793, 32.729563750253142 ], [ -117.146400000313093, 32.729589999948736 ], [ -117.146600000329613, 32.729668571401881 ], [ -117.146679999797271, 32.729808571287677 ], [ -117.146679999797271, 32.729989523956149 ], [ -117.146679999797271, 32.730170477013012 ], [ -117.146679999797271, 32.730351428946854 ]]],\"spatialReference\":{\"wkid\":4326,\"latestWkid\":4326}}"; // Path to the network geodatabase for San Diego. - private readonly string _networkGeodatabasePath = DataManager.GetDataFolder("567e14f3420d40c5a206e5c0284cf8fc", "sandiego.geodatabase"); + private readonly string _networkGeodatabasePath = DataManager.GetDataFolder("df193653ed39449195af0c9725701dca", "sandiego.geodatabase"); public NavigateRouteRerouting() { diff --git a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.md b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.md index bf48e0f0cb..c5d95e634d 100644 --- a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.md +++ b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.md @@ -43,7 +43,7 @@ Click 'Navigate' to simulate traveling and to receive directions from a preset s ## Offline data -A geodatabase contains a road network for San Diego. [San Diego Geodatabase](https://arcgisruntime.maps.arcgis.com/home/item.html?id=567e14f3420d40c5a206e5c0284cf8fc) +A geodatabase contains a road network for San Diego. [San Diego Geodatabase](https://arcgisruntime.maps.arcgis.com/home/item.html?id=df193653ed39449195af0c9725701dca) ## About the data diff --git a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.metadata.json b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.metadata.json index d0c18c4673..191b8ac425 100644 --- a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.metadata.json +++ b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/NavigateRouteRerouting/readme.metadata.json @@ -15,7 +15,7 @@ "voice" ], "offline_data": [ - "567e14f3420d40c5a206e5c0284cf8fc" + "df193653ed39449195af0c9725701dca" ], "redirect_from": [ "/net/latest/winui/sample-code/navigate-route-with-rerouting.htm" diff --git a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/OfflineRouting/OfflineRouting.xaml.cs b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/OfflineRouting/OfflineRouting.xaml.cs index 7880a04568..36358a93dd 100644 --- a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/OfflineRouting/OfflineRouting.xaml.cs +++ b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/OfflineRouting/OfflineRouting.xaml.cs @@ -34,7 +34,7 @@ namespace ArcGIS.WinUI.Samples.OfflineRouting description: "Solve a route on-the-fly using offline data.", instructions: "Click near a road to start adding a stop to the route, click again to place it on the map. A number graphic will show its order in the route. After adding at least 2 stops, a route will display. Choose \"Fastest\" or \"Shortest\" to control how the route is optimized. The route will update on-the-fly while moving stops. The green box marks the boundary of the routable area provided by the offline data. This sample limits routes to 5 stops for performance reasons.", tags: new[] { "connectivity", "disconnected", "fastest", "locator", "navigation", "network analysis", "offline", "routing", "shortest", "turn-by-turn" })] - [ArcGIS.Samples.Shared.Attributes.OfflineData("567e14f3420d40c5a206e5c0284cf8fc")] + [ArcGIS.Samples.Shared.Attributes.OfflineData("df193653ed39449195af0c9725701dca")] public partial class OfflineRouting { // Graphics overlays for holding graphics. @@ -68,8 +68,8 @@ private async Task Initialize() try { // Get the paths to resources used by the sample. - string basemapTilePath = DataManager.GetDataFolder("567e14f3420d40c5a206e5c0284cf8fc", "streetmap_SD.tpkx"); - string networkGeodatabasePath = DataManager.GetDataFolder("567e14f3420d40c5a206e5c0284cf8fc", "sandiego.geodatabase"); + string basemapTilePath = DataManager.GetDataFolder("df193653ed39449195af0c9725701dca", "streetmap_SD.tpkx"); + string networkGeodatabasePath = DataManager.GetDataFolder("df193653ed39449195af0c9725701dca", "sandiego.geodatabase"); // Create the tile cache representing the offline basemap. TileCache tiledBasemapCache = new TileCache(basemapTilePath); diff --git a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/OfflineRouting/readme.md b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/OfflineRouting/readme.md index 8f5746bb1c..21e826853a 100644 --- a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/OfflineRouting/readme.md +++ b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/OfflineRouting/readme.md @@ -31,7 +31,7 @@ Click near a road to start adding a stop to the route, click again to place it o ## Offline data -The data used by this sample is available on [ArcGIS Online](https://arcgisruntime.maps.arcgis.com/home/item.html?id=567e14f3420d40c5a206e5c0284cf8fc). +The data used by this sample is available on [ArcGIS Online](https://arcgisruntime.maps.arcgis.com/home/item.html?id=df193653ed39449195af0c9725701dca). ## About the data diff --git a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/OfflineRouting/readme.metadata.json b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/OfflineRouting/readme.metadata.json index 47cc24f2e0..104df0ef1d 100644 --- a/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/OfflineRouting/readme.metadata.json +++ b/src/WinUI/ArcGIS.WinUI.Viewer/Samples/NetworkAnalysis/OfflineRouting/readme.metadata.json @@ -19,7 +19,7 @@ "turn-by-turn" ], "offline_data": [ - "567e14f3420d40c5a206e5c0284cf8fc" + "df193653ed39449195af0c9725701dca" ], "redirect_from": [ "/net/latest/winui/sample-code/offline-routing.htm" From b324d193fb4d6cb21eea7b079f5ec31955525a3f Mon Sep 17 00:00:00 2001 From: Praveenaa Kulandhaivel Date: Tue, 9 Sep 2025 09:51:48 -0700 Subject: [PATCH 03/45] Undo temporary workaround for MAUI bug (#1657) --- .../BrowseOAFeatureService.xaml | 4 +- .../BrowseWfsLayers/BrowseWfsLayers.xaml | 4 +- .../CreateDynamicBasemapGallery.xaml | 38 +++++------------- .../CreateDynamicBasemapGallery.xaml.cs | 6 +-- .../MapReferenceScale/MapReferenceScale.xaml | 4 +- .../OfflineRouting/OfflineRouting.xaml | 16 ++------ .../OfflineRouting/OfflineRouting.xaml.cs | 18 ++++----- .../OfflineRouting/offlinerouting.jpg | Bin 139908 -> 244093 bytes 8 files changed, 30 insertions(+), 60 deletions(-) diff --git a/src/MAUI/Maui.Samples/Samples/Layers/BrowseOAFeatureService/BrowseOAFeatureService.xaml b/src/MAUI/Maui.Samples/Samples/Layers/BrowseOAFeatureService/BrowseOAFeatureService.xaml index 79f7553553..410748ce6b 100644 --- a/src/MAUI/Maui.Samples/Samples/Layers/BrowseOAFeatureService/BrowseOAFeatureService.xaml +++ b/src/MAUI/Maui.Samples/Samples/Layers/BrowseOAFeatureService/BrowseOAFeatureService.xaml @@ -28,9 +28,7 @@ SelectionMode="Single"> - - - + diff --git a/src/MAUI/Maui.Samples/Samples/Layers/BrowseWfsLayers/BrowseWfsLayers.xaml b/src/MAUI/Maui.Samples/Samples/Layers/BrowseWfsLayers/BrowseWfsLayers.xaml index 96ef67e8cb..848bb35684 100644 --- a/src/MAUI/Maui.Samples/Samples/Layers/BrowseWfsLayers/BrowseWfsLayers.xaml +++ b/src/MAUI/Maui.Samples/Samples/Layers/BrowseWfsLayers/BrowseWfsLayers.xaml @@ -19,9 +19,7 @@ SelectionMode="Single"> - - - + diff --git a/src/MAUI/Maui.Samples/Samples/Map/CreateDynamicBasemapGallery/CreateDynamicBasemapGallery.xaml b/src/MAUI/Maui.Samples/Samples/Map/CreateDynamicBasemapGallery/CreateDynamicBasemapGallery.xaml index 14ecc9e01b..becba01893 100644 --- a/src/MAUI/Maui.Samples/Samples/Map/CreateDynamicBasemapGallery/CreateDynamicBasemapGallery.xaml +++ b/src/MAUI/Maui.Samples/Samples/Map/CreateDynamicBasemapGallery/CreateDynamicBasemapGallery.xaml @@ -44,9 +44,7 @@ SelectionChanged="BasemapStyleGallery_SelectionChanged" SelectionMode="Single"> - - - +