Changeset 5955 for branches/geomap
- Timestamp:
- Jan 14, 2016 7:08:06 PM (8 years ago)
- Location:
- branches/geomap
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/geomap
- Property svn:mergeinfo changed
/trunk (added) merged: 5932-5933,5943,5946-5948,5950
- Property svn:mergeinfo changed
-
branches/geomap/gui/scripts/map.tcl
r5949 r5955 43 43 public method setAttribution { attribution } 44 44 public method setCamera { camera } 45 public method setExtents { xmin ymin xmax ymax }45 public method setExtents { xmin ymin xmax ymax {srs "wgs84"} } 46 46 public method setLabel { label } 47 47 public method setProjection { projection } … … 259 259 # FIXME: Add test for valid file path 260 260 $_tree set $child "ogr.url" $file 261 } 262 foreach key { connection geometry geometry_url layer ogr_driver build_spatial_index } { 263 set value [$layers get $layer.ogr.$key] 264 if { $value != "" } { 265 $_tree set $child "ogr.$key" $value 266 } 261 267 } 262 268 $_tree set $child "driver" "ogr" … … 431 437 } 432 438 433 itcl::body Rappture::Map::setExtents { xmin ymin xmax ymax } {434 $_tree set root "extents" "$xmin $ymin $xmax $ymax"439 itcl::body Rappture::Map::setExtents { xmin ymin xmax ymax {srs "wgs84"} } { 440 $_tree set root "extents" [list $xmin $ymin $xmax $ymax $srs] 435 441 } 436 442 … … 458 464 itcl::body Rappture::Map::viewpoints {} { 459 465 set list {} 460 foreach node [$_tree children root->"viewpoints"] { 461 lappend list [$_tree label $node] 466 catch { 467 foreach node [$_tree children root->"viewpoints"] { 468 lappend list [$_tree label $node] 469 } 462 470 } 463 471 return $list … … 601 609 itcl::body Rappture::Map::selectors { layerName } { 602 610 set list {} 603 foreach node [$_tree children root->"layers"->"$layerName"->"selectors"] { 604 lappend list [$_tree label $node] 611 catch { 612 foreach node [$_tree children root->"layers"->"$layerName"->"selectors"] { 613 lappend list [$_tree label $node] 614 } 605 615 } 606 616 return $list -
branches/geomap/gui/scripts/mapviewer.tcl
r5949 r5955 63 63 public method scale {args} 64 64 public method select {option {args ""}} 65 public method setSelectCallback {cmd} 65 66 66 67 public method send { cmd } … … 94 95 private method DoRotate {} 95 96 private method DoSelect {} 97 private method DoSelectCallback {option {args ""}} 96 98 private method DrawLegend { colormap min max } 97 99 private method EarthFile {} … … 116 118 private method ReceiveMapInfo { args } 117 119 private method ReceiveScreenInfo { args } 120 private method ReceiveSelect { option {args ""} } 118 121 private method RequestLegend { colormap w h } 119 122 private method Rotate {option x y} … … 142 145 # layer in the server. 143 146 private variable _viewpoints; 147 private variable _selectCallback ""; 144 148 private variable _click; # info used for rotate operations 145 149 private variable _view; # view params for 3D view … … 218 222 $_parser alias camera [itcl::code $this camera] 219 223 $_parser alias screen [itcl::code $this ReceiveScreenInfo] 220 $_parser alias select [itcl::code $this select]224 $_parser alias select [itcl::code $this ReceiveSelect] 221 225 222 226 # Millisecond delay before animated wait dialog appears … … 267 271 } 268 272 269 # Note: grid types are " geodetic", "utm" and "mgrs"273 # Note: grid types are "shader", "geodetic", "utm" and "mgrs" 270 274 # Currently only work in geocentric maps 271 275 array set _settings [subst { … … 275 279 coords-visible 1 276 280 grid 0 277 grid-type " geodetic"281 grid-type "shader" 278 282 legend 1 279 283 terrain-ambient 0.03 … … 938 942 } 939 943 940 # ---------------------------------------------------------------------- 941 # USAGE: select clear 942 # USAGE: select feature 943 # USAGE: select annotation 944 # ---------------------------------------------------------------------- 945 itcl::body Rappture::MapViewer::select {option {args ""}} { 944 itcl::body Rappture::MapViewer::setSelectCallback {cmd} { 945 set _selectCallback $cmd 946 } 947 948 itcl::body Rappture::MapViewer::DoSelectCallback {option {args ""}} { 949 if { $_selectCallback != "" } { 950 set cmd [concat $_selectCallback $option $args] 951 uplevel #0 $cmd 952 } 953 } 954 955 # ---------------------------------------------------------------------- 956 # USAGE: ReceiveSelect clear 957 # USAGE: ReceiveSelect feature <args...> 958 # USAGE: ReceiveSelect annotation <args...> 959 # ---------------------------------------------------------------------- 960 itcl::body Rappture::MapViewer::ReceiveSelect {option {args ""}} { 946 961 DebugTrace "Enter" 947 962 switch $option { … … 950 965 } 951 966 "clear" { 952 967 puts stderr "select clear" 953 968 } 954 969 "feature" { 955 puts stderr "select feature $args" 970 puts stderr "select feature $args" 971 } 972 } 973 eval DoSelectCallback $option $args 974 } 975 976 # ---------------------------------------------------------------------- 977 # USAGE: select clear 978 # USAGE: select feature <args...> 979 # USAGE: select annotation <args...> 980 # 981 # Clients use this method to notify the map widget of a selection event 982 # originating from outside the map 983 # ---------------------------------------------------------------------- 984 itcl::body Rappture::MapViewer::select {option {args ""}} { 985 switch $option { 986 "annotation" { 987 SendCmd "select annotation $args" 988 } 989 "clear" { 990 SendCmd "select clear" 991 } 992 "feature" { 993 SendCmd "select feature $args" 994 } 995 default { 996 puts stderr "Unknown select option \"$option\"" 956 997 } 957 998 } … … 1315 1356 set _first "" 1316 1357 set haveTerrain 0 1358 #SendCmd "map layer visible 0" 1317 1359 foreach dataobj [get -objects] { 1318 1360 if { [info exists _obj2ovride($dataobj-raise)] && $_first == "" } { … … 2540 2582 set selectors [list] 2541 2583 foreach selector [$dataobj selectors $layer] { 2542 array set sinfo [$dataobj selector $layer $selector]2584 array set sinfo [$dataobj selector $layer $selector] 2543 2585 DebugTrace "$selector: [array get sinfo]" 2544 2586 lappend selectors [array get sinfo] … … 2553 2595 } 2554 2596 set format "" 2555 set tmsType "" 2556 set cmd [list map layer add $layer feature $info(driver) $format $tmsType $info(ogr.url) $info(cache) $info(stylesheet) $script $selectors] 2557 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2558 lappend cmd $style(-minrange) $style(-maxrange) 2559 } 2560 SendFiles $info(ogr.url) 2597 set wfsType "" 2598 if { [info exists info(ogr.connection)] } { 2599 set cmd [list map layer add $layer feature db $format $info(ogr.layer) $info(ogr.connection) $info(cache) $info(stylesheet) $script $selectors] 2600 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2601 lappend cmd $style(-minrange) $style(-maxrange) 2602 } 2603 } else { 2604 set cmd [list map layer add $layer feature $info(driver) $format $wfsType $info(ogr.url) $info(cache) $info(stylesheet) $script $selectors] 2605 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2606 lappend cmd $style(-minrange) $style(-maxrange) 2607 } 2608 SendFiles $info(ogr.url) 2609 } 2561 2610 SendCmd $cmd 2562 2611 } … … 2720 2769 array set style { 2721 2770 -clamping terrain 2722 -clamptechnique gpu2771 -clamptechnique drape 2723 2772 -color white 2724 2773 -minbias 1000
Note: See TracChangeset
for help on using the changeset viewer.