AnsweredAssumed Answered

PictureMarkerSymbol problems

Question asked by cristb1971 on Sep 29, 2020
Latest reply on Oct 5, 2020 by LDanzinger-esristaff

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 elsewhere

 

Esri::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

Attachments

Outcomes