<?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 How to move (or dynamically create and delete) markers in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-move-or-dynamically-create-and-delete/m-p/1086037#M4374</link>
    <description>&lt;P&gt;I have a very simple task for a QML app, but it's proving to be harder than I expected. I would like to display a set of markers, and then as a function of user input redraw a different set of markers. There are several examples I found for building geometries, but none of tearing them down, nor moving them.&lt;/P&gt;&lt;P&gt;What is the simplest way to accomplish this?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Aug 2021 02:45:51 GMT</pubDate>
    <dc:creator>KennSebesta</dc:creator>
    <dc:date>2021-08-05T02:45:51Z</dc:date>
    <item>
      <title>How to move (or dynamically create and delete) markers</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-move-or-dynamically-create-and-delete/m-p/1086037#M4374</link>
      <description>&lt;P&gt;I have a very simple task for a QML app, but it's proving to be harder than I expected. I would like to display a set of markers, and then as a function of user input redraw a different set of markers. There are several examples I found for building geometries, but none of tearing them down, nor moving them.&lt;/P&gt;&lt;P&gt;What is the simplest way to accomplish this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 02:45:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-move-or-dynamically-create-and-delete/m-p/1086037#M4374</guid>
      <dc:creator>KennSebesta</dc:creator>
      <dc:date>2021-08-05T02:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to move (or dynamically create and delete) markers</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-move-or-dynamically-create-and-delete/m-p/1086154#M4375</link>
      <description>&lt;P&gt;To add a new graphic marker on the map, you can follow this sample -&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-runtime-samples-qt/tree/main/ArcGISRuntimeSDKQt_QMLSamples/DisplayInformation/Simple_Marker_Symbol" target="_blank"&gt;https://github.com/Esri/arcgis-runtime-samples-qt/tree/main/ArcGISRuntimeSDKQt_QMLSamples/DisplayInformation/Simple_Marker_Symbol&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The graphic is the visual object, which contains geometry (where to display) and a symbol (how to display it).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After you have created a graphic, you can indefinitely assign new Point objects to the Graphic, and it will update (move) location:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const pt = ArcGISRuntimeEnvironment.createObject("Point", {x: 1.2, y: 3.4});
graphic.geometry = pt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To remove/tear down the graphic, simply remove the graphic from the graphics overlay:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;graphicsOverlay.graphics.removeOne(graphic);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-graphiclistmodel.html" target="_blank"&gt;https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-graphiclistmodel.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 14:13:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-move-or-dynamically-create-and-delete/m-p/1086154#M4375</guid>
      <dc:creator>LucasDanzinger</dc:creator>
      <dc:date>2021-08-05T14:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to move (or dynamically create and delete) markers</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-move-or-dynamically-create-and-delete/m-p/1087207#M4377</link>
      <description>&lt;P&gt;Thanks! As an addition to your suggestions, I also found that I could just nuke the entire set of points by `&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;graphicsOverlay&lt;/SPAN&gt;.graphics.clear()&lt;/PRE&gt;&lt;P&gt;This lets me sidestep the problem of building the scaffold to tracking individual points separately.&lt;/P&gt;&lt;P&gt;Could I humbly suggest expanding the list of examples to include simple manipulation of points? I think what made it confusing is that move and remove markers can only happen in JS code, whereas the simple creation of the point happens quite naturally in QML.C.f.&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-runtime-samples-qt/blob/main/ArcGISRuntimeSDKQt_QMLSamples/DisplayInformation/Simple_Marker_Symbol/Simple_Marker_Symbol.qml#L51," target="_blank" rel="noopener"&gt;https://github.com/Esri/arcgis-runtime-samples-qt/blob/main/ArcGISRuntimeSDKQt_QMLSamples/DisplayInformation/Simple_Marker_Symbol/Simple_Marker_Symbol.qml#L5&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 18:26:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-move-or-dynamically-create-and-delete/m-p/1087207#M4377</guid>
      <dc:creator>KennSebesta</dc:creator>
      <dc:date>2021-08-09T18:26:17Z</dc:date>
    </item>
  </channel>
</rss>

