Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Pop-up Latitude and Longitude when pressed on point feature



  • I want to display the lat,long values of a particular place on my raster image, when the marker symbol is clicked.
    I am able to display the marker but unable to display lat,long when pressed on marker symbol.


  • Lifetime Qt Champion

    Can you please be a little bit more specific on what Qt stuff you're talking about here?



  • i have a raster image onto which i have added point , line , polygon features.
    i want to display the latitude and longitude values when i click on point feature.


  • Lifetime Qt Champion

    @Sony said in Pop-up Latitude and Longitude when pressed on point feature:

    i want to display the latitude and longitude values when i click on point feature.

    So is this image geo-referenced?



  • yes, its geo-referenced and overlaying on the basemap(topographic)...now i want to add
    lat,long onto the raster image when i click on marker symbol.


  • Lifetime Qt Champion

    I'm sorry but from what Qt component are you talking? I'm not aware of any class which provides something like you mentioned...



  • void Raster_point::componentComplete()
    {
    const QString datapath = defaultDataPath() + "D:/Sony/blr.tif";

    m_raster = new Raster(m_datapath + "blr.tif",this);
    m_rasterLayer = new RasterLayer(m_raster,this);
    
    m_basemap = new Basemap(m_rasterLayer, this);
    m_map= new Map(m_basemap,this);
    m_mapView = new MapGraphicsView(this);
    m_mapView->setMap(m_map);
    
    
    GraphicsOverlay* overlay = new GraphicsOverlay(this);
     createGraphics(overlay);
     m_mapView->graphicsOverlays()->append(overlay);
    
    // set the mapView as the central widget
     setCentralWidget(m_mapView);
    

    }

    void Raster_point::createGraphics(GraphicsOverlay *overlay)
    {
    const Point center(77.599605,12.978822, SpatialReference::wgs84());

    Point point(77.599605,12.978822, SpatialReference::wgs84());
    
    SimpleMarkerSymbol* point_symbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::Diamond, QColor(Qt::blue), 15, this);
    
    Graphic* point_graphic = new Graphic(point, point_symbol, this);
    
    overlay->graphics()->append(point_graphic);
    
    m_mapView->setViewpointCenter(center, 100000);
    

    }

    this is the code for displaying raster data with simple symbol marker. next i want to just display Lat,Long for a place.


  • Lifetime Qt Champion

    But where is Qt involved here? These are ESRI Qt runtime SDK classes afaics.


Log in to reply