I have a GraphicsOverlay containing the radar image pixel points. I am basically converting points from polar coordinates to geodetic coordinates and adding one point Geometry to my overlay for each point. Points represent the pixels in radar image. This overlay makes the exe too slow and uses excessive memory. How can I make my program be faster so that I can zoom in and out seamlessly? Is there any alternative other than GraphicsOverlay to add pixel points on top of map?
void MapViewer::slotDrawOnePixel(GeodeticCoord pos, QColor color){
simpleMarkerSymbol->setColor(color);
QPair<int,int> geodeticPos(pos.mLongitude.Degree()*100, pos.mLatitude.Degree()*100);
if(!mPointMap.contains(geodeticPos)){
Graphic *newPoint = new Graphic(createPoint(pos), simpleMarkerSymbol, this);
mGraphicsOverlay->graphics()->append(newPoint);
mPointMap[geodeticPos] = newPoint;
}
else{
mPointMap[geodeticPos]->setSymbol(simpleMarkerSymbol);
}
}
Geometry MapViewer::createPoint(GeodeticCoord pos)
{
double x = pos.mLongitude.Degree();
double y = pos.mLatitude.Degree();
const SpatialReference spatialRef(4326);
return Point(x, y, spatialRef);
}