<?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 Coordinate Conversion C++ in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/coordinate-conversion-c/m-p/416081#M2095</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am&amp;nbsp; trying to convert the view coordinates (Upper left and lower right corners) to real world coords in lat/lon, and can't figure it out.&amp;nbsp;&amp;nbsp;We are on version 100.4 of the Qt C++ SDK.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the setup that I am using:&lt;/P&gt;&lt;P&gt;m_mapView = new MapGraphicsView(this);&lt;/P&gt;&lt;P&gt;// Create a map using the openStreetMap Basemap&lt;BR /&gt; m_map = new Map(BasemapType::OpenStreetMap,37.22296, -80.4139, 12);&lt;BR /&gt; m_mapView-&amp;gt;setMap(m_map);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Sep 2020 15:04:17 GMT</pubDate>
    <dc:creator>RobLefebvre</dc:creator>
    <dc:date>2020-09-15T15:04:17Z</dc:date>
    <item>
      <title>Coordinate Conversion C++</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/coordinate-conversion-c/m-p/416081#M2095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am&amp;nbsp; trying to convert the view coordinates (Upper left and lower right corners) to real world coords in lat/lon, and can't figure it out.&amp;nbsp;&amp;nbsp;We are on version 100.4 of the Qt C++ SDK.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the setup that I am using:&lt;/P&gt;&lt;P&gt;m_mapView = new MapGraphicsView(this);&lt;/P&gt;&lt;P&gt;// Create a map using the openStreetMap Basemap&lt;BR /&gt; m_map = new Map(BasemapType::OpenStreetMap,37.22296, -80.4139, 12);&lt;BR /&gt; m_mapView-&amp;gt;setMap(m_map);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2020 15:04:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/coordinate-conversion-c/m-p/416081#M2095</guid>
      <dc:creator>RobLefebvre</dc:creator>
      <dc:date>2020-09-15T15:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate Conversion C++</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/coordinate-conversion-c/m-p/416082#M2096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To do this you would make use of the MapGraphicsViews screenToLocation function - passing it the coordinates from your view. The upper left corner would be 0,0 in view coordinates and you should be able to get the lower right by taking the width/height of your map view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-runtime-samples-qt/blob/8252c8205325f0b5ce9c1e3145d3ba8c6da744d3/ArcGISRuntimeSDKQt_CppSamples/Routing/OfflineRouting/OfflineRouting.cpp#L193"&gt;This sample&lt;/A&gt;&amp;nbsp;shows&amp;nbsp;a different use of that functionality (reacting to a user clicking on the screen) but tghe principle is the same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2020 15:30:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/coordinate-conversion-c/m-p/416082#M2096</guid>
      <dc:creator>LukeSmallwood</dc:creator>
      <dc:date>2020-09-15T15:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate Conversion C++</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/coordinate-conversion-c/m-p/416083#M2097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We definitely saw that call, and tried it, see below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// Create the Widget view&lt;BR /&gt; m_mapView = new MapGraphicsView(this);&lt;/P&gt;&lt;P&gt;// Create a map using the openStreetMap Basemap&lt;BR /&gt; m_map = new Map(BasemapType::OpenStreetMap,37.22296, -80.4139, 12);&lt;BR /&gt; m_mapView-&amp;gt;setMap(m_map);&lt;BR /&gt; const Point center(-80.252381, 37.227047, SpatialReference::wgs84());&lt;BR /&gt; const Viewpoint viewpoint(center, 300000.0);&lt;BR /&gt; m_map-&amp;gt;setInitialViewpoint(viewpoint);&lt;BR /&gt;&lt;BR /&gt; auto mapRect = m_mapView-&amp;gt;rect();&lt;BR /&gt; auto b = m_mapView-&amp;gt;screenToLocation(0.0, 0.0);&lt;BR /&gt; QString str = QString::number(b.x()) + QString::number(b.y());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When we do this, the b.x() and b.y() are NAN.&amp;nbsp; Is there an initialization step that I'm missing somewhere?&amp;nbsp; We can display the map, move around, load raster layers, etc., but no Lat/Lon &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2020 16:08:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/coordinate-conversion-c/m-p/416083#M2097</guid>
      <dc:creator>RobLefebvre</dc:creator>
      <dc:date>2020-09-15T16:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate Conversion C++</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/coordinate-conversion-c/m-p/416084#M2098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob - can you confirm the map is loaded before you make the screenToLocation call? You can use the Map's doneLoading or loadStatusChanged signals to wait for that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2020 16:53:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/coordinate-conversion-c/m-p/416084#M2098</guid>
      <dc:creator>LukeSmallwood</dc:creator>
      <dc:date>2020-09-15T16:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate Conversion C++</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/coordinate-conversion-c/m-p/416085#M2099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We added a connect for the signal(s) mentioned, and they are NOT being hit.&amp;nbsp; We tried both to a Lambda and a method, but&amp;nbsp; none were executed.&amp;nbsp; We also set a QTimer to fire every second, and re-try to get the info from the map, but to no avail.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #808000;"&gt;void&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;TestMap&lt;/SPAN&gt;::&lt;SPAN style="color: #00677c; font-weight: 600;"&gt;mapDoneLoading&lt;/SPAN&gt;(&lt;SPAN style="color: #800080;"&gt;Esri&lt;/SPAN&gt;::&lt;SPAN style="color: #800080;"&gt;ArcGISRuntime&lt;/SPAN&gt;::&lt;SPAN style="color: #800080;"&gt;Error&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #092e64;"&gt;loadError&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;{&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #c0c0c0;"&gt;    &lt;/SPAN&gt;&lt;SPAN style="color: #808000;"&gt;auto&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #092e64;"&gt;mapRect&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;=&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;m_mapView&lt;/SPAN&gt;-&amp;gt;&lt;SPAN style="color: #00677c;"&gt;rect&lt;/SPAN&gt;();&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #c0c0c0;"&gt;    &lt;/SPAN&gt;&lt;SPAN style="color: #808000;"&gt;auto&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #092e64;"&gt;b&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;=&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;m_mapView&lt;/SPAN&gt;-&amp;gt;&lt;SPAN style="color: #00677c;"&gt;screenToLocation&lt;/SPAN&gt;(&lt;SPAN style="color: #000080;"&gt;0.0&lt;/SPAN&gt;,&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;0.0&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #c0c0c0;"&gt;    &lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;QString&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #092e64;"&gt;str&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;=&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;QString&lt;/SPAN&gt;::&lt;SPAN style="color: #00677c;"&gt;number&lt;/SPAN&gt;(&lt;SPAN style="color: #092e64;"&gt;b&lt;/SPAN&gt;.&lt;SPAN style="color: #00677c;"&gt;x&lt;/SPAN&gt;())&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;+&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;QString&lt;/SPAN&gt;::&lt;SPAN style="color: #00677c;"&gt;number&lt;/SPAN&gt;(&lt;SPAN style="color: #092e64;"&gt;b&lt;/SPAN&gt;.&lt;SPAN style="color: #00677c;"&gt;y&lt;/SPAN&gt;());&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #c0c0c0;"&gt;     &lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;QString&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #092e64;"&gt;sceneRectUL&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;=&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;CoordinateFormatter&lt;/SPAN&gt;::&lt;SPAN style="color: #00677c;"&gt;toLatitudeLongitude&lt;/SPAN&gt;(&lt;SPAN style="color: #800080;"&gt;Point&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;m_mapView&lt;/SPAN&gt;-&amp;gt;&lt;SPAN style="color: #00677c;"&gt;rect&lt;/SPAN&gt;().&lt;SPAN style="color: #00677c;"&gt;topLeft&lt;/SPAN&gt;().&lt;SPAN style="color: #00677c;"&gt;x&lt;/SPAN&gt;(),&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;m_mapView&lt;/SPAN&gt;-&amp;gt;&lt;SPAN style="color: #00677c;"&gt;rect&lt;/SPAN&gt;().&lt;SPAN style="color: #00677c;"&gt;topLeft&lt;/SPAN&gt;().&lt;SPAN style="color: #00677c;"&gt;y&lt;/SPAN&gt;()),&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;LatitudeLongitudeFormat&lt;/SPAN&gt;::&lt;SPAN style="color: #800080;"&gt;DecimalDegrees&lt;/SPAN&gt;,&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;4&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #c0c0c0;"&gt;     &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;qDebug&lt;/SPAN&gt;()&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&amp;lt;&amp;lt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;"Scene&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;Coords:&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt;  &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;"&lt;/SPAN&gt;&amp;lt;&amp;lt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #092e64;"&gt;sceneRectUL&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;}&lt;/PRE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #00677c;"&gt;
