Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.15.2
-
None
-
I94e6c673b8aa3ccdc6adf4b3ce5a87b13415475b
Description
Hello,
Running the example found at https://code.qt.io/cgit/qt/qtlocation.git/tree/examples/location/places_list?h=5.15, I've seen that the title property in the model was not set for restaurants and fast-foods.
I've only modified the start coordinate to
property variant startCoordinate: QtPositioning.coordinate(45.03494, 3.88201)
and searchTerm to :
searchTerm: "mcdonald puy-en-velay"
From what I've seen in the Qt Location source code, the field that is taken into the adress should match the field "type" :
const QString type = item.value(QStringLiteral("type")).toString(); //double [...] QJsonObject addressDetails = item.value(QStringLiteral("address")).toObject(); const QString title = addressDetails.value(type).toString(); place.setName(title);
but for example for fast-foods, the field type is "fast_food" and the name is in a field named "amenity". Here is an example of the reply json :
{ "address": { "ISO3166-2-lvl4": "FR-ARA", "ISO3166-2-lvl6": "FR-43", "amenity": "McDonald's", "country": "France", "country_code": "fr", "county": "Haute-Loire", "municipality": "Le Puy-en-Velay", "postcode": "43750", "region": "Metropolitan France", "road": "McDrive", "state": "Auvergne-Rhône-Alpes", "village": "Vals-près-le-Puy" }, "boundingbox": [ "45.0270444", "45.0273145", "3.8807221", "3.8809013" ], "category": "amenity", "display_name": "McDonald's, McDrive, Vals-près-le-Puy, Le Puy-en-Velay, Haute-Loire, Auvergne-Rhône-Alpes, Metropolitan France, 43750, France", "icon": "https://nominatim.openstreetmap.org/ui/mapicons/food_fastfood.p.20.png", "importance": 0.4001, "lat": "45.027203650000004", "licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright", "lon": "3.880811612777352", "osm_id": 227472841, "osm_type": "way", "place_id": 161723163, "place_rank": 30, "type": "fast_food" }
I have not found any open issue for this and it seems to be present also on 6.3 version.