Changeset 36386
- Timestamp:
- Mar 15, 2009, 12:44:11 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
grass/branches/develbranch_6/gui/tcltk/gis.m/mapcanvas.tcl
r35025 r36386 113 113 variable zoom_attrs 114 114 set zoom_attrs {n s e w nsres ewres rows cols} 115 variable ll_proj ;# 1 if it's Lat/Lon projection, 0 othervise 115 116 116 117 # string with region information to show in status bar … … 418 419 419 420 proc MapCanvas::get_mapunits {} { 421 variable ll_proj 420 422 # get map units from PROJ_UNITS 421 423 if {![catch {open "|g.proj -p" r} input]} { … … 444 446 } 445 447 448 set ll_proj 0 449 if { [string eq "Lat/Lon" "$prj(name)"] } { 450 set ll_proj 1 451 } 452 446 453 return $mapunits 447 454 } … … 1030 1037 variable canvas_w 1031 1038 variable canvas_h 1039 variable ll_proj 1032 1040 1033 1041 set mapunits [MapCanvas::get_mapunits] … … 1045 1053 # Set the region extents to the smallest region no smaller than the canvas 1046 1054 set canvas_ar [expr {1.0 * $canvas_w($mon) / $canvas_h($mon)}] 1047 set expanded_region [MapCanvas::shrinkwrap 1 [lrange $region 0 3] $canvas_ar] 1048 foreach {n s e w} $expanded_region {break} 1055 foreach {n s e w} [MapCanvas::shrinkwrap 1 [lrange $region 0 3] $canvas_ar] {break} 1056 # In Lat/Lon N and S can not be larger than 90! 1057 if { $ll_proj } { 1058 if { $n > 90 } { set n 90 } 1059 if { $s < -90 } { set s -90 } 1060 } 1061 set expanded_region "$n $s $e $w" 1049 1062 # Calculate the resolutions proportional to the map size 1050 1063 set explore_nsres [expr {1.0 * ($n - $s) / $canvas_h($mon)}]
Note:
See TracChangeset
for help on using the changeset viewer.
