Bug report #10172
html annotation does not respect composer setting 'Lock layers for map item'
|Affected QGIS version:||2.2.0||Regression?:||No|
|Operating System:||Windows||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||18626|
[this is a copy of gis.stackexchange.com question here:
In the QGIS 2.2 map composer, html annotation objects do not seem to respect the 'Lock layers for map item' checkbox.
Initially, this was an attempted workaround for the question "qgis html annotation - scale dependent rendering?"
Example: your project has two layers, A and B. Each layer has one polygon or other renderable object, so that it's obvious in the composer if that layer is being drawn or not.
So, in the composer, add a map object. Initially it should show both layers' polygons (assuming you had them visible in the project when you made the composer).
In qgis, make sure either layer is highlighted in the layers palette, but don't make it editable.
Add an html annotation.
Make that current layer invisible, and notice the annotation object becomes invisible too. Empirically, that's because the annotation is owned by that layer.
Make that layer visible again.
Go to the composer and you should see the annotation on the map.
In the composer, under the Item properties for that map object, in the Main properties area, check the box for 'Lock layers for map item'. According to the docs, with this checked, it 'locks in' the current list of what layers are visible, so that if you then make a layer invisible in qgis, it will not affect what layers are visible in that map object in the composer.
Now go to qgis and make that layer invisible.
Then look in the composer again, notice the polygon or other 'real' object for that layer is still visible because you locked it, but, the annotation is not visible.
Fiddle around with variations on this theme - basically it shows that the annotation objects don't respect the 'Lock layers for map item' setting.