Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. finding address with geocodemodel
Forum Updated to NodeBB v4.3 + New Features

finding address with geocodemodel

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt5mapqml
6 Posts 2 Posters 873 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    deleted286
    wrote on last edited by
    #1

    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"
    
    
    }
    
    }
    
    raven-worxR 1 Reply Last reply
    0
    • D deleted286

      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"
      
      
      }
      
      }
      
      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @suslucoder said in finding address with geocodemodel:

      These code scripts gives me error --> expected token :

      where (line) does the error appear?
      What exactly is Location.coordinate? Where does Location come from?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      D 1 Reply Last reply
      0
      • raven-worxR raven-worx

        @suslucoder said in finding address with geocodemodel:

        These code scripts gives me error --> expected token :

        where (line) does the error appear?
        What exactly is Location.coordinate? Where does Location come from?

        D Offline
        D Offline
        deleted286
        wrote on last edited by
        #3

        @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

        raven-worxR 1 Reply Last reply
        0
        • D deleted286

          @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

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @suslucoder
          i can't find the usage of Location.coordinate in this example?

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          D 1 Reply Last reply
          0
          • raven-worxR raven-worx

            @suslucoder
            i can't find the usage of Location.coordinate in this example?

            D Offline
            D Offline
            deleted286
            wrote on last edited by
            #5

            @raven-worx it is

            locationData.coordinate
            

            in the example

            raven-worxR 1 Reply Last reply
            0
            • D deleted286

              @raven-worx it is

              locationData.coordinate
              

              in the example

              raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #6

              @suslucoder
              so again, where does Location come from then.
              Tokens starting with a capital letter have a special meaning in QML

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved