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. I want to geocode the location and get the latitude and longitude in qml.But when i tried to do it iam getting ((QGeoTileProviderOsm: Tileserver disabled at QUrl("http://maps-redirect.qt.io/osm/5.8/satellite") error How to resolve it
Forum Updated to NodeBB v4.3 + New Features

I want to geocode the location and get the latitude and longitude in qml.But when i tried to do it iam getting ((QGeoTileProviderOsm: Tileserver disabled at QUrl("http://maps-redirect.qt.io/osm/5.8/satellite") error How to resolve it

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 1.6k 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.
  • Ashok KumarA Offline
    Ashok KumarA Offline
    Ashok Kumar
    wrote on last edited by
    #1

    import QtPositioning 5.2
    import QtQuick.Window 2.2
    import QtLocation 5.3
    import QtLocation 5.11

    Window {
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")

    Plugin
    {
        id: mapPlugin
        name: "osm"
    }
    
    Map
    {
        id:map
        anchors.fill: parent
        plugin: mapPlugin
        center: QtPositioning.coordinate(21.7679, 78.8718)
        zoomLevel: 14
    }
    
    GeocodeModel
    {
        id: geocodeModel
        plugin: map.plugin
        onStatusChanged:
        {
            if ((status == GeocodeModel.Ready) || (status == GeocodeModel.Error))
                map.geocodeFinished()
        }
        onLocationsChanged:
        {
            if (count == 1) {
                map.center.latitude = get(0).coordinate.latitude
                console.log("The new latitude is ",map.center.latitude)
                map.center.longitude = get(0).coordinate.longitude
                console.log("The new longitude is ",map.center.longitude)
            }
        }
    }
    

    }

    J.HilkJ ODБOïO 2 Replies Last reply
    0
    • Ashok KumarA Ashok Kumar

      import QtPositioning 5.2
      import QtQuick.Window 2.2
      import QtLocation 5.3
      import QtLocation 5.11

      Window {
      visible: true
      width: 640
      height: 480
      title: qsTr("Hello World")

      Plugin
      {
          id: mapPlugin
          name: "osm"
      }
      
      Map
      {
          id:map
          anchors.fill: parent
          plugin: mapPlugin
          center: QtPositioning.coordinate(21.7679, 78.8718)
          zoomLevel: 14
      }
      
      GeocodeModel
      {
          id: geocodeModel
          plugin: map.plugin
          onStatusChanged:
          {
              if ((status == GeocodeModel.Ready) || (status == GeocodeModel.Error))
                  map.geocodeFinished()
          }
          onLocationsChanged:
          {
              if (count == 1) {
                  map.center.latitude = get(0).coordinate.latitude
                  console.log("The new latitude is ",map.center.latitude)
                  map.center.longitude = get(0).coordinate.longitude
                  console.log("The new longitude is ",map.center.longitude)
              }
          }
      }
      

      }

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @Ashok-Kumar
      In future, please refrain from double posting and from using a super long question as the topic title!


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      3
      • Ashok KumarA Ashok Kumar

        import QtPositioning 5.2
        import QtQuick.Window 2.2
        import QtLocation 5.3
        import QtLocation 5.11

        Window {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")

        Plugin
        {
            id: mapPlugin
            name: "osm"
        }
        
        Map
        {
            id:map
            anchors.fill: parent
            plugin: mapPlugin
            center: QtPositioning.coordinate(21.7679, 78.8718)
            zoomLevel: 14
        }
        
        GeocodeModel
        {
            id: geocodeModel
            plugin: map.plugin
            onStatusChanged:
            {
                if ((status == GeocodeModel.Ready) || (status == GeocodeModel.Error))
                    map.geocodeFinished()
            }
            onLocationsChanged:
            {
                if (count == 1) {
                    map.center.latitude = get(0).coordinate.latitude
                    console.log("The new latitude is ",map.center.latitude)
                    map.center.longitude = get(0).coordinate.longitude
                    console.log("The new longitude is ",map.center.longitude)
                }
            }
        }
        

        }

        ODБOïO Offline
        ODБOïO Offline
        ODБOï
        wrote on last edited by ODБOï
        #3

        @Ashok-Kumar said in I want to geocode the location and get the latitude and longitude in qml.But when i tried to do it iam getting ((QGeoTileProviderOsm: Tileserver disabled at QUrl("http://maps-redirect.qt.io/osm/5.8/satellite") error How to resolve it:

        Tileserver disabled

        i have the same message but,
        I'm not sure this is an error since everything seems to work correctly

        if you want to show latitude and longitudes use onCenterChanged signal from Map

        Map
        {
           onCenterChanged: console.log(center)
        }
        
        
        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