Changeset 5990 for branches/geomap
- Timestamp:
- Feb 9, 2016 9:35:12 PM (6 years ago)
- Location:
- branches/geomap/gui/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/geomap/gui/scripts/map.tcl
r5955 r5990 31 31 32 32 public method addViewpoint { name props } 33 public method deleteViewpoint { viewpointName } 33 34 public method earthfile {} 35 public method getPlacardConfig { layerName } 34 36 public method hints { args } 35 37 public method isGeocentric {} … … 45 47 public method setExtents { xmin ymin xmax ymax {srs "wgs84"} } 46 48 public method setLabel { label } 49 public method setPlacardConfig { layerName attrlist style padding } 47 50 public method setProjection { projection } 48 51 public method setStyle { style } … … 203 206 } 204 207 rename $styles "" 208 } 209 set placard [$layers element -as object $layer.placard] 210 if {$placard != ""} { 211 foreach key { attributes style padding } { 212 set $key [$placard get $key] 213 } 214 setPlacardConfig $name $attributes $style $padding 205 215 } 206 216 $_tree set $child "driver" "debug" … … 578 588 # layer names 579 589 # layer settings layerName 580 # 590 # ---------------------------------------------------------------------- 581 591 itcl::body Rappture::Map::layer {option args} { 582 592 set result "" … … 601 611 } 602 612 613 614 itcl::body Rappture::Map::setPlacardConfig { layerName attrlist style padding } { 615 set id [$_tree findchild root->"layers" $layerName] 616 if { $id < 0 } { 617 error "unknown layer \"$layerName\"" 618 } 619 array set placardConf {} 620 foreach key { padding } { 621 set placardConf($key) [set $key] 622 } 623 foreach key { attrlist style } { 624 # Normalize whitespace 625 set val [set $key] 626 regsub -all "\[ \t\r\n\]+" [string trim $val] " " val 627 set placardConf($key) $val 628 } 629 $_tree set $id "placard" [array get placardConf] 630 } 631 632 633 itcl::body Rappture::Map::getPlacardConfig { layerName } { 634 set id [$_tree findchild root->"layers" $layerName] 635 if { $id < 0 } { 636 error "unknown layer \"$layerName\"" 637 } 638 return [$_tree get $id "placard" ""] 639 } 603 640 604 641 # ---------------------------------------------------------------------- … … 686 723 } 687 724 725 itcl::body Rappture::Map::deleteViewpoint { viewopintName } { 726 set id [$_tree findchild root->"viewpoints" $viewpointName] 727 if { $id < 0 } { 728 error "unknown viewpoint \"$viewpointName\"" 729 } 730 $_tree delete $id 731 } 732 688 733 # ---------------------------------------------------------------------- 689 734 # USAGE: type <layerName> -
branches/geomap/gui/scripts/mapviewer.tcl
r5955 r5990 1427 1427 1428 1428 itcl::body Rappture::MapViewer::EnablePanningMouseBindings {} { 1429 if { $_useServerManip} {1429 if {1 || $_useServerManip} { 1430 1430 bind $itk_component(view) <ButtonPress-1> \ 1431 1431 [itcl::code $this MouseClick 1 %x %y] … … 1451 1451 1452 1452 itcl::body Rappture::MapViewer::EnableRotationMouseBindings {} { 1453 if {$_useServerManip} { 1454 bind $itk_component(view) <ButtonPress-2> \ 1455 [itcl::code $this Rotate click %x %y] 1456 bind $itk_component(view) <B2-Motion> \ 1457 [itcl::code $this Rotate drag %x %y] 1458 bind $itk_component(view) <ButtonRelease-2> \ 1459 [itcl::code $this Rotate release %x %y] 1460 } else { 1453 if {1 || $_useServerManip} { 1461 1454 # Bindings for rotation via mouse 1462 1455 bind $itk_component(view) <ButtonPress-2> \ … … 1466 1459 bind $itk_component(view) <ButtonRelease-2> \ 1467 1460 [itcl::code $this MouseRelease 2 %x %y] 1461 } else { 1462 bind $itk_component(view) <ButtonPress-2> \ 1463 [itcl::code $this Rotate click %x %y] 1464 bind $itk_component(view) <B2-Motion> \ 1465 [itcl::code $this Rotate drag %x %y] 1466 bind $itk_component(view) <ButtonRelease-2> \ 1467 [itcl::code $this Rotate release %x %y] 1468 1468 } 1469 1469 } … … 1476 1476 1477 1477 itcl::body Rappture::MapViewer::EnableZoomMouseBindings {} { 1478 if { $_useServerManip} {1478 if {1 || $_useServerManip} { 1479 1479 bind $itk_component(view) <ButtonPress-3> \ 1480 1480 [itcl::code $this MouseClick 3 %x %y] … … 1770 1770 itcl::body Rappture::MapViewer::Pan {option x y} { 1771 1771 switch -- $option { 1772 "set" {1773 set w [winfo width $itk_component(view)]1774 set h [winfo height $itk_component(view)]1775 set x [expr $x / double($w)]1776 set y [expr $y / double($h)]1777 if {[expr (abs($x) > 0.0 || abs($y) > 0.0)]} {1778 SendCmd "camera pan $x $y"1779 }1780 return1781 }1782 1772 "click" { 1783 1773 set _click(x) $x … … 1813 1803 $itk_component(view) configure -cursor "" 1814 1804 set _b1mode "" 1805 } 1806 "set" { 1807 set w [winfo width $itk_component(view)] 1808 set h [winfo height $itk_component(view)] 1809 set x [expr $x / double($w)] 1810 set y [expr $y / double($h)] 1811 if {[expr (abs($x) > 0.0 || abs($y) > 0.0)]} { 1812 SendCmd "camera pan $x $y" 1813 } 1814 return 1815 1815 } 1816 1816 default { … … 2884 2884 SendCmd "map layer opacity $style(-opacity) $layer" 2885 2885 } 2886 } 2887 2888 if {[info exists info(placard)]} { 2889 array set placard [$dataobj getPlacardConfig $layer] 2890 SendCmd [list placard config $placard(attrlist) $placard(style) $placard(padding) $layer] 2886 2891 } 2887 2892
Note: See TracChangeset
for help on using the changeset viewer.