[GRASS-dev] gis.m: mapcanvas cleanup, bugfixes, "new feature"

Cedric Shock cedricgrass at shockfamily.net
Fri May 5 06:08:12 EDT 2006


Hi,

I added a new (half-feature?) to gis.m's map display. I call it explore mode 
or explorer mode. As a user sees it it's two little buttons, one for "strict" 
mode, which is the way gis.m used to work, and one for "explore" mode. In 
strict mode the user sees only what they asked to see. In explore mode the 
user sees as much as it is possible to display.

Behind the scenes all that is going on is this:
Strict Mode:
	The aspect ratio of the driver is changed to match the region
	The resolution is that of the last region loaded
Explore Mode:
	The aspect ratio of the region is changed to match the driver
	The resolution is calculated to match the screen.

The use of the former behavior (which is standard in all of grass) instead of 
the latter is something I can remember a few bug reports or at least a 
healthy dose of confusion over.

This behavior is implemented orthogonally to zooming.

Preemptive: The "regions" or zooms on the displays in gis.m are independent of 
the current region in grass and of each other.


I've touched up the gis.m documentation a bit. Most notably I added images for 
the icons of the mapcanvas tools and added descriptions of strict and explore 
draw modes.


Fixed bugs or potential bugs in gis.m:

Force redoing driver configuration if the display wasn't the most recent 
display to do something.

Zoom out with box now makes the current view fit into the box.


Cleanup:

mapsettings proc is now more descriptively named driversettings

New proc to handle shoving boxes in boxes. Used both to shrink the driver to 
the region in strict mode and to expand the region to the driver in explore.

Removed extra d.frame -e

Changed the order of region settings encoded as list from {n s w e} to {n s e 
w}.

New proc, currentzoom, which gets the current zoom instead of accessing the 
zoom history directly. Now few procs touch the zoom history. This also 
allowed the explorer mode to be implemented very simply.


Miscellaneous:

Added tool tip help to the tool buttons (zoom in/out, etc.) in the display 
window.


--Cedric




More information about the grass-dev mailing list