I have a graphic that is being updated at a regular interval (15-20hz) that I would really like to use a KML overlay for, but cannot since updating KML Overlays doesn't work in 2d maps. (Prior Conversation on GeoNet)
So I've been using a PictureMarkerSymbol with some success, but I am now observing some weirdness with it. I'm wondering if it's something I am doing wrong or if I've stumbled on another bug.
The basic workflow is the sensor (a sonar) that we're tracking feeds us a stream of QImages. I scale the QImage to the appropriate size according to our current zoom level and map scaling and create a PictureMarkerSymbol using this code block:
Esri::ArcGISRuntime::Graphic m_graphic; // declared elsewhere
Esri::ArcGISRuntime::GraphicsOverlay m_overlay; // Set up elsewhere
Esri::ArcGISRuntime::Point point; // Set up elsewhereEsri::ArcGISRuntime::PictureMarkerSymbol pms(scaled_image,this);
pms.setAngle(m_heading);
pms.setWidth(scaled_image.width());
pms.setHeight(scaled_image.height());if (m_graphic.isNull())
{
m_graphic = new Esri::ArcGISRuntime::Graphic(point, &pms);
m_overlay->graphics()->append(m_graphic);
}
else
{
m_graphic.data()->setSymbol(&pms);
m_graphic.data()->setGeometry(point);
}
The functionality is great to an extent. But when the image exceeds a certain size (in this case, 20 meters), the PictureMarkerSymbol seems to unexpectedly change its shape as demonstrated in the 3 images I have attached. The first image shows a sonar at range of 16 meters, the second a range of 19 meters; you can see the aspect ratio of the image/PictureMarkerSymbol (dim red rectangle with the sonar fan in the front of it) is a distinct rectangle.
When the range reaches 20 meters, the aspect ratio of the image / PictureMarkerSymbol changes into a square!! I know this is not in the QImage scaling code, as I've stepped through and observed the QImage itself scaling properly. The "change" happens within the PictureMarkerSymbol.
Please advise.
Regards,
Brian
Could this be happening because the PictureMarkerSymbol is a local (stack) variable?
Maybe... That isn't the way we generally test our QObject* derived classes. Could you try making it a member and delete/construct a new object (or use smart pointer) when you need to update (you are correct - you can't update the URL/QImage of the marker symbol).
Hi Lucas,
Yes, I tried making it a member of the containing class and saw no difference. Well, the rectangle-to-square distortion happened at a farther sonar range, but it definitely still happened.
Are you able to break out a simple example of the problem into a separate project I can try?
Hi Lucas,
Yes - I've got a case with Sami: 02650457 -- I uploaded a demonstration application via the FTP server yesterday.
Perfect, thanks. That's what we ultimately need - a bug logged through support so we can get it reproduced in house.