Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  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 QML and Qt Quick
2 Posts 2 Posters 1.8k 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 QtQuick 2.9
    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:osmplugin
        name: "osm"
    }
    
    Map {
        id: map
        plugin: osmplugin
        zoomLevel: (maximumZoomLevel - minimumZoomLevel)/2
        center {
    
            latitude: 59.9485
            longitude: 10.7686
        }
    }
    
    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
                map.center.longitude = get(0).coordinate.longitude
            }
        }
    }
    

    }

    J.HilkJ 1 Reply Last reply
    0
    • Ashok KumarA Ashok Kumar

      import QtQuick 2.9
      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:osmplugin
          name: "osm"
      }
      
      Map {
          id: map
          plugin: osmplugin
          zoomLevel: (maximumZoomLevel - minimumZoomLevel)/2
          center {
      
              latitude: 59.9485
              longitude: 10.7686
          }
      }
      
      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
                  map.center.longitude = get(0).coordinate.longitude
              }
          }
      }
      

      }

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

      @Ashok-Kumar
      please do not double post

      closed as duplicate of
      https://forum.qt.io/topic/111493/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


      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
      1

      • Login

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