Changeset 6099 for trunk


Ignore:
Timestamp:
Mar 3, 2016 9:24:28 PM (8 years ago)
Author:
ldelgass
Message:

Add public zoom extent method

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/mapviewer.tcl

    r6098 r6099  
    22382238            Camera reset
    22392239        }
     2240        "zoom" {
     2241            if {[llength $args] < 3} {
     2242                error "wrong # of args to camera zoom"
     2243            }
     2244            set zoomopt [lindex $args 0]
     2245            switch -- $zoomopt {
     2246                "extent" {
     2247                    if {[llength $args] < 7} {
     2248                        error "wrong # of args to camera zoom extent"
     2249                    }
     2250                    foreach {xmin ymin xmax ymax duration srs} [lrange $args 1 end] break
     2251                    foreach key {xmin ymin xmax ymax} {
     2252                        if {![string is double -strict [set $key]]} {
     2253                            error "Invalid extent: $key=[set $key]"
     2254                        }
     2255                    }
     2256                    if {$duration == ""} {
     2257                        set duration 0.0
     2258                    } elseif {![string is double $duration]} {
     2259                        error "Invalid duration \"$duration\", should be a double"
     2260                    }
     2261                    SendCmd "camera extent $xmin $ymin $xmax $ymax $duration $srs"
     2262                }
     2263                default {
     2264                    error "Unknown camera zoom option \"$zoomopt\""
     2265                }
     2266            }
     2267        }
    22402268        default {
    22412269            error "Unknown camera option \"$option\""
Note: See TracChangeset for help on using the changeset viewer.