Changeset 5104


Ignore:
Timestamp:
Mar 8, 2015 11:52:46 PM (9 years ago)
Author:
ldelgass
Message:

update mapviewer for NSF demo

Location:
trunk/gui/scripts
Files:
2 edited

Legend:

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

    r5027 r5104  
    3636        "elevation"     1
    3737        "polygon"       2
    38         "points"        3
     38        "point"         3
    3939        "icon"          4
    4040        "line"          5
     
    126126        $_tree set $child "name" $layer
    127127        $_tree set $child "type" $layerType
    128         foreach key { label description attribution } {
     128        foreach key { label description attribution profile srs verticalDatum } {
    129129            $_tree set $child $key [$layers get $layer.$key]
    130130        }
     
    147147        }
    148148        $_tree set $child "driver" "debug"
     149        set colorramp [$layers element -as type $layer.colorramp]
     150        if { $colorramp != "" } {
     151            foreach key { url colormap } {
     152                set value [$layers get $layer.colorramp.$key]
     153                $_tree set $child "colorramp.$key" $value
     154            }
     155            set file [$layers get $layer.colorramp.file]
     156            if { $file != "" } {
     157                # FIXME: Add test for valid file path
     158                $_tree set $child "colorramp.url" $file
     159            }
     160            $_tree set $child "driver" "colorramp"
     161        }
    149162        set gdal [$layers element -as type $layer.gdal]
    150163        if { $gdal != "" } {
  • trunk/gui/scripts/mapviewer.tcl

    r5031 r5104  
    7979    private method BuildCameraTab {}
    8080    private method BuildDownloadPopup { widget command }
     81    private method BuildHelpTab {}
    8182    private method BuildLayerTab {}
    8283    private method BuildMapTab {}
     
    8586    private method Connect {}
    8687    private method CurrentLayers {args}
     88    private method DisablePanningMouseBindings {}
     89    private method DisableRotationMouseBindings {}
     90    private method DisableZoomMouseBindings {}
    8791    private method Disconnect {}
    8892    private method DoPan {}
     
    9195    private method DoSelect {}
    9296    private method EarthFile {}
     97    private method EnablePanningMouseBindings {}
     98    private method EnableRotationMouseBindings {}
     99    private method EnableZoomMouseBindings {}
    93100    private method EventuallyHandleMotionEvent { x y }
    94101    private method EventuallyPan { dx dy }
     
    104111    private method Pin {option x y}
    105112    private method Rebuild {}
     113    private method ReceiveImage { args }
     114    private method ReceiveLegend { args }
    106115    private method ReceiveMapInfo { args }
    107116    private method ReceiveScreenInfo { args }
    108     private method ReceiveImage { args }
    109117    private method Rotate {option x y}
    110118    private method Select {option x y}
     
    200208    #
    201209    $_parser alias image    [itcl::code $this ReceiveImage]
     210    $_parser alias legend   [itcl::code $this ReceiveLegend]
    202211    $_parser alias map      [itcl::code $this ReceiveMapInfo]
    203212    $_parser alias camera   [itcl::code $this camera]
     
    205214
    206215    # Millisecond delay before animated wait dialog appears
    207     set _waitTimeout 500
     216    set _waitTimeout 900
    208217
    209218    # Settings for mouse motion events: these are required
     
    334343    BuildTerrainTab
    335344    BuildCameraTab
     345    BuildHelpTab
    336346
    337347    # Legend
     
    349359    # size of the 3d view isn't set until an image is retrieved from
    350360    # the server.  So the panewindow uses the tiny size.
    351     set w 10000
    352361    pack forget $itk_component(view)
    353362    blt::table $itk_component(plotarea) \
    354         0,0 $itk_component(view) -fill both -reqwidth $w
     363        0,0 $itk_component(view) -fill both -reqwidth 10000
    355364    blt::table configure $itk_component(plotarea) c1 -resize none
    356365
    357366    bind $itk_component(view) <Configure> \
    358367        [itcl::code $this EventuallyResize %w %h]
     368
     369    EnablePanningMouseBindings
     370    EnableRotationMouseBindings
     371    EnableZoomMouseBindings
    359372
    360373    if {$_useServerManip} {
     
    365378            [itcl::code $this KeyRelease %N]
    366379
    367         # Bindings for rotation via mouse
    368         bind $itk_component(view) <ButtonPress-1> \
    369             [itcl::code $this MouseClick 1 %x %y]
     380        # Zoom to point
    370381        bind $itk_component(view) <Double-1> \
    371382            [itcl::code $this MouseDoubleClick 1 %x %y]
    372         bind $itk_component(view) <B1-Motion> \
    373             [itcl::code $this MouseDrag 1 %x %y]
    374         bind $itk_component(view) <ButtonRelease-1> \
    375             [itcl::code $this MouseRelease 1 %x %y]
    376 
    377         # Bindings for panning via mouse
    378         bind $itk_component(view) <ButtonPress-2> \
    379             [itcl::code $this MouseClick 2 %x %y]
     383        bind $itk_component(view) <Double-3> \
     384            [itcl::code $this MouseDoubleClick 3 %x %y]
     385
     386        # Unused
    380387        bind $itk_component(view) <Double-2> \
    381388            [itcl::code $this MouseDoubleClick 2 %x %y]
    382         bind $itk_component(view) <B2-Motion> \
    383             [itcl::code $this MouseDrag 2 %x %y]
    384         bind $itk_component(view) <ButtonRelease-2> \
    385             [itcl::code $this MouseRelease 2 %x %y]
    386 
    387         bind $itk_component(view) <ButtonPress-3> \
    388             [itcl::code $this MouseClick 3 %x %y]
    389         bind $itk_component(view) <Double-3> \
    390             [itcl::code $this MouseDoubleClick 3 %x %y]
    391         bind $itk_component(view) <B3-Motion> \
    392             [itcl::code $this MouseDrag 3 %x %y]
    393         bind $itk_component(view) <ButtonRelease-3> \
    394             [itcl::code $this MouseRelease 3 %x %y]
    395389
    396390        # Binding for mouse motion events
     
    400394        }
    401395    } else {
    402         # Bindings for panning via mouse
    403         bind $itk_component(view) <ButtonPress-1> \
    404             [itcl::code $this Pan click %x %y]
    405         bind $itk_component(view) <B1-Motion> \
    406             [itcl::code $this Pan drag %x %y]
    407         bind $itk_component(view) <ButtonRelease-1> \
    408             [itcl::code $this Pan release %x %y]
    409         bind $itk_component(view) <ButtonPress-1> \
    410             +[itcl::code $this SendCmd "map setpos %x %y"]
     396        # Zoom to point
    411397        bind $itk_component(view) <Double-1> \
    412398            [itcl::code $this camera go %x %y 0.4]
     399        # Travel to point (no zoom)
    413400        bind $itk_component(view) <Shift-Double-1> \
    414401            [itcl::code $this camera go %x %y 1.0]
     402        # Zoom out centered on point
     403        bind $itk_component(view) <Double-3> \
     404            [itcl::code $this camera go %x %y 2.5]
    415405
    416406        # Pin placemark annotations
    417407        bind $itk_component(view) <Control-ButtonPress-1> \
    418             +[itcl::code $this Pin add %x %y]
     408            [itcl::code $this Pin add %x %y]
    419409        bind $itk_component(view) <Control-ButtonPress-3> \
    420             +[itcl::code $this Pin delete %x %y]
    421 
     410            [itcl::code $this Pin delete %x %y]
     411
     412        # Draw selection rectangle
    422413        bind $itk_component(view) <Shift-ButtonPress-1> \
    423414            [itcl::code $this Select click %x %y]
     
    425416            +[itcl::code $this Select drag %x %y]
    426417        bind $itk_component(view) <Shift-ButtonRelease-1> \
    427             +[itcl::code $this Select release %x %y]
    428 
    429         if {1} {
    430         # Bindings for rotation via mouse
    431         bind $itk_component(view) <ButtonPress-2> \
    432             [itcl::code $this Rotate click %x %y]
    433         bind $itk_component(view) <B2-Motion> \
    434             [itcl::code $this Rotate drag %x %y]
    435         bind $itk_component(view) <ButtonRelease-2> \
    436             [itcl::code $this Rotate release %x %y]
    437         }
    438 
    439         # Bindings for zoom via mouse
    440         bind $itk_component(view) <ButtonPress-3> \
    441             [itcl::code $this Zoom click %x %y]
    442         bind $itk_component(view) <B3-Motion> \
    443             [itcl::code $this Zoom drag %x %y]
    444         bind $itk_component(view) <ButtonRelease-3> \
    445             [itcl::code $this Zoom release %x %y]
    446         bind $itk_component(view) <Double-3> \
    447             [itcl::code $this camera go %x %y 2.5]
     418            [itcl::code $this Select release %x %y]
     419
     420        # Update coordinate readout
     421        bind $itk_component(view) <ButtonPress-1> \
     422            +[itcl::code $this SendCmd "map setpos %x %y"]
    448423        bind $itk_component(view) <Double-3> \
    449424            +[itcl::code $this SendCmd "map setpos %x %y"]
     
    10451020
    10461021#
     1022# ReceiveLegend
     1023#
     1024# Invoked automatically whenever the "legend" command comes in from
     1025# the rendering server.  Indicates that binary image data with the
     1026# specified <size> will follow.
     1027#
     1028itcl::body Rappture::MapViewer::ReceiveLegend { colormap min max size } {
     1029puts stderr "ReceiveLegend colormap=$colormap range=$min,$max size=$size"
     1030    if { [IsConnected] } {
     1031        set bytes [ReceiveBytes $size]
     1032        if { ![info exists _image(legend)] } {
     1033            set _image(legend) [image create photo]
     1034        }
     1035        $_image(legend) configure -data $bytes
     1036puts stderr "read $size bytes for [image width $_image(legend)]x[image height $_image(legend)] legend>"
     1037        #if { [catch {DrawLegend} errs] != 0 } {
     1038        #    global errorInfo
     1039        #    puts stderr "errs=$errs errorInfo=$errorInfo"
     1040        #}
     1041    }
     1042}
     1043
     1044#
    10471045# ReceiveMapInfo --
    10481046#
     
    11191117    set h [winfo height $itk_component(view)]
    11201118    if { $w < 2 || $h < 2 } {
     1119        update idletasks
    11211120        $_dispatcher event -idle !rebuild
    11221121        return
     
    11471146                append _outbuf $bytes
    11481147            } else {
     1148                if { [info exists _mapsettings(style)] } {
     1149                    array set settings {
     1150                        -color white
     1151                    }
     1152                    array set settings $_mapsettings(style)
     1153                }
     1154                set bgcolor [Color2RGB $settings(-color)]
    11491155                if { $_mapsettings(type) == "geocentric" } {
    11501156                    $itk_component(grid) configure -state normal
    11511157                    $itk_component(time_l) configure -state normal
    11521158                    $itk_component(time) configure -state normal
    1153                     SendCmd "map reset geocentric"
     1159                    $itk_component(pitch_slider_l) configure -state normal
     1160                    $itk_component(pitch_slider) configure -state normal
     1161                    EnableRotationMouseBindings
     1162                    SendCmd "map reset geocentric $bgcolor"
    11541163                }  else {
    11551164                    $itk_component(grid) configure -state disabled
    11561165                    $itk_component(time_l) configure -state disabled
    11571166                    $itk_component(time) configure -state disabled
     1167                    $itk_component(pitch_slider_l) configure -state disabled
     1168                    $itk_component(pitch_slider) configure -state disabled
     1169                    DisableRotationMouseBindings
    11581170                    set proj $_mapsettings(projection)
     1171                    SendCmd "screen bgcolor $bgcolor"
    11591172                    if { $proj == "" } {
    1160                         SendCmd "map reset projected global-mercator"
     1173                        SendCmd "map reset projected $bgcolor global-mercator"
    11611174                    } elseif { ![info exists _mapsettings(extents)] || $_mapsettings(extents) == "" } {
    1162                         SendCmd [list map reset "projected" $proj]
     1175                        SendCmd "map reset projected $bgcolor [list $proj]"
    11631176                    } else {
    11641177                        #foreach {x1 y1 x2 y2} $_mapsettings(extents) break
     
    11661179                            set $key $_mapsettings($key)
    11671180                        }
    1168                         SendCmd [list map reset "projected" $proj $x1 $y1 $x2 $y2]
     1181                        SendCmd "map reset projected $bgcolor [list $proj] $x1 $y1 $x2 $y2"
    11691182                    }
    11701183                }
     
    12671280}
    12681281
     1282itcl::body Rappture::MapViewer::EnablePanningMouseBindings {} {
     1283    if {$_useServerManip} {
     1284        bind $itk_component(view) <ButtonPress-1> \
     1285            [itcl::code $this MouseClick 1 %x %y]
     1286        bind $itk_component(view) <B1-Motion> \
     1287            [itcl::code $this MouseDrag 1 %x %y]
     1288        bind $itk_component(view) <ButtonRelease-1> \
     1289            [itcl::code $this MouseRelease 1 %x %y]
     1290    } else {
     1291        bind $itk_component(view) <ButtonPress-1> \
     1292            [itcl::code $this Pan click %x %y]
     1293        bind $itk_component(view) <B1-Motion> \
     1294            [itcl::code $this Pan drag %x %y]
     1295        bind $itk_component(view) <ButtonRelease-1> \
     1296            [itcl::code $this Pan release %x %y]
     1297    }
     1298}
     1299
     1300itcl::body Rappture::MapViewer::DisablePanningMouseBindings {} {
     1301    bind $itk_component(view) <ButtonPress-1> {}
     1302    bind $itk_component(view) <B1-Motion> {}
     1303    bind $itk_component(view) <ButtonRelease-1> {}
     1304}
     1305
     1306itcl::body Rappture::MapViewer::EnableRotationMouseBindings {} {
     1307    if {$_useServerManip} {
     1308        bind $itk_component(view) <ButtonPress-2> \
     1309            [itcl::code $this Rotate click %x %y]
     1310        bind $itk_component(view) <B2-Motion> \
     1311            [itcl::code $this Rotate drag %x %y]
     1312        bind $itk_component(view) <ButtonRelease-2> \
     1313            [itcl::code $this Rotate release %x %y]
     1314    } else {
     1315        # Bindings for rotation via mouse
     1316        bind $itk_component(view) <ButtonPress-2> \
     1317            [itcl::code $this MouseClick 2 %x %y]
     1318        bind $itk_component(view) <B2-Motion> \
     1319            [itcl::code $this MouseDrag 2 %x %y]
     1320        bind $itk_component(view) <ButtonRelease-2> \
     1321            [itcl::code $this MouseRelease 2 %x %y]
     1322    }
     1323}
     1324
     1325itcl::body Rappture::MapViewer::DisableRotationMouseBindings {} {
     1326    bind $itk_component(view) <ButtonPress-2> {}
     1327    bind $itk_component(view) <B2-Motion> {}
     1328    bind $itk_component(view) <ButtonRelease-2> {}
     1329}
     1330
     1331itcl::body Rappture::MapViewer::EnableZoomMouseBindings {} {
     1332    if {$_useServerManip} {
     1333        bind $itk_component(view) <ButtonPress-3> \
     1334            [itcl::code $this MouseClick 3 %x %y]
     1335        bind $itk_component(view) <B3-Motion> \
     1336            [itcl::code $this MouseDrag 3 %x %y]
     1337        bind $itk_component(view) <ButtonRelease-3> \
     1338            [itcl::code $this MouseRelease 3 %x %y]
     1339    } else {
     1340        bind $itk_component(view) <ButtonPress-3> \
     1341            [itcl::code $this Zoom click %x %y]
     1342        bind $itk_component(view) <B3-Motion> \
     1343            [itcl::code $this Zoom drag %x %y]
     1344        bind $itk_component(view) <ButtonRelease-3> \
     1345            [itcl::code $this Zoom release %x %y]
     1346    }
     1347}
     1348
     1349itcl::body Rappture::MapViewer::DisableZoomMouseBindings {} {
     1350    bind $itk_component(view) <ButtonPress-3> {}
     1351    bind $itk_component(view) <B3-Motion> {}
     1352    bind $itk_component(view) <ButtonRelease-3> {}
     1353}
    12691354# ----------------------------------------------------------------------
    12701355# USAGE: CurrentLayers ?-all -visible? ?dataobjs?
     
    16901775
    16911776itcl::body Rappture::MapViewer::BuildMapTab {} {
    1692 
    16931777    set fg [option get $itk_component(hull) font Font]
    16941778    #set bfg [option get $itk_component(hull) boldFont Font]
     
    17641848
    17651849itcl::body Rappture::MapViewer::BuildTerrainTab {} {
    1766 
    17671850    set fg [option get $itk_component(hull) font Font]
    17681851    #set bfg [option get $itk_component(hull) boldFont Font]
     
    19202003    incr row
    19212004
    1922     label $inner.pitch_slider_l -text "Pitch" -font "Arial 9"
    1923     ::scale $inner.pitch_slider -font "Arial 9" \
    1924         -from -10 -to -90 -orient horizontal \
    1925         -variable [itcl::scope _view(pitch)] \
    1926         -width 10 \
    1927         -showvalue on \
    1928         -command [itcl::code $this camera set pitch]
     2005    itk_component add pitch_slider_l {
     2006        label $inner.pitch_slider_l -text "Pitch" -font "Arial 9"
     2007    }
     2008    itk_component add pitch_slider {
     2009        ::scale $inner.pitch_slider -font "Arial 9" \
     2010            -from -10 -to -90 -orient horizontal \
     2011            -variable [itcl::scope _view(pitch)] \
     2012            -width 10 \
     2013            -showvalue on \
     2014            -command [itcl::code $this camera set pitch]
     2015    }
    19292016
    19302017    blt::table $inner \
     
    19382025    blt::table configure $inner c2 -resize expand
    19392026    blt::table configure $inner r$row -resize expand
     2027}
     2028
     2029itcl::body Rappture::MapViewer::BuildHelpTab {} {
     2030    set fg [option get $itk_component(hull) font Font]
     2031    #set bfg [option get $itk_component(hull) boldFont Font]
     2032
     2033    set inner [$itk_component(main) insert end \
     2034        -title "Help" \
     2035        -icon [Rappture::icon question_mark12]]
     2036    $inner configure -borderwidth 4
     2037
     2038    set helptext {*************************
     2039Mouse bindings:
     2040*************************
     2041  Left - Panning
     2042  Middle - Rotation
     2043  Right - Zoom
     2044
     2045Zoom/travel:
     2046  Left double-click:
     2047    Zoom to point
     2048  Left shift-double:
     2049    Travel to point
     2050  Right double-click:
     2051    Zoom out from point
     2052
     2053Pins:
     2054  Ctl-Left: Drop pin
     2055  Ctl-Right: Delete pin
     2056
     2057Select:
     2058  Shift-Left click-drag
     2059
     2060*************************
     2061Keyboard bindings:
     2062*************************
     2063  g - Toggle graticule
     2064  l - Toggle lighting
     2065  n - Set North up
     2066  p - Reset pitch
     2067  w - Toggle wireframe
     2068  arrows - panning
     2069  Shift-arrows - fine pan
     2070  Ctl-arrows - rotation
     2071  Ctl-Shift-arrows:
     2072    fine rotation
     2073  PgUp/PgDown - zoom
     2074  Home - Reset camera
     2075*************************}
     2076
     2077    text $inner.info -width 25 -bg white
     2078    $inner.info insert end $helptext
     2079    $inner.info configure -state disabled
     2080    blt::table $inner \
     2081        0,0 $inner.info -fill both
    19402082}
    19412083
     
    21102252    SendCmd "map terrain edges $settings(-edges)"
    21112253    set _settings(terrain-edges) $settings(-edges)
    2112     #SendCmd "map terrain color [Color2RGB $settings(-color)]"
     2254    SendCmd "map terrain color [Color2RGB $settings(-color)]"
    21132255    #SendCmd "map terrain colormode constant"
    21142256    SendCmd "map terrain lighting $settings(-lighting)"
     
    21432285            if {!$_sendEarthFile} {
    21442286                switch -- $info(driver)  {
     2287                    "colorramp" {
     2288                        set cmapName $layer
     2289                        SendCmd [list colormap define $cmapName $info(colorramp.colormap)]
     2290                        SendCmd [list map layer add $layer image colorramp \
     2291                                     $info(colorramp.url) $info(cache) $info(profile)  \
     2292                                     $cmapName]
     2293                    }
    21452294                    "debug" {
    2146                         SendCmd [list map layer add image debug $layer]
     2295                        SendCmd [list map layer add $layer image debug]
    21472296                    }
    21482297                    "gdal" {
    2149                         SendCmd [list map layer add image gdal \
    2150                                      $info(gdal.url) $info(cache) $layer]
     2298                        SendCmd [list map layer add $layer image gdal \
     2299                                     $info(gdal.url) $info(cache)]
    21512300                    }
    21522301                    "tms" {
    2153                         SendCmd [list map layer add image tms \
    2154                                      $info(tms.url) $info(cache) $layer]
     2302                        SendCmd [list map layer add $layer image tms \
     2303                                     $info(tms.url) $info(cache)]
    21552304                    }
    21562305                    "wms" {
    2157                         SendCmd [list map layer add image wms \
    2158                                      $info(wms.url) $info(cache)\
     2306                        SendCmd [list map layer add $layer image wms \
     2307                                     $info(wms.url) $info(cache) \
    21592308                                     $info(wms.layers) \
    21602309                                     $info(wms.format) \
    2161                                      $info(wms.transparent) \
    2162                                      $layer]
     2310                                     $info(wms.transparent)]
    21632311                    }
    21642312                    "xyz" {
    2165                         SendCmd [list map layer add image xyz \
    2166                                      $info(xyz.url) $info(cache) \
    2167                                      $layer]
     2313                        SendCmd [list map layer add $layer image xyz \
     2314                                     $info(xyz.url) $info(cache)]
    21682315                    }
    21692316                }
     
    21732320        "elevation" {
    21742321            array set settings {
    2175                 -min_level 0
    2176                 -max_level 23
     2322                -minlevel 0
     2323                -maxlevel 23
    21772324            }
    21782325            if { [info exists info(style)] } {
     
    21822329                switch -- $info(driver)  {
    21832330                    "gdal" {
    2184                         SendCmd [list map layer add elevation gdal \
    2185                                      $info(gdal.url) $layer]
     2331                        SendCmd [list map layer add $layer elevation gdal \
     2332                                     $info(gdal.url)]
    21862333                    }
    21872334                    "tms" {
    2188                         SendCmd [list map layer add elevation tms \
    2189                                      $info(tms.url) $layer]
     2335                        SendCmd [list map layer add $layer elevation tms \
     2336                                     $info(tms.url)]
    21902337                    }
    21912338                }
     
    22062353            }
    22072354            set _opacity($layer) [expr $settings(-opacity) * 100]
    2208             SendCmd [list map layer add line $info(ogr.url) $layer]
     2355            foreach {r g b} [Color2RGB $settings(-color)] {}
     2356            if {[info exists settings(-minrange)] && [info exists settings(-maxrange)]} {
     2357                SendCmd [list map layer add $layer line $info(ogr.url) $r $g $b $settings(-width) $settings(-minrange) $settings(-maxrange)]
     2358            } else {
     2359                SendCmd [list map layer add $layer line $info(ogr.url) $r $g $b $settings(-width)]
     2360            }
     2361            SendCmd "map layer opacity $settings(-opacity) $layer"
     2362        }
     2363        "point" {
     2364            array set settings {
     2365                -color black
     2366                -minbias 1000
     2367                -opacity 1.0
     2368                -size 1
     2369            }
     2370            if { [info exists info(style)] } {
     2371                array set settings $info(style)
     2372            }
     2373            if { [info exists info(opacity)] } {
     2374                set settings(-opacity) $info(opacity)
     2375            }
     2376            set _opacity($layer) [expr $settings(-opacity) * 100]
     2377            foreach {r g b} [Color2RGB $settings(-color)] {}
     2378            SendCmd [list map layer add $layer point $info(ogr.url) $r $g $b $settings(-size)]
    22092379            SendCmd "map layer opacity $settings(-opacity) $layer"
    22102380        }
     
    22222392            }
    22232393            set _opacity($layer) [expr $settings(-opacity) * 100]
    2224             SendCmd [list map layer add polygon $info(ogr.url) $layer]
     2394            foreach {r g b} [Color2RGB $settings(-color)] {}
     2395            SendCmd [list map layer add $layer polygon $info(ogr.url) $r $g $b]
    22252396            SendCmd "map layer opacity $settings(-opacity) $layer"
    22262397        }
     
    22342405                -halocolor white
    22352406                -halowidth 2.0
    2236                 -layout "ltr"
     2407                -layout "left-to-right"
    22372408                -minbias 1000
    22382409                -opacity 1.0
    2239                 -removedupe 1
     2410                -removedupes 1
    22402411            }
    22412412            if { [info exists info(style)] } {
     
    22522423                set priorityExpr ""
    22532424            }
    2254             SendCmd [list map layer add text $info(ogr.url) $contentExpr $priorityExpr $layer]
     2425            foreach {fgR fgG fgB} [Color2RGB $settings(-color)] {}
     2426            foreach {bgR bgG bgB} [Color2RGB $settings(-halocolor)] {}
     2427            if {[info exists settings(-minrange)] && [info exists settings(-maxrange)]} {
     2428                SendCmd [list map layer add $layer text $info(ogr.url) $contentExpr $priorityExpr $fgR $fgG $fgB $bgR $bgG $bgB $settings(-halowidth) $settings(-fontsize) $settings(-removedupes) $settings(-declutter) $settings(-minrange) $settings(-maxrange)]
     2429            } else {
     2430                SendCmd [list map layer add $layer text $info(ogr.url) $contentExpr $priorityExpr $fgR $fgG $fgB $bgR $bgG $bgB $settings(-halowidth) $settings(-fontsize) $settings(-removedupes) $settings(-declutter)]
     2431            }
    22552432            SendCmd "map layer opacity $settings(-opacity) $layer"
    22562433        }
     
    22862463    set f $inner.layers
    22872464    set attrib [list]
     2465    set imgIdx 0
    22882466    foreach dataobj [get -objects] {
    22892467        foreach layer [$dataobj layers] {
     
    22982476            blt::table $f $row,0 $f.${layer}_visible -anchor w -pady 2 -cspan 2
    22992477            incr row
    2300             if { $info(type) != "elevation" } {
     2478            if { $info(type) == "image" } {
     2479                incr imgIdx
     2480            }
     2481            if { $info(type) != "elevation" && ($info(type) != "image" || $imgIdx > 1) } {
    23012482                label $f.${layer}_opacity_l -text "Opacity" -font "Arial 9"
    23022483                ::scale $f.${layer}_opacity -from 0 -to 100 \
Note: See TracChangeset for help on using the changeset viewer.