Unsolved How to pass QGeoCodeReply to a map and display the location?
-
Hi,
I have been trying to write a program to mark a few locations on a map. After several attempts I was able to get the following code together by following the instructions on this page:
http://doc.qt.io/qt-5/location-maps-cpp.html
QGeoServiceProvider *provider = new QGeoServiceProvider("Open Street Map"); QGeoCodingManager *manager = provider->geocodingManager(); QGeoAddress address; QString country = "United States"; address.setCountry(country); QString countryCode = "+1"; address.setCountryCode(countryCode); QString zipCode ="90095"; address.setPostalCode(zipCode); QString state = "California"; address.setState(state); QString street = "405 Hilgard Avenue"; address.setStreet(street); QGeoShape shape; shape.CircleType; QGeoCodeReply *reply = manager->geocode(address, shape);
How do I use the QGeoCodeReply to mark the location on the map?
And how do I load the map?
-
@WhatIf The link you provided already has the answer:
Currently it is not possible to interact with maps via C++. Mapping applications must use the Maps and Navigation (QML) API.
-
oh, no......I missed that line was concentrating on the code.
Alright, are you familiar with any QML examples/tutorials that can mark several locations on the map. I wish there was a way to do it in C++. I was hoping to skip learning a new language.
-
-
@WhatIf You can do this with the ArcGIS SDK all in C++. Here is a sample for geocoding in C++ - https://developers.arcgis.com/qt/cpp/sample-code/geocode_sample.htm
-
@WhatIf you have to use MapQuickItem {} from QML