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?
Solved! Go to Solution.
There isn't an option for that currently. You could do some QString manipulation and split at the space, remove the last character of each resulting string, and add a - if S or W
There isn't an option for that currently. You could do some QString manipulation and split at the space, remove the last character of each resulting string, and add a - if S or W
That's what I ended up doing. Thank you for the answer!