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

finding address with geocodemodel

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt5mapqml
6 Posts 2 Posters 855 Views
  • 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 20 Jan 2021, 08:45 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"
    
    
    }
    
    }
    
    R 1 Reply Last reply 20 Jan 2021, 09:18
    0
    • D deleted286
      20 Jan 2021, 08:45

      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"
      
      
      }
      
      }
      
      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 20 Jan 2021, 09:18 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 20 Jan 2021, 10:31
      0
      • R raven-worx
        20 Jan 2021, 09:18

        @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 20 Jan 2021, 10:31 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

        R 1 Reply Last reply 21 Jan 2021, 09:08
        0
        • D deleted286
          20 Jan 2021, 10:31

          @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

          R Offline
          R Offline
          raven-worx
          Moderators
          wrote on 21 Jan 2021, 09:08 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 21 Jan 2021, 09:22
          0
          • R raven-worx
            21 Jan 2021, 09:08

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

            D Offline
            D Offline
            deleted286
            wrote on 21 Jan 2021, 09:22 last edited by
            #5

            @raven-worx it is

            locationData.coordinate
            

            in the example

            R 1 Reply Last reply 21 Jan 2021, 09:31
            0
            • D deleted286
              21 Jan 2021, 09:22

              @raven-worx it is

              locationData.coordinate
              

              in the example

              R Offline
              R Offline
              raven-worx
              Moderators
              wrote on 21 Jan 2021, 09:31 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

              1/6

              20 Jan 2021, 08:45

              • Login

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