<?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: Draw a point with a number received from a class in another file in C++. in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/draw-a-point-with-a-number-received-from-a-class/m-p/1065487#M4216</link>
    <description>&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;It seems that C++ is still not my strong point.&lt;/P&gt;&lt;P&gt;I had to create a new instance every time.&lt;/P&gt;</description>
    <pubDate>Sun, 06 Jun 2021 22:53:26 GMT</pubDate>
    <dc:creator>KanjaSousuke</dc:creator>
    <dc:date>2021-06-06T22:53:26Z</dc:date>
    <item>
      <title>Draw a point with a number received from a class in another file in C++.</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/draw-a-point-with-a-number-received-from-a-class/m-p/1063437#M4188</link>
      <description>&lt;P&gt;I want to draw a point with a number received from a class in another file.&lt;/P&gt;&lt;P&gt;The value is received, no error, but not drawn.&lt;/P&gt;&lt;P&gt;I'm still a beginner when it comes to C++.&lt;/P&gt;&lt;P&gt;Maps file:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;CppMaps::CppMaps(QObject* parent /* = nullptr */):   QObject(parent)
{
        m_map = new Map(BasemapStyle::ArcGISTopographic, this);
        myPointBuilder = new PointBuilder(SpatialReference(6668), this);
        myGraph = new Graphic();
        mySymbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::Circle, QColor("red"), 10, this);
        myGraphOverLay = new GraphicsOverlay(this);

        myGraph-&amp;gt;setSymbol(mySymbol);
        myGraphOverLay-&amp;gt;graphics()-&amp;gt;append(myGraph);

}

CppMaps::~CppMaps()
{
}

MapQuickView* CppMaps::mapView() const
{
    return m_mapView;
}

void CppMaps::setMapView(MapQuickView* mapView)
{
    if (!mapView || mapView == m_mapView)
    {
        return;
    }

    m_mapView = mapView;
    m_mapView-&amp;gt;setMap(m_map);

    m_mapView-&amp;gt;graphicsOverlays()-&amp;gt;append(myGraphOverLay);
}

void CppMaps::fnGetShow(double lat,double lon)
{
    myPointBuilder-&amp;gt;setXY(lon , lat);
    myGraph-&amp;gt;setGeometry(myPointBuilder-&amp;gt;toGeometry());
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sender file:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;void Sender::fnSend(){
    CppMaps cppMap;
    cppMap.fnGetShow(lat, lon); //lat = 0
    lon++;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;fnSend() is running on a one-second cycle in QML.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jun 2021 06:38:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/draw-a-point-with-a-number-received-from-a-class/m-p/1063437#M4188</guid>
      <dc:creator>KanjaSousuke</dc:creator>
      <dc:date>2021-06-01T06:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: Draw a point with a number received from a class in another file in C++.</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/draw-a-point-with-a-number-received-from-a-class/m-p/1065240#M4206</link>
      <description>&lt;P&gt;Couple of things I see that could be going wrong:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) In your "sender file", it is creating a new instance of CppMaps each time fsSend executes. Is this what you want, or do you want to update the map with new coordinates?&lt;/P&gt;&lt;P&gt;2) Is the spatial reference you are using correct? Your builder uses wkid 6668 - are the coordinates coming in from that coordinate system or do they need to be projected from one coordinate system to another?&lt;/P&gt;&lt;P&gt;3) Not required, but you could bypass the builder and just create a Point directly from the x/y coordinates that come through&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jun 2021 18:20:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/draw-a-point-with-a-number-received-from-a-class/m-p/1065240#M4206</guid>
      <dc:creator>LucasDanzinger</dc:creator>
      <dc:date>2021-06-04T18:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: Draw a point with a number received from a class in another file in C++.</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/draw-a-point-with-a-number-received-from-a-class/m-p/1065487#M4216</link>
      <description>&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;It seems that C++ is still not my strong point.&lt;/P&gt;&lt;P&gt;I had to create a new instance every time.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Jun 2021 22:53:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/draw-a-point-with-a-number-received-from-a-class/m-p/1065487#M4216</guid>
      <dc:creator>KanjaSousuke</dc:creator>
      <dc:date>2021-06-06T22:53:26Z</dc:date>
    </item>
  </channel>
</rss>

