<?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 Drawing on the map with mouse gestures in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/drawing-on-the-map-with-mouse-gestures/m-p/333428#M1669</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working on an application that needs to allow the user to draw certain graphical objects on top of the map view (in &lt;STRONG&gt;MapGraphicsView&lt;/STRONG&gt;). The problem I'm having is, to some extent, related also to the default behavior of the MapGraphicsView when the user presses the left mouse button and moving the mouse while holding the button down. The default behavior is that&amp;nbsp;when the user moves the mouse with the left button down, it pans the map.&lt;/P&gt;&lt;P&gt;I've learnt the intended way to stop the map from being panned by calling &lt;STRONG&gt;accept()&lt;/STRONG&gt; on the &lt;STRONG&gt;event&lt;/STRONG&gt; object inside the &lt;STRONG&gt;geoViewMouseMoveEvent&lt;/STRONG&gt; virtual method of my subclass.&lt;/P&gt;&lt;P&gt;Now what I need to achieve is to draw in response to the mouse movement, for instance a line from the starting point where the user pressed down the mouse, to the current mouse cursor position in real time while the user keeps the button down. I also will need to show some tooltip-like numerical info along the drawn line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I call &lt;STRONG&gt;accept()&lt;/STRONG&gt; on the event object, it not only stops the map from being panned, but it also stops any &lt;STRONG&gt;paintEvent&lt;/STRONG&gt; to be fired while moving the mouse with the button pressed (and consequentially no &lt;STRONG&gt;drawForground&lt;/STRONG&gt; or &lt;STRONG&gt;drawBackground&lt;/STRONG&gt; get called) until the accept() stops being called.&lt;/P&gt;&lt;P&gt;I tried to call update() from inside the &lt;STRONG&gt;geoViewMouseMoveEvent&lt;/STRONG&gt;&amp;nbsp;hoping that it would coerce the MapGraphicsView to call painting&amp;nbsp; methods but with no success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;My question is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;How do I achieve painting/redrawing to be called while blocking the map panning (as described above)&amp;nbsp;when the user presses the left mouse button down and drags the mouse?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;Gabe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mapgraphicsview‌ &lt;A href="https://community.esri.com/t5/tag/painting/tg-p"&gt;#painting&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Sep 2018 08:12:08 GMT</pubDate>
    <dc:creator>GabeLevy</dc:creator>
    <dc:date>2018-09-20T08:12:08Z</dc:date>
    <item>
      <title>Drawing on the map with mouse gestures</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/drawing-on-the-map-with-mouse-gestures/m-p/333428#M1669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working on an application that needs to allow the user to draw certain graphical objects on top of the map view (in &lt;STRONG&gt;MapGraphicsView&lt;/STRONG&gt;). The problem I'm having is, to some extent, related also to the default behavior of the MapGraphicsView when the user presses the left mouse button and moving the mouse while holding the button down. The default behavior is that&amp;nbsp;when the user moves the mouse with the left button down, it pans the map.&lt;/P&gt;&lt;P&gt;I've learnt the intended way to stop the map from being panned by calling &lt;STRONG&gt;accept()&lt;/STRONG&gt; on the &lt;STRONG&gt;event&lt;/STRONG&gt; object inside the &lt;STRONG&gt;geoViewMouseMoveEvent&lt;/STRONG&gt; virtual method of my subclass.&lt;/P&gt;&lt;P&gt;Now what I need to achieve is to draw in response to the mouse movement, for instance a line from the starting point where the user pressed down the mouse, to the current mouse cursor position in real time while the user keeps the button down. I also will need to show some tooltip-like numerical info along the drawn line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I call &lt;STRONG&gt;accept()&lt;/STRONG&gt; on the event object, it not only stops the map from being panned, but it also stops any &lt;STRONG&gt;paintEvent&lt;/STRONG&gt; to be fired while moving the mouse with the button pressed (and consequentially no &lt;STRONG&gt;drawForground&lt;/STRONG&gt; or &lt;STRONG&gt;drawBackground&lt;/STRONG&gt; get called) until the accept() stops being called.&lt;/P&gt;&lt;P&gt;I tried to call update() from inside the &lt;STRONG&gt;geoViewMouseMoveEvent&lt;/STRONG&gt;&amp;nbsp;hoping that it would coerce the MapGraphicsView to call painting&amp;nbsp; methods but with no success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;My question is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;How do I achieve painting/redrawing to be called while blocking the map panning (as described above)&amp;nbsp;when the user presses the left mouse button down and drags the mouse?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;Gabe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mapgraphicsview‌ &lt;A href="https://community.esri.com/t5/tag/painting/tg-p"&gt;#painting&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2018 08:12:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/drawing-on-the-map-with-mouse-gestures/m-p/333428#M1669</guid>
      <dc:creator>GabeLevy</dc:creator>
      <dc:date>2018-09-20T08:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing on the map with mouse gestures</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/drawing-on-the-map-with-mouse-gestures/m-p/333429#M1670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should be able to accept the mouse signals and draw on the screen. An engineer on our team wrote up a simple example of this (attached). Can you give this a try?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2018 17:56:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/drawing-on-the-map-with-mouse-gestures/m-p/333429#M1670</guid>
      <dc:creator>LucasDanzinger</dc:creator>
      <dc:date>2018-09-24T17:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing on the map with mouse gestures</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/drawing-on-the-map-with-mouse-gestures/m-p/333430#M1671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lucas,&lt;/P&gt;&lt;P&gt;Thanks for the reply and the sample code.&lt;/P&gt;&lt;P&gt;I tried the concept from your team's example but implemented it in our real project and yes, &lt;SPAN style="text-decoration: underline;"&gt;it does work&lt;/SPAN&gt;. Thank you for the guidance.&lt;/P&gt;&lt;P&gt;The error I've made was that I wanted to bypass the&lt;STRONG&gt; Scene/GraphicsItem&lt;/STRONG&gt; paradigm and draw some simple things directly in MapGraphicsView::&lt;STRONG&gt;drawForeground&lt;/STRONG&gt;(...) method of my subclass by handling the &lt;STRONG&gt;mouseMoveEvent&lt;/STRONG&gt; on the said view class. I assumed that both ways would interchangeably work, which is obviously not the case.&lt;/P&gt;&lt;P&gt;It's better to follow the Scene/GraphicsItem paradigm anyway to make the "separation of concerns" principle more uniform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;Gabe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2018 05:10:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/drawing-on-the-map-with-mouse-gestures/m-p/333430#M1671</guid>
      <dc:creator>GabeLevy</dc:creator>
      <dc:date>2018-09-25T05:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing on the map with mouse gestures</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/drawing-on-the-map-with-mouse-gestures/m-p/1095960#M4411</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/246649"&gt;@GabeLevy&lt;/a&gt;&amp;nbsp;-&amp;nbsp;the 100.12 release of ArcGIS Runtime now supports a SketchEditor, which greatly simplifies the workflow for sketching geometries on a map. This might be something worth considering integrating into your app. More details are in the release blog -&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-runtime-sdks-blog/sketcheditor-now-available-in-the-arcgis-runtime/ba-p/1094221" target="_blank"&gt;https://community.esri.com/t5/arcgis-runtime-sdks-blog/sketcheditor-now-available-in-the-arcgis-runtime/ba-p/1094221&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 15:14:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/drawing-on-the-map-with-mouse-gestures/m-p/1095960#M4411</guid>
      <dc:creator>LucasDanzinger</dc:creator>
      <dc:date>2021-09-07T15:14:59Z</dc:date>
    </item>
  </channel>
</rss>

