I have been following the the two very beginning tutorials, the first being display a map and the second being add a point, line and polyline. I tweaked just a little so that rather than hard coding the points in from the start I allow for a mouse click which would add a new graphic point at that location. I have the mouse event and the location recognized and have created a graphic symbol (a point) at that location. What I'm stuck on is now having that point display on the map. I'm not quite sure what notifier I need to use so that the map can know there was a change and then display that change.
display_a_map.cpp
void Display_a_map::mapClickHandler(QMouseEvent &event)
{
Point clickedPoint = m_mapView->screenToLocation(event.x(), event.y());
GraphicsOverlay* overlay = new GraphicsOverlay(this);
createGraphics(overlay, clickedPoint.x(), clickedPoint.y());
m_mapView->graphicsOverlays()->append(overlay);
//Point graphic created. Now needs to be displayed
}
void Display_a_map::createGraphics(GraphicsOverlay *overlay)
{
const Point dume_beach(-118.80657463861, 34.0005930608889, SpatialReference::wgs84());
//const Point dume_beach(pointX, pointY, SpatialReference::wgs84());
// Create symbols for the point
SimpleLineSymbol* point_outline = new SimpleLineSymbol(SimpleLineSymbolStyle::Solid, QColor(Qt::blue), 3, this);
SimpleMarkerSymbol* point_symbol = new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::Circle, QColor(Qt::blue), 10, this);
point_symbol->setOutline(point_outline);
// Create a graphic to display the point with its symbology
Graphic* point_graphic = new Graphic(dume_beach, point_symbol, this);
// Add point graphic to the graphics overlay
overlay->graphics()->append(point_graphic);
}