Feature request #12070

Define map extent on canvas as a center point, not as rectangular extent

Added by Mike Taves over 5 years ago. Updated almost 2 years ago.

Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:20270


The goal of putting a map on a canvas is to show the region of interest in a desired height and width of canvas space. The resources in the canvas composer for QGIS 2.6.1-Brighton make this task very challenging and time consuming, as adjustments need to be done in three different sections of the map properties: Main properties (Scale, Rotation), Extents (four fields to define a rectangle), and Position and size (X, Y, Width, Height). Furthermore, adjustments to one section affect others in unintuitive ways.

Ideally, the Position and size would be done visually in the canvas composer, drawing or setting the map's X, Y, Width, and Height on the canvas. Ideally, these should not change, since the user want's the map to fill that space on the canvas only.

Next, to position the map view on the canvas, only the scale, rotation and center coordinate need to be provided. These settings should ideally be in one section of the map item properties (Main properties?). Additionally, scale and center coordinate could visually be adjusted with map-specific pan and zoom tools, which are not available in the canvas composer for QGIS 2.6.1-Brighton, but would be really cool and intuitive (ArcGIS has these).

The main issue with QGIS 2.6.1-Brighton is that the map canvas extent is defined using rectangular extents (X min, Y min, X max, Y max), which is problematic for many reasons:
  • The aspect ratio of height:width on the map canvas are almost never the same as the map view in the main display, so it is impossible to accurately relate X/Y min/max values between the two interfaces.
  • Clicking "Set to map canvas extent" and "View extent in map canvas" multiple times "walks" the scale (zooms out). The scale in the main map and canvas map are different (because of different extent aspect ratios?), and this ratio of difference appears to have something to do with adjusting the scale. These two scales should be the same.
  • Defining a rectangular extent assumes there is no rotation between the main map view and the map on the canvas. However, with map rotation enabled, the meaning of the four extetns are not clear to the user.
  • Manual adjustments to the map extents change the map scale, and the size of the map on the canvas.

A suggested change for this feature request is to remove the Extents section for map properties of the canvas extent, and the use of rectangular extents (four values) for defining map canvases and replace it with a map center coordinate (two values: X, Y). Using the center coordinate, the map canvas is defined by a map rotation, scale, and size, which already exist. The map center coordinate could appear in the Main properties for map items of the canvas composer. Furthermore, the Position and size of the map should not be changed as a result of changing any of the other map positioning settings.

A transition from previous projects could simply determine map center coordinates from the mid-point of the four extent values.


#1 Updated by Giovanni Manghi over 3 years ago

  • Easy fix? set to No

#2 Updated by Jürgen Fischer about 3 years ago

  • Category set to Unknown

#3 Updated by Johannes Kroeger almost 2 years ago

  • Description updated (diff)

Considering you can override many things in QGIS with expressions nowadays and that @map_extent_center is available, is this still relevant?

Also available in: Atom PDF