How to create a zoomed in portion of a map in print composer?
I have solved the problem!
When you go to your print composer, you add a new map as you normally would (let´s say it is Map 1
). Leave enough space for your zoomed in portion to be displayed.
Add a new smaller, map in the area where you want your zoomed in portion to be displayed (let´s say it is Map 2
). Within this window, zoom to whatever area you want.
In the "Item Properties" tab of Map 1
, scroll down to "Overview" and hit the green + symbol.
Set the map frame to Map 1
(this should be the full extent base map you're working with).
Set the map frame to Map 2
(this should be the zoomed in portion).
Set the symbology for your new overview in Map 1
.
(Note: I was fiddling with it for a bit before I realized that the border style was set to "no pen" instead of solid line, which is what I wanted. Just pay attention to the details and you should be fine!)
Finnaly, I have added some lines manually and this is the results:
This is how I've done it, but there may be an easier/better way. Don't hesitate to comment if you know a better way!
Just create a polygon feature that represents the frame of your zoomed in section and use data defined override for the extents in the print composer.
xmin(geometry(getFeature('frame', 'gid', 1)))
ymin(geometry(getFeature('frame', 'gid', 1)))
xmax(geometry(getFeature('frame', 'gid', 1)))
ymax(geometry(getFeature('frame', 'gid', 1)))
How to define map extents based on a feature's geometry?