mapping dynamic points on a map
-
This is for an application running on an Android smartphone. The app shall show dynamically different points which are updated every epoch. The tables and coordinates are updated through the c++ part of the application. QML is just used for display.
By assigning different points manually here in the example for 5 points, I got to work. However, the list is basically dynamic and it should look a bit better.
Page { id: pageSnr property Map map Plugin { id: mapPlugin name: "osm" // "mapboxgl", "esri", ... } PositionSource { id: snrSource property variant solution0: satelliteModel.CoordList[0] property variant solution1: satelliteModel.CoordList[1] property variant solution2: satelliteModel.CoordList[2] property variant solution3: satelliteModel.CoordList[3] property variant solution4: satelliteModel.CoordList[4] active: true updateInterval: 2000 // 2 mins onPositionChanged: { var currentPosition = snrSource.position.coordinate myMap.center = currentPosition solution0 = satelliteModel.CoordList[0] solution1 = satelliteModel.CoordList[1] solution2 = satelliteModel.CoordList[2] solution3 = satelliteModel.CoordList[3] solution4 = satelliteModel.CoordList[4] var distance = currentPosition.distanceTo(lastSearchPosition) if (distance > 500) { // 500m from last performed pizza search lastSearchPosition = currentPosition searchModel.searchArea = QtPositioning.circle(currentPosition) searchModel.update() } } } Map { id: myMap anchors.fill: parent anchors.bottomMargin: 150 plugin: mapPlugin center: currentPosition zoomLevel: 20 MapCircle { center: snrSource.solution1 color: "black" radius: 20 opacity: 1 } ListView { model: mySolutions delegate: MapCircle { center: model.locationCoord color: "red" radius: 20 opacity: 1 } } } }
I have tried to use a list which is already in place for creation of a table. The list of objects is accessed through "mySolutions". One of the access points is "locationCoord". The routine of C++ is accessed every epoch while processing. However, the map circles are not shown through ListView while the crude way with QList of QGeoCoordinates is working in the example given.
Any suggestion how to get this to work?
-
Found in the mean time MapObjectView. Looks promising but does not work yet either.
-
Finally found MapItemView which does what I am searching for.