AnsweredAssumed Answered

How can I accent interesting point from GraphicListModel object on a map.

Question asked by FerrariRace on Sep 28, 2017
Latest reply on Oct 25, 2017 by FerrariRace

Hi ersi! I have some difficulties in accent interesting object on a map. I have GrapicsListModel which consist of 3 point objects and i want to accent one of them by  clicking on it. I have this realization.


connect(m_mapView, &MapQuickView::mouseClicked, this, [this](QMouseEvent& mouseEvent){
      //Point tmpPnt(-110.829004, 44.462438, SpatialReference::wgs84());

       Point tmpPnt = m_mapView->screenToLocation(mouseEvent.x(), mouseEvent.y());
      std::map<std::pair<long,long>,Graphic*>::iterator it;
      it = find_if(CoordinateContainer.begin(),CoordinateContainer.end(),
                   [&](const std::map<std::pair<long,long>,Graphic*>::value_type &st){
          return ((round(st.first.first * 1e5)) == (round(tmpPnt.x()*1e5)))
                  ((round(st.first.second*1e5)) == (round(tmpPnt.y()*1e5)));      });
      if (it == CoordinateContainer.end())
        mouseFlag = true;
      } else {
         mouseFlag = false;


This is very simple function, all Graphic objects was added into GraphicListModel object.


void PointsMap::addPoint( long latitude, long lognitude,Point &point)
    Graphic* graphic = new Graphic(point,compositeSymbol,this);
    // Set data into container for searching on the map.
    CoordinateContainer[std::pair<long,long>(latitude,longitude)] = graphic;



I saw interesting example - UpdateAttributesFeatureService.


In there was used identifyLayer object, but i don't now how to add GraphicListModel or GraphicsOverlay object in it, how accent on interesting point(object) by clicking on it. (By clicking i obtain longitude and latitude.)


Way that I used depends on Scaling, it's not so precise. Also I want to display Callout that show meta data for this point. How can i do that? Is there some ways to place a unique identifier for every Graphics object and find it by using this unique key. Also Point have to be initialized by it coordinates, when i click on it. Wright now i use map with pointers on Graphic, or i use "at" method, but it identifies by index. Can i do it more elegant and more precise (I don't want to depend on scaling factor)?

I have some method that change coordinates of point, It change position by signal, if i accent on object i want that Callout would change position also.


Please, could anyone answer me. Or show some methods.