connect&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;m_map&lt;/SPAN&gt;,&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&amp;amp;&lt;SPAN style="color: #800080;"&gt;Map&lt;/SPAN&gt;::doneLoading,&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #808000;"&gt;this&lt;/SPAN&gt;,&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&amp;amp;&lt;SPAN style="color: #800080;"&gt;TestMap&lt;/SPAN&gt;::mapDoneLoading);


&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:26:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/coordinate-conversion-c/m-p/416085#M2099</guid>
      <dc:creator>RobLefebvre</dc:creator>
      <dc:date>2021-12-12T16:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate Conversion C++</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/coordinate-conversion-c/m-p/416086#M2100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob - does&amp;nbsp; the map render correctly? e.g. do you see the OpenStreetmap basemap you set above? If it's rendering then the map is loading.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One possibility could be that you connect to the signal after loading is complete. The loading cycle will be kicked off as soon as you call&amp;nbsp;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;m_mapView-&amp;gt;setMap(m_map);. &lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Can you make sure you set up the connection as soon as you construct the map?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Another observation is that you are setting the initial viewpoint for the map after you set it on the mapView (&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;m_map-&amp;gt;setInitialViewpoint(viewpoint);&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;). For this to have an affect you need to do that before passing the map to the mapView as well.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2020 08:28:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/coordinate-conversion-c/m-p/416086#M2100</guid>
      <dc:creator>LukeSmallwood</dc:creator>
      <dc:date>2020-09-16T08:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: Coordinate Conversion C++</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/coordinate-conversion-c/m-p/416087#M2101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;This morning, in the doneLoading slot connection, the transformations don't work.  
However, if we capture a mouse click, and try to do transformations there, they are working fine.
Also, if we set a timer for 1 second, after we set the map and view up, the translations work fine too.  
Strange, for sure...&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:26:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/coordinate-conversion-c/m-p/416087#M2101</guid>
      <dc:creator>RobLefebvre</dc:creator>
      <dc:date>2021-12-12T16:26:42Z</dc:date>
    </item>
  </channel>
</rss>

