LocationChanged without altitude

665
5
08-12-2018 06:59 AM
Kai_Wellmann
New Contributor II

I have written a small app with qt and arcgis 100.3. When the gps information changes the slot LocationChanged is called. I thought that I would get the altitude from Location.position.z. But I always get 0 for the altitude.

What do I have to do to get the actual altitude?

void FlightMap::locationChanged(Esri::ArcGISRuntime::Location location)
{

Point pos=location.position();
x=pos.x();
y=pos.y();
z=pos.z();

}

0 Kudos
5 Replies
LucasDanzinger
Esri Frequent Contributor

What signal are you connecting to for this slot?

0 Kudos
Kai_Wellmann
New Contributor II

connect(m_MapView->locationDisplay(),SIGNAL(locationChanged(Esri::ArcGISRuntime::Location)),this,SLOT(locationChanged(Esri::ArcGISRuntime::Location)));

0 Kudos
LucasDanzinger
Esri Frequent Contributor

Hi Kai-

The LocationDisplay is the view component for Qt's QGeoPositionInfoSource. Can you try creating a QGeoPositionInfoSource and listening to it's positionUpdated signal? QGeoPositionInfoSource Class | Qt Positioning 5.11 

I'm wondering if the data that is coming in only has X and Y but no Z.

0 Kudos
Kai_Wellmann
New Contributor II

Thank you very much. It is now working. I have tried the positionUpdate Signal and I now get the altitude.

Is this a bug in ArcGIS?

0 Kudos
LucasDanzinger
Esri Frequent Contributor

Kai - so the results are that you get z values when using positionUpdated but not on the locationChanged signal? If so, then this sounds like a bug in ArcGIS Runtime.

0 Kudos