QGIS Print Composer - Set Map Frame to Map Extent

Firstly, it seems like the extent of your data and your map in the composer are of different ratios - if you want your data to completely fill up the map item in the composer, you will either end up cutting out some data, or there will be some white space. So you might want to make sure your map item in the composer is more square than rectangular.

You could do this by clicking and dragging the corners of the map item using the Select/Move item tool (third down on the left).

Alternatively, you could set the extents of the map item to the extents of the largest item in your canvas (the raster background, perhaps - right click -> Properties -> Information -> Extent). You could also set the map item extents to a vector layer in your project by using a data defined override with x_min($geometryoflayer) or similar functions. I'm not sure how to do that with raster layers, I think you need custom Python code.

Otherwise I would try changing the scale of the map in the map item and moving around the content until you are satisfied, using the "Move item content" tool on the left hand side (like a map with four blue arrows on it, 4th item from the top). You can click and drag, or use the mouse wheel to increase/decrease scale. For fine tuned scale adjustments go to the Item Properties for the map and try out different scales. Note that your map item needs to be unlocked in the print composer for this to work.


Instead of creating a separate item to use as a frame, you can simply add a frame to the map itself. Select the map item, look at the item properties panel and check the box where it says Frame. If you don't have the item properties panel, enable it from View menu > Panels > Item properties. enter image description here

The technical term for a map in the print composer is just map, or map item, or print composer map item. QGIS distinguishes this from the main project map by calling the visible area of the main project map the "map canvas."

If you still want to fit the frame to the map item, manually re-size the frame by dragging the corners. They should automatically snap to the edges of the map when you get close.


If I understand your question correctly, you are adding the frame correctly by selecting the Frame checkbox under the Map item's properties, but you need the map to fill the frame completely. The first thing to check would be the "Extents" section of the map item's properties and click on the "Set to map canvas extent" button to see if that does what you want. If it still does not, verify that the map is filling the canvas in the QGIS application window, as this is what will be displayed in the map item.