AnsweredAssumed Answered

Decimal Degree coordinates in Double format

Question asked by chrispalmer on Oct 28, 2019
Latest reply on Oct 29, 2019 by LDanzinger-esristaff

Hello!

 

This question is about the SDK for Qt using C++

 

In my prototype application (c++), I instantiate a map with:

m_map = new Map(BasemapType::ImageryWithLabels, [SOME_DOUBLE], [SOME_NEGATIVE_DOUBLE], 18, this);

and everything looks great. When I later do a conversion from screen coordinate (via mouse click) to real-world coordinate using something like this (where 'event' is a QMouseEvent):

 

Esri::ArcGISRuntime::Point point = m_mapView->screenToLocation(event.x(), event.y());

auto latLong = Esri::ArcGISRuntime::CoordinateFormatter::toLatitudeLongitude(
    point,
    Esri::ArcGISRuntime::LatitudeLongitudeFormat::DecimalDegrees,
    4);

 

I end up with some wild numbers. in the latLong.x and latLong.y values.

 

If I then use:

CoordinateFormatter::toLatitudeLongitude(point, LatitudeLongitudeFormat::DecimalDegrees, 4)

 

to convert it to text, I end up with N,S,E,W notations on the end. Is there a way that I can simply get the coordinates in decimal degrees as doubles? 

Outcomes