get gps current location using PositionSource:
-
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 ?
-
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 ?
@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:
-
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 ?
@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.