Hi Gareth and Luke
Thanks for your input - taking your comments, I have got it working by doing the following...
Defining PictureMarkerSymbol objects outside of the UniqueValueInfo object.
Then adding a function to the renderer that removes all UVIs, reapplies the symbols to the UVIs and re-adds them to the renderer, then reapplies the renderer itself back to the layer.
Then, last step was to add a handler that catches the map rotating, updates the rotation angle of each of the PictureMarkerSymbols before calling the refresh function on the renderer.
A bit longwinded but gets there in the end! A small delay as it updates typically several hundred labels on the screen but not too bad.
onMapRotationChanged: {
//console.log("the map rotation changed to: ", map.mapRotation)
redFlagPictureMarkerSymbol.angle = map.mapRotation;
greenFlagPictureMarkerSymbol.angle = map.mapRotation;
greyFlagPictureMarkerSymbol.angle = map.mapRotation;
myRenderer.refresh();
}
UniqueValueRenderer{
id:myRenderer
defaultSymbol: greyFlagPictureMarkerSymbol;
Component.onCompleted: { addValue(uvi1); addValue(uvi2) }
function refresh(){
removeAll();
uvi1.symbol = redFlagPictureMarkerSymbol
uvi2.symbol = greenFlagPictureMarkerSymbol
addValue(uvi1);
addValue(uvi2);
myLayer.renderer = myRenderer;
}
}