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. Track GPS route in QML and remove previous marker
Forum Updated to NodeBB v4.3 + New Features

Track GPS route in QML and remove previous marker

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 1 Posters 343 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
    d4n1
    wrote on last edited by
    #1

    Hi, I'm noob to QT/QML sorry if the question is too basic.

    Right now I can represent the position on a map by getting the GPS coordinates. Once these coordinates are obtained, they are represented with a marker, but the previous one is not eliminated, rather they are accumulated. I think QT has some predefined way to do this but I haven't found it.

       function addMarker(lat, lng) {
            var markerItem= comp_Marker.createObject(window, {coordinate: QtPositioning.coordinate(lat, lng)})
            mapView.addMapItem(markerItem)
        }
    .
    .
    .
    Component {
            id: mapMarker
            MapQuickItem {
                id: marker_Imgae
                anchorPoint.x: image_marker.width/5
                anchorPoint.y: image_marker.height/2
                coordinate: position
    
                sourceItem: Image {
                    id: image_marker
                    source: "https://cdn4.iconfinder.com/data/icons/small-n-flat/24/map-marker-512.png"
                }
            }
        }
    

    On the other hand, I am trying to trace the route that the GPS device is taking without success. I'm looking for information soure RouteMap and MapPolyline but I'm not sure if it's the right way.

    https://doc.qt.io/qt-5/qml-qtlocation-maproute.html
    https://doc.qt.io/qt-5/qml-qtlocation-mappolyline.html

    Thank you!

    1 Reply Last reply
    0
    • D Offline
      D Offline
      d4n1
      wrote on last edited by
      #2

      Hello, as a clarification in case you have any ideas, this is what I try to achieve:
      https://www.youtube.com/watch?v=-OcEpGMBNzg

      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