Changeset 5975
- Timestamp:
- Jan 28, 2016, 9:59:31 AM (9 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/map.tcl
r5962 r5975 35 35 public method deleteViewpoint { viewpointName } 36 36 public method earthfile {} 37 public method getPlacardConfig { layerName } 37 38 public method hasLayer { layerName } 38 39 public method hints { args } … … 49 50 public method setExtents { xmin ymin xmax ymax {srs "wgs84"} } 50 51 public method setLabel { label } 52 public method setPlacardConfig { layerName attrlist style padding } 51 53 public method setProjection { projection } 52 54 public method setStyle { style } … … 203 205 } 204 206 rename $styles "" 207 } 208 set placard [$layers element -as object $layer.placard] 209 if {$placard != ""} { 210 foreach key { attributes style padding } { 211 set $key [$placard get $key] 212 } 213 setPlacardConfig $name $attributes $style $padding 205 214 } 206 215 $_tree set $child "driver" "debug" … … 627 636 } 628 637 638 itcl::body Rappture::Map::setPlacardConfig { layerName attrlist style padding } { 639 set id [$_tree findchild root->"layers" $layerName] 640 if { $id < 0 } { 641 error "unknown layer \"$layerName\"" 642 } 643 array set placardConf {} 644 foreach key { padding } { 645 set placardConf($key) [set $key] 646 } 647 foreach key { attrlist style } { 648 # Normalize whitespace 649 set val [set $key] 650 regsub -all "\[ \t\r\n\]+" [string trim $val] " " val 651 set placardConf($key) $val 652 } 653 $_tree set $id "placard" [array get placardConf] 654 } 655 656 itcl::body Rappture::Map::getPlacardConfig { layerName } { 657 set id [$_tree findchild root->"layers" $layerName] 658 if { $id < 0 } { 659 error "unknown layer \"$layerName\"" 660 } 661 return [$_tree get $id "placard" ""] 662 } 663 629 664 itcl::body Rappture::Map::deleteLayer { layerName } { 630 665 set id [$_tree findchild root->"layers" $layerName] -
trunk/gui/scripts/mapviewer.tcl
r5959 r5975 1366 1366 1367 1367 itcl::body Rappture::MapViewer::EnablePanningMouseBindings {} { 1368 if { $_useServerManip} {1368 if {1 || $_useServerManip} { 1369 1369 bind $itk_component(view) <ButtonPress-1> \ 1370 1370 [itcl::code $this MouseClick 1 %x %y] … … 1390 1390 1391 1391 itcl::body Rappture::MapViewer::EnableRotationMouseBindings {} { 1392 if {$_useServerManip} { 1393 bind $itk_component(view) <ButtonPress-2> \ 1394 [itcl::code $this Rotate click %x %y] 1395 bind $itk_component(view) <B2-Motion> \ 1396 [itcl::code $this Rotate drag %x %y] 1397 bind $itk_component(view) <ButtonRelease-2> \ 1398 [itcl::code $this Rotate release %x %y] 1399 } else { 1392 if {1 || $_useServerManip} { 1400 1393 # Bindings for rotation via mouse 1401 1394 bind $itk_component(view) <ButtonPress-2> \ … … 1405 1398 bind $itk_component(view) <ButtonRelease-2> \ 1406 1399 [itcl::code $this MouseRelease 2 %x %y] 1400 } else { 1401 bind $itk_component(view) <ButtonPress-2> \ 1402 [itcl::code $this Rotate click %x %y] 1403 bind $itk_component(view) <B2-Motion> \ 1404 [itcl::code $this Rotate drag %x %y] 1405 bind $itk_component(view) <ButtonRelease-2> \ 1406 [itcl::code $this Rotate release %x %y] 1407 1407 } 1408 1408 } … … 1415 1415 1416 1416 itcl::body Rappture::MapViewer::EnableZoomMouseBindings {} { 1417 if { $_useServerManip} {1417 if {1 || $_useServerManip} { 1418 1418 bind $itk_component(view) <ButtonPress-3> \ 1419 1419 [itcl::code $this MouseClick 3 %x %y] … … 1709 1709 itcl::body Rappture::MapViewer::Pan {option x y} { 1710 1710 switch -- $option { 1711 "set" {1712 set w [winfo width $itk_component(view)]1713 set h [winfo height $itk_component(view)]1714 set x [expr $x / double($w)]1715 set y [expr $y / double($h)]1716 if {[expr (abs($x) > 0.0 || abs($y) > 0.0)]} {1717 SendCmd "camera pan $x $y"1718 }1719 return1720 }1721 1711 "click" { 1722 1712 set _click(x) $x … … 1752 1742 $itk_component(view) configure -cursor "" 1753 1743 set _b1mode "" 1744 } 1745 "set" { 1746 set w [winfo width $itk_component(view)] 1747 set h [winfo height $itk_component(view)] 1748 set x [expr $x / double($w)] 1749 set y [expr $y / double($h)] 1750 if {[expr (abs($x) > 0.0 || abs($y) > 0.0)]} { 1751 SendCmd "camera pan $x $y" 1752 } 1753 return 1754 1754 } 1755 1755 default { … … 2823 2823 SendCmd "map layer opacity $style(-opacity) $layer" 2824 2824 } 2825 } 2826 2827 if {[info exists info(placard)]} { 2828 array set placard [$dataobj getPlacardConfig $layer] 2829 SendCmd [list placard config $placard(attrlist) $placard(style) $placard(padding) $layer] 2825 2830 } 2826 2831
Note: See TracChangeset
for help on using the changeset viewer.