<?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 Arrow symbol on polyline graphic in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arrow-symbol-on-polyline-graphic/m-p/314971#M28952</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a polyline graphic and need directional arrows at least at the start and end of the line. I've used the vertices to place a marker at the start and finish, but I don't know what direction it's going.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Jan 2012 14:34:43 GMT</pubDate>
    <dc:creator>KyleDixon</dc:creator>
    <dc:date>2012-01-26T14:34:43Z</dc:date>
    <item>
      <title>Arrow symbol on polyline graphic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arrow-symbol-on-polyline-graphic/m-p/314971#M28952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a polyline graphic and need directional arrows at least at the start and end of the line. I've used the vertices to place a marker at the start and finish, but I don't know what direction it's going.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2012 14:34:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arrow-symbol-on-polyline-graphic/m-p/314971#M28952</guid>
      <dc:creator>KyleDixon</dc:creator>
      <dc:date>2012-01-26T14:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Arrow symbol on polyline graphic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arrow-symbol-on-polyline-graphic/m-p/314972#M28953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If I understand correctly, you need to calculate the bearing of a line. I put together a simple way to do this on jsfiddle:&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://jsfiddle.net/swingley/RnAhz/" rel="nofollow noopener noreferrer" target="_blank"&gt;show arrows at the end of a line&lt;/A&gt;&lt;SPAN&gt;. The symbol used there is kind of ugly but you get the idea.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The key part is calculating the angle of the line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
p1 = geometry.paths[0][0];
p2 = geometry.paths[0][1];
var rise = p2[1] - p1[1];
var run = p2[0] - p1[0];
angle = (180/Math.PI) * Math.atan2(run, rise);
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Once you have the angle, put a picture marker symbol on each end of the line. Rotate the symbol on the end point to the angle you calculated and rotate the symbol on the start of the line to 180 - the angle.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:59:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arrow-symbol-on-polyline-graphic/m-p/314972#M28953</guid>
      <dc:creator>derekswingley1</dc:creator>
      <dc:date>2021-12-11T14:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: Arrow symbol on polyline graphic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arrow-symbol-on-polyline-graphic/m-p/314973#M28954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know this is super old, but I came across this post while looking for a similar solution, so sharing my eventual solution here. Ended up building a custom line symbol to handle this. It's on github here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/nickcam/DirectionalLineSymbol" title="https://github.com/nickcam/DirectionalLineSymbol"&gt;nickcam/DirectionalLineSymbol · GitHub&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Might help some others stumbling across this in the near future.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Aug 2015 13:41:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arrow-symbol-on-polyline-graphic/m-p/314973#M28954</guid>
      <dc:creator>NickCameron2</dc:creator>
      <dc:date>2015-08-22T13:41:26Z</dc:date>
    </item>
  </channel>
</rss>

