<?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 Re: Get coordinates of polyline in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-coordinates-of-polyline/m-p/1455370#M84563</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/666601"&gt;@JamesIng&lt;/a&gt;, thank you. your answer is what i was looking for&lt;/P&gt;</description>
    <pubDate>Mon, 13 May 2024 06:42:09 GMT</pubDate>
    <dc:creator>Vakhtang_Zubiashvili</dc:creator>
    <dc:date>2024-05-13T06:42:09Z</dc:date>
    <item>
      <title>Get coordinates of polyline</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-coordinates-of-polyline/m-p/1409777#M84319</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I want to get screenPoints of polyline (maybe array of points, no problem). For point features i use code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;SPAN&gt;projection&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;load&lt;/SPAN&gt;&lt;SPAN&gt;().&lt;/SPAN&gt;&lt;SPAN&gt;then&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;function&lt;/SPAN&gt;&lt;SPAN&gt; () {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;/DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;let&lt;/SPAN&gt; &lt;SPAN&gt;screenPoint&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;view&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;toScreen&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;geometry&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;console&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;log&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;screenPoint&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;x,&amp;nbsp;screenPoint.y&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV&gt;&lt;SPAN&gt;and it works fine, but how can achieve this for polyline?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks in advance&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 15 Apr 2024 15:40:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-coordinates-of-polyline/m-p/1409777#M84319</guid>
      <dc:creator>Vakhtang_Zubiashvili</dc:creator>
      <dc:date>2024-04-15T15:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Get coordinates of polyline</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-coordinates-of-polyline/m-p/1410036#M84336</link>
      <description>&lt;P&gt;A polyLine is just a series of points inside a 'paths' array.&lt;BR /&gt;&lt;BR /&gt;You can just use a javascript .forEach() to go through each point in the array create a new Point from the coordinates and to output the screenPoint.&lt;BR /&gt;Note polyLines can have multiple line segments so you'll want to check each line segment as well.&lt;BR /&gt;&lt;BR /&gt;//pseduoCode example&lt;BR /&gt;const polyLine = feature.geometry // Your polyLine feature.&lt;BR /&gt;&amp;nbsp;polyLine.paths.forEach((path) =&amp;gt; { //for each line segment inside your polyLine&lt;BR /&gt;path.forEach((coordinates) =&amp;gt; { //for each coordinate in your line segment&lt;BR /&gt;const newPoint = new Point(...) //create a new Point using the path coordinates&lt;BR /&gt;&lt;SPAN&gt;let&lt;/SPAN&gt; &lt;SPAN&gt;screenPoint&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;view&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;toScreen&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;newPoint &lt;/SPAN&gt;&lt;SPAN&gt;);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;console.log(screenPoint.x,&amp;nbsp;screenPoint.y);&lt;BR /&gt;&lt;/SPAN&gt;})&lt;BR /&gt;})&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 02:02:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-coordinates-of-polyline/m-p/1410036#M84336</guid>
      <dc:creator>JamesIng</dc:creator>
      <dc:date>2024-04-16T02:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Get coordinates of polyline</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-coordinates-of-polyline/m-p/1455370#M84563</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/666601"&gt;@JamesIng&lt;/a&gt;, thank you. your answer is what i was looking for&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 06:42:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/get-coordinates-of-polyline/m-p/1455370#M84563</guid>
      <dc:creator>Vakhtang_Zubiashvili</dc:creator>
      <dc:date>2024-05-13T06:42:09Z</dc:date>
    </item>
  </channel>
</rss>

