Displaying a high number of qmlMapItems on map with Mapbox plugin
Unsolved
QML and Qt Quick
-
Hello everyone,
I am trying to create display a large number (around 2000) of points on qml Map with mapbox plugin. The point positions should be updated regulary and I have the performance problem with very high amount of points but the problem isnt with updates but with points creation itself.Is it possible to have some many qmlMapItems on Map at the same time?
Map { objectName: "Map" id:map anchors.fill: parent plugin: mapboxglPlugin center: QtPositioning.coordinate(30.0, 30.0) zoomLevel: 14 Component.onCompleted: { MyScript.createPoints(); } }
function createPoints() { component = Qt.createComponent("mapCircle.qml"); if (component.status === Component.Ready){ finishCreation(); } else component.statusChanged.connect(finishCreation); } function finishCreation() { if (component.status === Component.Ready) { for(var i = 0;i < 2000;i++){ mcircle = component.createObject(map,{objectName:"MapCircle"+i}); map.addMapItem(mcircle); } if (mcircle === null) { // Error Handling console.log("Error creating object"); } } else if (component.status === Component.Error) { // Error Handling console.log("Error loading component:", component.errorString()); }
MapCircle{ objectName:"MapCircle" id:circle radius: 50.0; color: "red" border.width: 3.0 center{ latitude: 30.0 longitude: 30.0 } }