<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Polyline not crossing international Dateline in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/polyline-not-crossing-international-dateline/m-p/496299#M6086</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a simple WPF .NET application using the v100.5 ESRI&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;ArcGISRuntime&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;that creates a polyline with two points, one in San Diego, California, the other in Kwajalein Atoll on an ESRI basemap. The lat/longs are entered in WGS84. I found this article&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/thread/118744" style="color: #2989c5; text-decoration: none;"&gt;https://community.esri.com/thread/118744&lt;/A&gt;&amp;nbsp;and tried that solution but the line never crosses the International Dateline, instead it takes the long way around the world (See attached PNG). Here is the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using Esri.ArcGISRuntime.Geometry;&lt;BR /&gt;using Esri.ArcGISRuntime.Mapping;&lt;BR /&gt;using Esri.ArcGISRuntime.Symbology;&lt;BR /&gt;using Esri.ArcGISRuntime.UI;&lt;BR /&gt;using System;&lt;BR /&gt;using System.Windows;&lt;BR /&gt;using System.Windows.Controls;&lt;/P&gt;&lt;P&gt;namespace ESRI_Test&lt;BR /&gt;{&lt;BR /&gt;/// &amp;lt;summary&amp;gt;&lt;BR /&gt;/// Interaction logic for MainWindow.xaml&lt;BR /&gt;/// &amp;lt;/summary&amp;gt;&lt;BR /&gt;public partial class MainWindow : Window&lt;BR /&gt;{&lt;BR /&gt;// Graphics overlay to display the graphics.&lt;BR /&gt;private GraphicsOverlay _graphicsOverlay;&lt;BR /&gt;private Graphic _countryBorderPolylineGraphic;&lt;/P&gt;&lt;P&gt;public MainWindow()&lt;BR /&gt;{&lt;BR /&gt;InitializeComponent();&lt;BR /&gt;// Create a map with a topographic basemap.&lt;BR /&gt;Map newMap = new Map(BasemapType.DarkGrayCanvasVector, 21.339723, -157.945774, 2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Assign the map to the MapView.&lt;BR /&gt;MyMapView.Map = newMap;&lt;BR /&gt;var test = newMap.SpatialReference;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Create a graphics overlay to hold the various graphics.&lt;BR /&gt;_graphicsOverlay = new GraphicsOverlay();&lt;/P&gt;&lt;P&gt;// Add the created graphics overlay to the MapView.&lt;BR /&gt;MyMapView.GraphicsOverlays.Add(_graphicsOverlay);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Add the map points to the point collection.&lt;BR /&gt;PointCollection newborderCountryPointCollection = new PointCollection(SpatialReferences.WebMercator)&lt;BR /&gt;{&lt;BR /&gt;(MapPoint)GeometryEngine.NormalizeCentralMeridian((MapPoint) GeometryEngine.Project(new MapPoint(-157.945774, 21.339723, SpatialReferences.Wgs84), SpatialReferences.WebMercator)),&lt;BR /&gt;(MapPoint)GeometryEngine.NormalizeCentralMeridian((MapPoint) GeometryEngine.Project(new MapPoint(167.726017, 8.719545, SpatialReferences.Wgs84), SpatialReferences.WebMercator))&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;// Create a polyline geometry from the point collection.&lt;BR /&gt;Polyline newborderCountryPolyline = new Polyline(newborderCountryPointCollection);&lt;/P&gt;&lt;P&gt;// Create a simple line symbol&lt;BR /&gt;SimpleLineSymbol newcountryBorderSimpleLineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Dot, System.Drawing.Color.Blue, 5);&lt;/P&gt;&lt;P&gt;// Create the graphic - comprised of a polyline shape and line symbol.&lt;BR /&gt;Graphic _newcountryBorderPolylineGraphic = new Graphic(newborderCountryPolyline, newcountryBorderSimpleLineSymbol);&lt;BR /&gt;_graphicsOverlay.Graphics.Add(_newcountryBorderPolylineGraphic);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts what I am missing? Or doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for the help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Jul 2019 18:10:11 GMT</pubDate>
    <dc:creator>AlanFlythe</dc:creator>
    <dc:date>2019-07-22T18:10:11Z</dc:date>
    <item>
      <title>Polyline not crossing international Dateline</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/polyline-not-crossing-international-dateline/m-p/496299#M6086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a simple WPF .NET application using the v100.5 ESRI&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;ArcGISRuntime&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;that creates a polyline with two points, one in San Diego, California, the other in Kwajalein Atoll on an ESRI basemap. The lat/longs are entered in WGS84. I found this article&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/thread/118744" style="color: #2989c5; text-decoration: none;"&gt;https://community.esri.com/thread/118744&lt;/A&gt;&amp;nbsp;and tried that solution but the line never crosses the International Dateline, instead it takes the long way around the world (See attached PNG). Here is the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using Esri.ArcGISRuntime.Geometry;&lt;BR /&gt;using Esri.ArcGISRuntime.Mapping;&lt;BR /&gt;using Esri.ArcGISRuntime.Symbology;&lt;BR /&gt;using Esri.ArcGISRuntime.UI;&lt;BR /&gt;using System;&lt;BR /&gt;using System.Windows;&lt;BR /&gt;using System.Windows.Controls;&lt;/P&gt;&lt;P&gt;namespace ESRI_Test&lt;BR /&gt;{&lt;BR /&gt;/// &amp;lt;summary&amp;gt;&lt;BR /&gt;/// Interaction logic for MainWindow.xaml&lt;BR /&gt;/// &amp;lt;/summary&amp;gt;&lt;BR /&gt;public partial class MainWindow : Window&lt;BR /&gt;{&lt;BR /&gt;// Graphics overlay to display the graphics.&lt;BR /&gt;private GraphicsOverlay _graphicsOverlay;&lt;BR /&gt;private Graphic _countryBorderPolylineGraphic;&lt;/P&gt;&lt;P&gt;public MainWindow()&lt;BR /&gt;{&lt;BR /&gt;InitializeComponent();&lt;BR /&gt;// Create a map with a topographic basemap.&lt;BR /&gt;Map newMap = new Map(BasemapType.DarkGrayCanvasVector, 21.339723, -157.945774, 2);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Assign the map to the MapView.&lt;BR /&gt;MyMapView.Map = newMap;&lt;BR /&gt;var test = newMap.SpatialReference;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Create a graphics overlay to hold the various graphics.&lt;BR /&gt;_graphicsOverlay = new GraphicsOverlay();&lt;/P&gt;&lt;P&gt;// Add the created graphics overlay to the MapView.&lt;BR /&gt;MyMapView.GraphicsOverlays.Add(_graphicsOverlay);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Add the map points to the point collection.&lt;BR /&gt;PointCollection newborderCountryPointCollection = new PointCollection(SpatialReferences.WebMercator)&lt;BR /&gt;{&lt;BR /&gt;(MapPoint)GeometryEngine.NormalizeCentralMeridian((MapPoint) GeometryEngine.Project(new MapPoint(-157.945774, 21.339723, SpatialReferences.Wgs84), SpatialReferences.WebMercator)),&lt;BR /&gt;(MapPoint)GeometryEngine.NormalizeCentralMeridian((MapPoint) GeometryEngine.Project(new MapPoint(167.726017, 8.719545, SpatialReferences.Wgs84), SpatialReferences.WebMercator))&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;// Create a polyline geometry from the point collection.&lt;BR /&gt;Polyline newborderCountryPolyline = new Polyline(newborderCountryPointCollection);&lt;/P&gt;&lt;P&gt;// Create a simple line symbol&lt;BR /&gt;SimpleLineSymbol newcountryBorderSimpleLineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Dot, System.Drawing.Color.Blue, 5);&lt;/P&gt;&lt;P&gt;// Create the graphic - comprised of a polyline shape and line symbol.&lt;BR /&gt;Graphic _newcountryBorderPolylineGraphic = new Graphic(newborderCountryPolyline, newcountryBorderSimpleLineSymbol);&lt;BR /&gt;_graphicsOverlay.Graphics.Add(_newcountryBorderPolylineGraphic);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts what I am missing? Or doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for the help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2019 18:10:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/polyline-not-crossing-international-dateline/m-p/496299#M6086</guid>
      <dc:creator>AlanFlythe</dc:creator>
      <dc:date>2019-07-22T18:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Polyline not crossing international Dateline</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/polyline-not-crossing-international-dateline/m-p/496300#M6087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to enter longitudes that are outside the -180 to 180 range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;If your point locations are normalized between -180 and 180 longitude (which they probably will be), add&amp;nbsp;360 if you're crossing the date line heading east, or subtract 360 if you're&amp;nbsp;crossing the dateline heading west.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, in&amp;nbsp;your example&amp;nbsp;above instead of specifying a line from &lt;SPAN style="background-color: #ffffff;"&gt;-157.945774, 21.339723 to&amp;nbsp;&lt;SPAN&gt;167.726017, 8.719545 (which is a long eastward line),&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;you want to specify&amp;nbsp;a line from&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;-157.945774, 21.339723 to -192.273983 (i.e.&amp;nbsp;167.726017 - 360)&lt;SPAN&gt;, 8.719545 (which is a shorter westward line).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;Similarly,&amp;nbsp;if&amp;nbsp;your direction of travel were reversed&amp;nbsp;you'd have a line from&amp;nbsp;167.726017, 8.719545 to&amp;nbsp;202.054226,&amp;nbsp;21.339723.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;Does that help?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2019 03:29:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/polyline-not-crossing-international-dateline/m-p/496300#M6087</guid>
      <dc:creator>Nicholas-Furness</dc:creator>
      <dc:date>2019-07-23T03:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: Polyline not crossing international Dateline</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/polyline-not-crossing-international-dateline/m-p/496301#M6088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So that does fix it for the WPF .NET&amp;nbsp; app (See the blue line below)&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/453988_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, in another application, using the ESRI Javascript API v4.12, that we are doing that had the same problem, your fix stops drawing the line at the International dateline.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/454016_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;know this is the .NET forum so I can post this question in the Javascript forum, I was just curious why this would work with .NET and not with Javascript.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2019 13:18:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/polyline-not-crossing-international-dateline/m-p/496301#M6088</guid>
      <dc:creator>AlanFlythe</dc:creator>
      <dc:date>2019-07-23T13:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: Polyline not crossing international Dateline</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/polyline-not-crossing-international-dateline/m-p/496302#M6089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmm. It does surprise me a little, although nuanced differences between Runtime and JS API are to be expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would ask the question in their space (&lt;A _jive_internal="true" class="link-titled" href="https://community.esri.com/discussion/create.jspa?containerType=14&amp;amp;containerID=2128" title="https://community.esri.com/discussion/create.jspa?containerType=14&amp;amp;containerID=2128"&gt;https://community.esri.com/discussion/create.jspa?containerType=14&amp;amp;containerID=2128&lt;/A&gt;)&amp;nbsp;and reference your comment above. Sorry I can't provide more info!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2019 13:29:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/polyline-not-crossing-international-dateline/m-p/496302#M6089</guid>
      <dc:creator>Nicholas-Furness</dc:creator>
      <dc:date>2019-07-23T13:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: Polyline not crossing international Dateline</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/polyline-not-crossing-international-dateline/m-p/496303#M6090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the help Nicholas.&lt;/P&gt;&lt;P&gt;Anyone that wants to know about the Javascript solution, here is the link&amp;nbsp;&lt;A _jive_internal="true" href="https://community.esri.com/message/866160-polyline-not-crossing-the-international-dateline"&gt;https://community.esri.com/message/866160-polyline-not-crossing-the-international-dateline&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Jul 2019 13:36:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/polyline-not-crossing-international-dateline/m-p/496303#M6090</guid>
      <dc:creator>AlanFlythe</dc:creator>
      <dc:date>2019-07-23T13:36:03Z</dc:date>
    </item>
  </channel>
</rss>

