finding address with geocodemodel
Unsolved
General and Desktop
-
I want to set "geocodeModel.query" to the address.
These code scripts gives me error --> expected token :geocodeModel.query = fromAddress geocodeModel.update()
Here is my code for it
Plugin { id: mapPlugin name: "osm" PluginParameter {name: "osm.useragent"; value: "İlk Deneme"} PluginParameter { name: "osm.mapping.host"; value: "http://osm.tile.server.address/" } PluginParameter { name: "osm.mapping.copyright"; value: "All mine" } PluginParameter { name: "osm.routing.host"; value: "http://osrm.server.address/viaroute" } PluginParameter { name: "osm.geocoding.host"; value: "http://geocoding.server.address" } } Map { anchors.fill: parent plugin: mapPlugin center: QtPositioning.coordinate(40.0, 32.86) //Coorditanes of K.Ören/Ankara zoomLevel: 13 } GeocodeModel { id: geocodeModel plugin: mapPlugin onStatusChanged: { if ((status == GeocodeModel.Ready) || (status == GeocodeModel.Error)) map.geocodeFinished() } onLocationsChanged: { if(count == 1) { mapPlugin.center.latitude = get(0).coordinate.latitude mapPlugin.center.longitude = get(0).coorditane.longitude } } } MapItemView { model: geocodeModel delegate: pointDelegate } Component { id:pointDelegate MapCircle { id:point radius: 1000 color: "red" border.color: "black" border.width: 2 smooth: true opacity: 0.25 center: Location.coordinate } } Address { id:fromAddress street: "İsmail Cambaz" city: "Ankara" country: "Turkey" state: " " postalCode: "06290" } }
-
@suslucoder said in finding address with geocodemodel:
These code scripts gives me error --> expected token :
where (line) does the error appear?
What exactly isLocation.coordinate
? Where does Location come from? -
@raven-worx I've followed this example
https://doc.qt.io/qt-5/qtlocation-mapviewer-example.html#directions-and-travel-routes
I dont know where location.coorditane comes from
-
@suslucoder
i can't find the usage ofLocation.coordinate
in this example? -
-
@suslucoder
so again, where does Location come from then.
Tokens starting with a capital letter have a special meaning in QML