<?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: How do you move a graphic smoothly on the map? in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/how-do-you-move-a-graphic-smoothly-on-the-map/m-p/418760#M1305</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to update the location of a graphic you just need to apply a new geometry to it.&amp;nbsp; This&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-runtime-samples-java/tree/master/src/main/java/com/esri/samples/displayinformation/update_graphics"&gt;sample&lt;/A&gt;&amp;nbsp;shows the basics.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-runtime-samples-java/tree/master/src/main/java/com/esri/samples/scene/animate_3d_graphic"&gt;sample&lt;/A&gt;&amp;nbsp;shows how you can do this with a 3D symbol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If however your jerky movements are due to your point moving a large distance then you'll need to write some interpolation code to achieve this.&amp;nbsp; You can work out interim points for a smooth motion by using&amp;nbsp;&lt;A class="link-titled" href="https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm" title="https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm"&gt;Bresenham's line algorithm - Wikipedia&lt;/A&gt;&amp;nbsp;which is pretty easy to implement if you are working in a projected coordinate system.&amp;nbsp; I'm sure there are other alternatives you could try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does that help?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Jan 2019 15:54:39 GMT</pubDate>
    <dc:creator>MarkBaird</dc:creator>
    <dc:date>2019-01-17T15:54:39Z</dc:date>
    <item>
      <title>How do you move a graphic smoothly on the map?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-do-you-move-a-graphic-smoothly-on-the-map/m-p/418759#M1304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've got a car (graphic) that I get a new location every second.&lt;/P&gt;&lt;P&gt;Is there an easy way to move the car smoothly on the map? rather than having the car move in a jerky type motion?&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2019 00:22:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-do-you-move-a-graphic-smoothly-on-the-map/m-p/418759#M1304</guid>
      <dc:creator>stevemclaughlin</dc:creator>
      <dc:date>2019-01-15T00:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do you move a graphic smoothly on the map?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-do-you-move-a-graphic-smoothly-on-the-map/m-p/418760#M1305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to update the location of a graphic you just need to apply a new geometry to it.&amp;nbsp; This&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-runtime-samples-java/tree/master/src/main/java/com/esri/samples/displayinformation/update_graphics"&gt;sample&lt;/A&gt;&amp;nbsp;shows the basics.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-runtime-samples-java/tree/master/src/main/java/com/esri/samples/scene/animate_3d_graphic"&gt;sample&lt;/A&gt;&amp;nbsp;shows how you can do this with a 3D symbol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If however your jerky movements are due to your point moving a large distance then you'll need to write some interpolation code to achieve this.&amp;nbsp; You can work out interim points for a smooth motion by using&amp;nbsp;&lt;A class="link-titled" href="https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm" title="https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm"&gt;Bresenham's line algorithm - Wikipedia&lt;/A&gt;&amp;nbsp;which is pretty easy to implement if you are working in a projected coordinate system.&amp;nbsp; I'm sure there are other alternatives you could try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does that help?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2019 15:54:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-do-you-move-a-graphic-smoothly-on-the-map/m-p/418760#M1305</guid>
      <dc:creator>MarkBaird</dc:creator>
      <dc:date>2019-01-17T15:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do you move a graphic smoothly on the map?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-do-you-move-a-graphic-smoothly-on-the-map/m-p/418761#M1306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had another flash of inspiration for working out interim points!&amp;nbsp; It would be far easier if you did this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;- Take your old point and your new point and make them into a 2 point polyline&lt;/P&gt;&lt;P&gt;&amp;nbsp;- Densify the line to the number of interim points you want.&amp;nbsp; See&amp;nbsp;&lt;A href="https://developers.arcgis.com/java/latest/api-reference/reference/com/esri/arcgisruntime/geometry/GeometryEngine.html#densify(com.esri.arcgisruntime.geometry.Geometry,%20double)"&gt;GeometryEngine.desify&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;- Crack open the geometry to extract the points which make up the densified polyline&lt;/P&gt;&lt;P&gt;&amp;nbsp;- Move the graphic to each interim point for a very short period of time (you'll need to experiment with this)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above method would work with any spatial reference.&amp;nbsp; Not such an exciting solution from a software engineering point of view, but much easier.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2019 10:51:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-do-you-move-a-graphic-smoothly-on-the-map/m-p/418761#M1306</guid>
      <dc:creator>MarkBaird</dc:creator>
      <dc:date>2019-01-18T10:51:18Z</dc:date>
    </item>
  </channel>
</rss>

