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. get gps current location using PositionSource:
Forum Updated to NodeBB v4.3 + New Features

get gps current location using PositionSource:

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 3 Posters 857 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.
  • M Offline
    M Offline
    Mohamad Ayrot
    wrote on last edited by
    #1

    i'am trying to get current location using PositionSource with Map Qml element, but on windows i cant get the location while on android device it gives the current location.
    NOTE: Location service is "on" on windows.

        PositionSource{
            id: myPosition
            active: true
            updateInterval: 1000
            preferredPositioningMethods: 
            PositionSource.SatellitePositioningMethods
    
            onPositionChanged: {
                map.center = myPosition.position.coordinate
                var coord = myPosition.position.coordinate;
                console.log("Coordinate:", coord.latitude, coord.longitude)
            }
        }
    

    on windows i have this debug info after running the application:

    serialnmea: No serial ports found 
    Threaded rendering is not optimal in the Mapbox GL plugin.
    [ INFO ]  "{unknown}[General]: GPU Identifier: Intel(R) HD Graphics 4000"
    [ WARNING ]  "{unknown}[OpenGL]: Not using Vertex Array Objects"
    QObject::startTimer: Timers cannot have negative intervals
    QObject::startTimer: Timers cannot have negative intervals
    

    how can i solve this problem ?

    MarkkyboyM M 2 Replies Last reply
    0
    • M Mohamad Ayrot

      i'am trying to get current location using PositionSource with Map Qml element, but on windows i cant get the location while on android device it gives the current location.
      NOTE: Location service is "on" on windows.

          PositionSource{
              id: myPosition
              active: true
              updateInterval: 1000
              preferredPositioningMethods: 
              PositionSource.SatellitePositioningMethods
      
              onPositionChanged: {
                  map.center = myPosition.position.coordinate
                  var coord = myPosition.position.coordinate;
                  console.log("Coordinate:", coord.latitude, coord.longitude)
              }
          }
      

      on windows i have this debug info after running the application:

      serialnmea: No serial ports found 
      Threaded rendering is not optimal in the Mapbox GL plugin.
      [ INFO ]  "{unknown}[General]: GPU Identifier: Intel(R) HD Graphics 4000"
      [ WARNING ]  "{unknown}[OpenGL]: Not using Vertex Array Objects"
      QObject::startTimer: Timers cannot have negative intervals
      QObject::startTimer: Timers cannot have negative intervals
      

      how can i solve this problem ?

      MarkkyboyM Offline
      MarkkyboyM Offline
      Markkyboy
      wrote on last edited by Markkyboy
      #2

      @Mohamad-Ayrot - you cannot use Windows Location Service as a GPS, that is not its intention. You need to use a separate GPS device, assuming your Windows device (laptop?) does not have a built in GPS, hence the output in console; "serialnma: no serial ports found" , this means it is looking for a physical GPS unit to connect with.

      Of course, your Android phone has no problem, it has built-in GPS module/chip.

      An old thread, but I don't think much has changed:

      https://answers.microsoft.com/en-us/windows/forum/all/windows-location-provider-does-not-seem-to-see-gps/9b3cfbc0-080a-4d14-8991-abd869cdee7e

      Don't just sit there standing around, pick up a shovel and sweep up!

      I live by the sea, not in it.

      1 Reply Last reply
      0
      • M Mohamad Ayrot

        i'am trying to get current location using PositionSource with Map Qml element, but on windows i cant get the location while on android device it gives the current location.
        NOTE: Location service is "on" on windows.

            PositionSource{
                id: myPosition
                active: true
                updateInterval: 1000
                preferredPositioningMethods: 
                PositionSource.SatellitePositioningMethods
        
                onPositionChanged: {
                    map.center = myPosition.position.coordinate
                    var coord = myPosition.position.coordinate;
                    console.log("Coordinate:", coord.latitude, coord.longitude)
                }
            }
        

        on windows i have this debug info after running the application:

        serialnmea: No serial ports found 
        Threaded rendering is not optimal in the Mapbox GL plugin.
        [ INFO ]  "{unknown}[General]: GPU Identifier: Intel(R) HD Graphics 4000"
        [ WARNING ]  "{unknown}[OpenGL]: Not using Vertex Array Objects"
        QObject::startTimer: Timers cannot have negative intervals
        QObject::startTimer: Timers cannot have negative intervals
        

        how can i solve this problem ?

        M Offline
        M Offline
        Mohamad Ayrot
        wrote on last edited by Mohamad Ayrot
        #3

        @Mohamad-Ayrot
        thank you for answering.
        i was thinking if we can get the location using internet (Network) connection as Microsoft or Google do. there are some applications that uses location services on windows like maps or weather, so i thought it can be the same situation.
        it does not provide the exact location but very close to the real one.

        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