New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to display spatial filter extents on the map #45
Comments
The common practice in that case is not to use a layer, but a rubberband (using the QgsRubberBand class), which will be painted on the map canvas, and works as a decoration. |
That would be ideal. |
Rubber bands are not reprojected on-the fly when the user changes the CRS of the map canvas, but I added the code to reproject them when that happens, so they should stay in place even if the canvas changes its properties. When the layer is removed, the bounding box is deleted. |
Looks good — I'd suggest making the lineweight thinner/less dense, and maybe add a label with the repo title, since if you're working with layers from multiple repos you could have multiple active filters? What do you think @brentneave? |
Yes that makes sense @rcoup. I suppose the main thing, if we change the styling of the spatial filter boundary, might be making sure it remains visually distinct from any layer geometry it might enclose or overlap. |
@timdenee export step handling is relevant |
Adding text in the canvas is available from QGIS 3.22, with annotation layers. Instead of using that, I have used the classic canvas annotations, but removing the frame and the background, so they look like normal text labels. Later we can move to annotation layers, which will give us more control over the rendering and the styling of the text. Using annotations makes things a bit more complex, since those are saved in the project (unlike rubber bands), so it is a bit tricky to handle kart layers in a saved QGIS project. Annotations object names are not saved, so there is no way to later identify an annotation as belonging to a kart repo filter (to hide it or show it according to what the user selects). What I have done is to prefix the label name with "kart:", so we can easily identify it when a project is opened and have full control over its rendering. I think the code is working fine now in all these cases, but please test and let me know what you think. Also, now it will not add multiple rubberbands if there are multiple layers from the same repo. It will just render one bounding box per repo. |
Looks great :-) |
If a user has spatial filter(s) set, would be good to be able to (optionally) see the borders of the filters on the map.
IMO ideally they wouldn't appear as layers, but maybe more like a decoration (ie: layout extents, grids, etc)? Maybe @hamishcampbell has other ideas?
The text was updated successfully, but these errors were encountered: