Changeset 6054
- Timestamp:
- Feb 25, 2016 6:15:09 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/mapviewer.tcl
r6052 r6054 1290 1290 array unset info 1291 1291 array set info [$dataobj layer $layer] 1292 if { ![info exists _layers($layer)] } { 1292 set tag $layer 1293 if { ![info exists _layers($tag)] } { 1293 1294 if { $_reportClientInfo } { 1294 1295 set cinfo {} … … 1299 1300 lappend cinfo "tool_revision" [$dataobj hints toolrevision] 1300 1301 lappend cinfo "dataset_label" [encoding convertto utf-8 $info(label)] 1301 lappend cinfo "dataset_tag" $ layer1302 lappend cinfo "dataset_tag" $tag 1302 1303 SendCmd "clientinfo [list $cinfo]" 1303 1304 } 1304 set _layers($ layer) 11305 set _layers($tag) 1 1305 1306 SetLayerStyle $dataobj $layer 1306 1307 } … … 1308 1309 if { [info exists _obj2ovride($dataobj-raise)] && 1309 1310 $_obj2ovride($dataobj-raise)} { 1310 SendCmd "map layer visible 1 $ layer"1311 set _visibility($ layer) 11311 SendCmd "map layer visible 1 $tag" 1312 set _visibility($tag) 1 1312 1313 } 1313 1314 if {$info(type) == "elevation"} { … … 1346 1347 UpdateViewpointControls 1347 1348 } 1349 1348 1350 set _reset 0 1349 1351 global readyForNextFrame … … 2400 2402 itcl::body Rappture::MapViewer::SetLayerStyle { dataobj layer } { 2401 2403 array set info [$dataobj layer $layer] 2404 set tag $layer 2402 2405 if { [info exists info(visible)] && 2403 2406 !$info(visible) } { 2404 set _visibility($ layer) 02407 set _visibility($tag) 0 2405 2408 } else { 2406 set _visibility($ layer) 12409 set _visibility($tag) 1 2407 2410 } 2408 2411 … … 2420 2423 if { [info exists info(opacity)] } { 2421 2424 set style(-opacity) $info(opacity) 2422 set _opacity($ layer) $info(opacity)2423 } 2424 set _opacity($ layer) [expr $style(-opacity) * 100]2425 set _opacity($tag) $info(opacity) 2426 } 2427 set _opacity($tag) [expr $style(-opacity) * 100] 2425 2428 set coverage 0 2426 2429 if { [info exists info(coverage)] } { … … 2429 2432 switch -- $info(driver) { 2430 2433 "arcgis" { 2431 SendCmd [list map layer add $ layerimage arcgis \2434 SendCmd [list map layer add $tag image arcgis \ 2432 2435 $info(arcgis.url) $info(cache) $coverage $info(arcgis.token)] 2433 2436 } 2434 2437 "colorramp" { 2435 set cmapName $ layer2438 set cmapName $tag 2436 2439 SendFiles $info(colorramp.url) 2437 2440 SendCmd [list colormap define $cmapName $info(colorramp.colormap)] 2438 SendCmd [list map layer add $ layerimage colorramp \2441 SendCmd [list map layer add $tag image colorramp \ 2439 2442 $info(colorramp.url) $info(cache) $coverage $info(colorramp.elevdriver) $info(profile) \ 2440 2443 $cmapName] 2441 2444 } 2442 2445 "debug" { 2443 SendCmd [list map layer add $ layerimage debug]2446 SendCmd [list map layer add $tag image debug] 2444 2447 } 2445 2448 "gdal" { 2446 2449 SendFiles $info(gdal.url) 2447 SendCmd [list map layer add $ layerimage gdal \2450 SendCmd [list map layer add $tag image gdal \ 2448 2451 $info(gdal.url) $info(cache) $coverage] 2449 2452 } 2450 2453 "tms" { 2451 SendCmd [list map layer add $ layerimage tms \2454 SendCmd [list map layer add $tag image tms \ 2452 2455 $info(tms.url) $info(cache) $coverage] 2453 2456 } 2454 2457 "wms" { 2455 SendCmd [list map layer add $ layerimage wms \2458 SendCmd [list map layer add $tag image wms \ 2456 2459 $info(wms.url) $info(cache) $coverage \ 2457 2460 $info(wms.layers) \ … … 2460 2463 } 2461 2464 "xyz" { 2462 SendCmd [list map layer add $ layerimage xyz \2465 SendCmd [list map layer add $tag image xyz \ 2463 2466 $info(xyz.url) $info(cache) $coverage] 2464 2467 } 2465 2468 } 2466 SendCmd "map layer opacity $style(-opacity) $ layer"2469 SendCmd "map layer opacity $style(-opacity) $tag" 2467 2470 } 2468 2471 "elevation" { … … 2477 2480 "gdal" { 2478 2481 SendFiles $info(gdal.url) 2479 SendCmd [list map layer add $ layerelevation gdal \2482 SendCmd [list map layer add $tag elevation gdal \ 2480 2483 $info(gdal.url) $info(cache)] 2481 2484 } 2482 2485 "tms" { 2483 SendCmd [list map layer add $ layerelevation tms \2486 SendCmd [list map layer add $tag elevation tms \ 2484 2487 $info(tms.url) $info(cache)] 2485 2488 } 2486 2489 "wcs" { 2487 SendCmd [list map layer add $ layerelevation wcs \2490 SendCmd [list map layer add $tag elevation wcs \ 2488 2491 $info(wcs.url) $info(cache) $info(wcs.identifier)] 2489 2492 } … … 2501 2504 set style(-opacity) $info(opacity) 2502 2505 } 2503 set _opacity($ layer) [expr $style(-opacity) * 100]2506 set _opacity($tag) [expr $style(-opacity) * 100] 2504 2507 DebugTrace "stylesheet: $info(stylesheet)" 2505 2508 set script "" … … 2525 2528 set wfsType "" 2526 2529 if { [info exists info(ogr.connection)] } { 2527 set cmd [list map layer add $ layerfeature db $format $info(ogr.layer) $info(ogr.connection) $info(cache) $info(stylesheet) $script $selectors]2530 set cmd [list map layer add $tag feature db $format $info(ogr.layer) $info(ogr.connection) $info(cache) $info(stylesheet) $script $selectors] 2528 2531 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2529 2532 lappend cmd $style(-minrange) $style(-maxrange) 2530 2533 } 2531 2534 } else { 2532 set cmd [list map layer add $ layerfeature $info(driver) $format $wfsType $info(ogr.url) $info(cache) $info(stylesheet) $script $selectors]2535 set cmd [list map layer add $tag feature $info(driver) $format $wfsType $info(ogr.url) $info(cache) $info(stylesheet) $script $selectors] 2533 2536 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2534 2537 lappend cmd $style(-minrange) $style(-maxrange) … … 2557 2560 set style(-opacity) $info(opacity) 2558 2561 } 2559 set _opacity($ layer) [expr $style(-opacity) * 100]2562 set _opacity($tag) [expr $style(-opacity) * 100] 2560 2563 foreach {r g b} [Color2RGB $style(-color)] {} 2561 2564 switch -- $info(driver) { … … 2563 2566 SendFiles $info(ogr.url) 2564 2567 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2565 SendCmd [list map layer add $ layerline ogr {} {} $info(ogr.url) $info(cache) $r $g $b $style(-width) $style(-cap) $style(-join) $style(-stipplepattern) $style(-stipplefactor) $style(-clamping) $style(-clamptechnique) $style(-minrange) $style(-maxrange)]2568 SendCmd [list map layer add $tag line ogr {} {} $info(ogr.url) $info(cache) $r $g $b $style(-width) $style(-cap) $style(-join) $style(-stipplepattern) $style(-stipplefactor) $style(-clamping) $style(-clamptechnique) $style(-minrange) $style(-maxrange)] 2566 2569 } else { 2567 SendCmd [list map layer add $ layerline ogr {} {} $info(ogr.url) $info(cache) $r $g $b $style(-width) $style(-cap) $style(-join) $style(-stipplepattern) $style(-stipplefactor) $style(-clamping) $style(-clamptechnique)]2570 SendCmd [list map layer add $tag line ogr {} {} $info(ogr.url) $info(cache) $r $g $b $style(-width) $style(-cap) $style(-join) $style(-stipplepattern) $style(-stipplefactor) $style(-clamping) $style(-clamptechnique)] 2568 2571 } 2569 2572 } … … 2574 2577 } 2575 2578 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2576 SendCmd [list map layer add $ layerline tfs $format {} $info(tfs.url) $info(cache) $r $g $b $style(-width) $style(-cap) $style(-join) $style(-stipplepattern) $style(-stipplefactor) $style(-clamping) $style(-clamptechnique) $style(-minrange) $style(-maxrange)]2579 SendCmd [list map layer add $tag line tfs $format {} $info(tfs.url) $info(cache) $r $g $b $style(-width) $style(-cap) $style(-join) $style(-stipplepattern) $style(-stipplefactor) $style(-clamping) $style(-clamptechnique) $style(-minrange) $style(-maxrange)] 2577 2580 } else { 2578 SendCmd [list map layer add $ layerline tfs $format {} $info(tfs.url) $info(cache) $r $g $b $style(-width) $style(-cap) $style(-join) $style(-stipplepattern) $style(-stipplefactor) $style(-clamping) $style(-clamptechnique)]2581 SendCmd [list map layer add $tag line tfs $format {} $info(tfs.url) $info(cache) $r $g $b $style(-width) $style(-cap) $style(-join) $style(-stipplepattern) $style(-stipplefactor) $style(-clamping) $style(-clamptechnique)] 2579 2582 } 2580 2583 } … … 2585 2588 } 2586 2589 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2587 SendCmd [list map layer add $ layerline wfs $format $info(wfs.typename) $info(wfs.url) $info(cache) $r $g $b $style(-width) $style(-cap) $style(-join) $style(-stipplepattern) $style(-stipplefactor) $style(-clamping) $style(-clamptechnique) $style(-minrange) $style(-maxrange)]2590 SendCmd [list map layer add $tag line wfs $format $info(wfs.typename) $info(wfs.url) $info(cache) $r $g $b $style(-width) $style(-cap) $style(-join) $style(-stipplepattern) $style(-stipplefactor) $style(-clamping) $style(-clamptechnique) $style(-minrange) $style(-maxrange)] 2588 2591 } else { 2589 SendCmd [list map layer add $ layerline wfs $format $info(wfs.typename) $info(wfs.url) $info(cache) $r $g $b $style(-width) $style(-cap) $style(-join) $style(-stipplepattern) $style(-stipplefactor) $style(-clamping) $style(-clamptechnique)]2590 } 2591 } 2592 } 2593 SendCmd "map layer opacity $style(-opacity) $ layer"2592 SendCmd [list map layer add $tag line wfs $format $info(wfs.typename) $info(wfs.url) $info(cache) $r $g $b $style(-width) $style(-cap) $style(-join) $style(-stipplepattern) $style(-stipplefactor) $style(-clamping) $style(-clamptechnique)] 2593 } 2594 } 2595 } 2596 SendCmd "map layer opacity $style(-opacity) $tag" 2594 2597 } 2595 2598 "point" { … … 2606 2609 set style(-opacity) $info(opacity) 2607 2610 } 2608 set _opacity($ layer) [expr $style(-opacity) * 100]2611 set _opacity($tag) [expr $style(-opacity) * 100] 2609 2612 foreach {r g b} [Color2RGB $style(-color)] {} 2610 2613 switch -- $info(driver) { … … 2612 2615 SendFiles $info(ogr.url) 2613 2616 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2614 SendCmd [list map layer add $ layerpoint ogr {} {} $info(ogr.url) $info(cache) $r $g $b $style(-size) $style(-minrange) $style(-maxrange)]2617 SendCmd [list map layer add $tag point ogr {} {} $info(ogr.url) $info(cache) $r $g $b $style(-size) $style(-minrange) $style(-maxrange)] 2615 2618 } else { 2616 SendCmd [list map layer add $ layerpoint ogr {} {} $info(ogr.url) $info(cache) $r $g $b $style(-size)]2619 SendCmd [list map layer add $tag point ogr {} {} $info(ogr.url) $info(cache) $r $g $b $style(-size)] 2617 2620 } 2618 2621 } … … 2623 2626 } 2624 2627 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2625 SendCmd [list map layer add $ layerpoint tfs $format {} $info(ogr.url) $info(cache) $r $g $b $style(-size) $style(-minrange) $style(-maxrange)]2628 SendCmd [list map layer add $tag point tfs $format {} $info(ogr.url) $info(cache) $r $g $b $style(-size) $style(-minrange) $style(-maxrange)] 2626 2629 } else { 2627 SendCmd [list map layer add $ layerpoint tfs $format {} $info(ogr.url) $info(cache) $r $g $b $style(-size)]2630 SendCmd [list map layer add $tag point tfs $format {} $info(ogr.url) $info(cache) $r $g $b $style(-size)] 2628 2631 } 2629 2632 } … … 2634 2637 } 2635 2638 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2636 SendCmd [list map layer add $ layerpoint wfs $format $info(wfs.typename) $info(ogr.url) $info(cache) $r $g $b $style(-size) $style(-minrange) $style(-maxrange)]2639 SendCmd [list map layer add $tag point wfs $format $info(wfs.typename) $info(ogr.url) $info(cache) $r $g $b $style(-size) $style(-minrange) $style(-maxrange)] 2637 2640 } else { 2638 SendCmd [list map layer add $ layerpoint wfs $format $info(wfs.typename) $info(ogr.url) $info(cache) $r $g $b $style(-size)]2639 } 2640 } 2641 } 2642 SendCmd "map layer opacity $style(-opacity) $ layer"2641 SendCmd [list map layer add $tag point wfs $format $info(wfs.typename) $info(ogr.url) $info(cache) $r $g $b $style(-size)] 2642 } 2643 } 2644 } 2645 SendCmd "map layer opacity $style(-opacity) $tag" 2643 2646 } 2644 2647 "icon" { … … 2659 2662 set style(-opacity) $info(opacity) 2660 2663 } 2661 set _opacity($ layer) [expr $style(-opacity) * 100]2664 set _opacity($tag) [expr $style(-opacity) * 100] 2662 2665 switch -- $info(driver) { 2663 2666 "ogr" { 2664 2667 SendFiles $info(ogr.url) 2665 2668 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2666 SendCmd [list map layer add $ layericon ogr {} {} $info(ogr.url) $info(cache) $style(-icon) $style(-scale) $style(-heading) $style(-declutter) $style(-placement) $style(-align) $style(-minrange) $style(-maxrange)]2669 SendCmd [list map layer add $tag icon ogr {} {} $info(ogr.url) $info(cache) $style(-icon) $style(-scale) $style(-heading) $style(-declutter) $style(-placement) $style(-align) $style(-minrange) $style(-maxrange)] 2667 2670 } else { 2668 SendCmd [list map layer add $ layericon ogr {} {} $info(ogr.url) $info(cache) $style(-icon) $style(-scale) $style(-heading) $style(-declutter) $style(-placement) $style(-align)]2671 SendCmd [list map layer add $tag icon ogr {} {} $info(ogr.url) $info(cache) $style(-icon) $style(-scale) $style(-heading) $style(-declutter) $style(-placement) $style(-align)] 2669 2672 } 2670 2673 } … … 2675 2678 } 2676 2679 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2677 SendCmd [list map layer add $ layericon tfs $format {} $info(tfs.url) $info(cache) $style(-icon) $style(-scale) $style(-heading) $style(-declutter) $style(-placement) $style(-align) $style(-minrange) $style(-maxrange)]2680 SendCmd [list map layer add $tag icon tfs $format {} $info(tfs.url) $info(cache) $style(-icon) $style(-scale) $style(-heading) $style(-declutter) $style(-placement) $style(-align) $style(-minrange) $style(-maxrange)] 2678 2681 } else { 2679 SendCmd [list map layer add $ layericon tfs $format {} $info(tfs.url) $info(cache) $style(-icon) $style(-scale) $style(-heading) $style(-declutter) $style(-placement) $style(-align)]2682 SendCmd [list map layer add $tag icon tfs $format {} $info(tfs.url) $info(cache) $style(-icon) $style(-scale) $style(-heading) $style(-declutter) $style(-placement) $style(-align)] 2680 2683 } 2681 2684 } … … 2686 2689 } 2687 2690 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2688 SendCmd [list map layer add $ layericon wfs $format $info(wfs.typename) $info(wfs.url) $info(cache) $style(-icon) $style(-scale) $style(-heading) $style(-declutter) $style(-placement) $style(-align) $style(-minrange) $style(-maxrange)]2691 SendCmd [list map layer add $tag icon wfs $format $info(wfs.typename) $info(wfs.url) $info(cache) $style(-icon) $style(-scale) $style(-heading) $style(-declutter) $style(-placement) $style(-align) $style(-minrange) $style(-maxrange)] 2689 2692 } else { 2690 SendCmd [list map layer add $ layericon wfs $format $info(wfs.typename) $info(wfs.url) $info(cache) $style(-icon) $style(-scale) $style(-heading) $style(-declutter) $style(-placement) $style(-align)]2691 } 2692 } 2693 } 2694 SendCmd "map layer opacity $style(-opacity) $ layer"2693 SendCmd [list map layer add $tag icon wfs $format $info(wfs.typename) $info(wfs.url) $info(cache) $style(-icon) $style(-scale) $style(-heading) $style(-declutter) $style(-placement) $style(-align)] 2694 } 2695 } 2696 } 2697 SendCmd "map layer opacity $style(-opacity) $tag" 2695 2698 } 2696 2699 "polygon" { … … 2710 2713 set style(-opacity) $info(opacity) 2711 2714 } 2712 set _opacity($ layer) [expr $style(-opacity) * 100]2715 set _opacity($tag) [expr $style(-opacity) * 100] 2713 2716 foreach {r g b} [Color2RGB $style(-color)] {} 2714 2717 foreach {strokeR strokeG strokeB} [Color2RGB $style(-strokecolor)] {} … … 2717 2720 SendFiles $info(ogr.url) 2718 2721 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2719 SendCmd [list map layer add $ layerpolygon ogr {} {} $info(ogr.url) $info(cache) $r $g $b $style(-strokewidth) $strokeR $strokeG $strokeB $style(-clamping) $style(-clamptechnique) $style(-minrange) $style(-maxrange)]2722 SendCmd [list map layer add $tag polygon ogr {} {} $info(ogr.url) $info(cache) $r $g $b $style(-strokewidth) $strokeR $strokeG $strokeB $style(-clamping) $style(-clamptechnique) $style(-minrange) $style(-maxrange)] 2720 2723 } else { 2721 SendCmd [list map layer add $ layerpolygon ogr {} {} $info(ogr.url) $info(cache) $r $g $b $style(-strokewidth) $strokeR $strokeG $strokeB $style(-clamping) $style(-clamptechnique)]2724 SendCmd [list map layer add $tag polygon ogr {} {} $info(ogr.url) $info(cache) $r $g $b $style(-strokewidth) $strokeR $strokeG $strokeB $style(-clamping) $style(-clamptechnique)] 2722 2725 } 2723 2726 } … … 2728 2731 } 2729 2732 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2730 SendCmd [list map layer add $ layerpolygon tfs $format {} $info(tfs.url) $info(cache) $r $g $b $style(-strokewidth) $strokeR $strokeG $strokeB $style(-clamping) $style(-clamptechnique) $style(-minrange) $style(-maxrange)]2733 SendCmd [list map layer add $tag polygon tfs $format {} $info(tfs.url) $info(cache) $r $g $b $style(-strokewidth) $strokeR $strokeG $strokeB $style(-clamping) $style(-clamptechnique) $style(-minrange) $style(-maxrange)] 2731 2734 } else { 2732 SendCmd [list map layer add $ layerpolygon tfs $format {} $info(tfs.url) $info(cache) $r $g $b $style(-strokewidth) $strokeR $strokeG $strokeB $style(-clamping) $style(-clamptechnique)]2735 SendCmd [list map layer add $tag polygon tfs $format {} $info(tfs.url) $info(cache) $r $g $b $style(-strokewidth) $strokeR $strokeG $strokeB $style(-clamping) $style(-clamptechnique)] 2733 2736 } 2734 2737 } … … 2739 2742 } 2740 2743 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2741 SendCmd [list map layer add $ layerpolygon wfs $format $info(wfs.typename) $info(wfs.url) $info(cache) $r $g $b $style(-strokewidth) $strokeR $strokeG $strokeB $style(-clamping) $style(-clamptechnique) $style(-minrange) $style(-maxrange)]2744 SendCmd [list map layer add $tag polygon wfs $format $info(wfs.typename) $info(wfs.url) $info(cache) $r $g $b $style(-strokewidth) $strokeR $strokeG $strokeB $style(-clamping) $style(-clamptechnique) $style(-minrange) $style(-maxrange)] 2742 2745 } else { 2743 SendCmd [list map layer add $ layerpolygon wfs $format $info(wfs.typename) $info(wfs.url) $info(cache) $r $g $b $style(-strokewidth) $strokeR $strokeG $strokeB $style(-clamping) $style(-clamptechnique)]2744 } 2745 } 2746 } 2747 SendCmd "map layer opacity $style(-opacity) $ layer"2746 SendCmd [list map layer add $tag polygon wfs $format $info(wfs.typename) $info(wfs.url) $info(cache) $r $g $b $style(-strokewidth) $strokeR $strokeG $strokeB $style(-clamping) $style(-clamptechnique)] 2747 } 2748 } 2749 } 2750 SendCmd "map layer opacity $style(-opacity) $tag" 2748 2751 } 2749 2752 "label" { … … 2769 2772 set style(-opacity) $info(opacity) 2770 2773 } 2771 set _opacity($ layer) [expr $style(-opacity) * 100]2774 set _opacity($tag) [expr $style(-opacity) * 100] 2772 2775 set contentExpr $info(content) 2773 2776 if {[info exists info(priority)]} { … … 2782 2785 SendFiles $info(ogr.url) 2783 2786 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2784 SendCmd [list map layer add $ layertext ogr {} {} $info(ogr.url) $info(cache) $contentExpr $priorityExpr $fgR $fgG $fgB $bgR $bgG $bgB $style(-halowidth) $style(-fontsize) $style(-removedupes) $style(-declutter) $style(-align) $style(-xoffset) $style(-yoffset) $style(-minrange) $style(-maxrange)]2787 SendCmd [list map layer add $tag text ogr {} {} $info(ogr.url) $info(cache) $contentExpr $priorityExpr $fgR $fgG $fgB $bgR $bgG $bgB $style(-halowidth) $style(-fontsize) $style(-removedupes) $style(-declutter) $style(-align) $style(-xoffset) $style(-yoffset) $style(-minrange) $style(-maxrange)] 2785 2788 } else { 2786 SendCmd [list map layer add $ layertext ogr {} {} $info(ogr.url) $info(cache) $contentExpr $priorityExpr $fgR $fgG $fgB $bgR $bgG $bgB $style(-halowidth) $style(-fontsize) $style(-removedupes) $style(-declutter) $style(-align) $style(-xoffset) $style(-yoffset)]2789 SendCmd [list map layer add $tag text ogr {} {} $info(ogr.url) $info(cache) $contentExpr $priorityExpr $fgR $fgG $fgB $bgR $bgG $bgB $style(-halowidth) $style(-fontsize) $style(-removedupes) $style(-declutter) $style(-align) $style(-xoffset) $style(-yoffset)] 2787 2790 } 2788 2791 } … … 2793 2796 } 2794 2797 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2795 SendCmd [list map layer add $ layertext tfs $format {} $info(tfs.url) $info(cache) $contentExpr $priorityExpr $fgR $fgG $fgB $bgR $bgG $bgB $style(-halowidth) $style(-fontsize) $style(-removedupes) $style(-declutter) $style(-align) $style(-xoffset) $style(-yoffset) $style(-minrange) $style(-maxrange)]2798 SendCmd [list map layer add $tag text tfs $format {} $info(tfs.url) $info(cache) $contentExpr $priorityExpr $fgR $fgG $fgB $bgR $bgG $bgB $style(-halowidth) $style(-fontsize) $style(-removedupes) $style(-declutter) $style(-align) $style(-xoffset) $style(-yoffset) $style(-minrange) $style(-maxrange)] 2796 2799 } else { 2797 SendCmd [list map layer add $ layertext tfs $format {} $info(tfs.url) $info(cache) $contentExpr $priorityExpr $fgR $fgG $fgB $bgR $bgG $bgB $style(-halowidth) $style(-fontsize) $style(-removedupes) $style(-declutter) $style(-align) $style(-xoffset) $style(-yoffset)]2800 SendCmd [list map layer add $tag text tfs $format {} $info(tfs.url) $info(cache) $contentExpr $priorityExpr $fgR $fgG $fgB $bgR $bgG $bgB $style(-halowidth) $style(-fontsize) $style(-removedupes) $style(-declutter) $style(-align) $style(-xoffset) $style(-yoffset)] 2798 2801 } 2799 2802 } … … 2804 2807 } 2805 2808 if {[info exists style(-minrange)] && [info exists style(-maxrange)]} { 2806 SendCmd [list map layer add $ layertext wfs $format $info(wfs.typename) $info(wfs.url) $contentExpr $priorityExpr $fgR $fgG $fgB $bgR $bgG $bgB $style(-halowidth) $style(-fontsize) $style(-removedupes) $style(-declutter) $style(-align) $style(-xoffset) $style(-yoffset) $style(-minrange) $style(-maxrange)]2809 SendCmd [list map layer add $tag text wfs $format $info(wfs.typename) $info(wfs.url) $contentExpr $priorityExpr $fgR $fgG $fgB $bgR $bgG $bgB $style(-halowidth) $style(-fontsize) $style(-removedupes) $style(-declutter) $style(-align) $style(-xoffset) $style(-yoffset) $style(-minrange) $style(-maxrange)] 2807 2810 } else { 2808 SendCmd [list map layer add $ layertext wfs $format $info(wfs.typename) $info(wfs.url) $contentExpr $priorityExpr $fgR $fgG $fgB $bgR $bgG $bgB $style(-halowidth) $style(-fontsize) $style(-removedupes) $style(-declutter) $style(-align) $style(-xoffset) $style(-yoffset)]2809 } 2810 } 2811 } 2812 SendCmd "map layer opacity $style(-opacity) $ layer"2811 SendCmd [list map layer add $tag text wfs $format $info(wfs.typename) $info(wfs.url) $contentExpr $priorityExpr $fgR $fgG $fgB $bgR $bgG $bgB $style(-halowidth) $style(-fontsize) $style(-removedupes) $style(-declutter) $style(-align) $style(-xoffset) $style(-yoffset)] 2812 } 2813 } 2814 } 2815 SendCmd "map layer opacity $style(-opacity) $tag" 2813 2816 } 2814 2817 } … … 2816 2819 if {[info exists info(placard)]} { 2817 2820 array set placard [$dataobj getPlacardConfig $layer] 2818 SendCmd [list placard config $placard(attrlist) $placard(style) $placard(padding) $ layer]2819 } 2820 2821 SendCmd "map layer visible $_visibility($ layer) $layer"2821 SendCmd [list placard config $placard(attrlist) $placard(style) $placard(padding) $tag] 2822 } 2823 2824 SendCmd "map layer visible $_visibility($tag) $tag" 2822 2825 } 2823 2826 2824 2827 itcl::body Rappture::MapViewer::SetLayerOpacity { dataobj layer {value 100}} { 2825 set val $_opacity($layer) 2828 set tag $layer 2829 set val $_opacity($tag) 2826 2830 set sval [expr { 0.01 * double($val) }] 2827 SendCmd "map layer opacity $sval $ layer"2831 SendCmd "map layer opacity $sval $tag" 2828 2832 } 2829 2833 2830 2834 itcl::body Rappture::MapViewer::SetLayerVisibility { dataobj layer } { 2831 set bool $_visibility($layer) 2832 SendCmd "map layer visible $bool $layer" 2835 set tag $layer 2836 set bool $_visibility($tag) 2837 SendCmd "map layer visible $bool $tag" 2833 2838 } 2834 2839 … … 2848 2853 array unset info 2849 2854 array set info [$dataobj layer $layer] 2850 checkbutton $f.${layer}_visible \ 2855 set tag $layer 2856 set ctlname $layer 2857 checkbutton $f.${ctlname}_visible \ 2851 2858 -text $info(label) \ 2852 2859 -font "Arial 9" -anchor w \ 2853 -variable [itcl::scope _visibility($ layer)] \2860 -variable [itcl::scope _visibility($tag)] \ 2854 2861 -command [itcl::code $this \ 2855 2862 SetLayerVisibility $dataobj $layer] 2856 blt::table $f $row,0 $f.${ layer}_visible -anchor w -pady 2 -cspan 22863 blt::table $f $row,0 $f.${ctlname}_visible -anchor w -pady 2 -cspan 2 2857 2864 incr row 2858 2865 if { $info(type) == "image" } { 2859 2866 incr imgIdx 2860 2867 if { $info(driver) == "colorramp" } { 2861 set colormap $ layer2868 set colormap $ctlname 2862 2869 if { ![info exists _image(legend-$colormap)] } { 2863 2870 set _image(legend-$colormap) [image create photo] … … 2880 2887 } 2881 2888 } 2882 if { $info(type) != "elevation" && ($info(type) != "image" || $imgIdx > 1) } { 2883 label $f.${layer}_opacity_l -text "Opacity" -font "Arial 9" 2884 ::scale $f.${layer}_opacity -from 0 -to 100 \ 2889 if { $info(type) != "elevation" && 2890 ($info(type) != "image" || $imgIdx > 1) } { 2891 label $f.${ctlname}_opacity_l -text "Opacity" -font "Arial 9" 2892 ::scale $f.${ctlname}_opacity -from 0 -to 100 \ 2885 2893 -orient horizontal -showvalue off \ 2886 -variable [itcl::scope _opacity($ layer)] \2894 -variable [itcl::scope _opacity($tag)] \ 2887 2895 -width 10 \ 2888 2896 -command [itcl::code $this \ 2889 2897 SetLayerOpacity $dataobj $layer] 2890 Rappture::Tooltip::for $f.${ layer}_opacity "Set opacity of $info(label) layer"2891 blt::table $f $row,0 $f.${ layer}_opacity_l -anchor w -pady 22892 blt::table $f $row,1 $f.${ layer}_opacity -anchor w -pady 22898 Rappture::Tooltip::for $f.${ctlname}_opacity "Set opacity of $info(label) layer" 2899 blt::table $f $row,0 $f.${ctlname}_opacity_l -anchor w -pady 2 2900 blt::table $f $row,1 $f.${ctlname}_opacity -anchor w -pady 2 2893 2901 incr row 2894 2902 } … … 2898 2906 lappend tooltip $info(attribution) 2899 2907 } 2900 Rappture::Tooltip::for $f.${ layer}_visible [join $tooltip \n]2908 Rappture::Tooltip::for $f.${ctlname}_visible [join $tooltip \n] 2901 2909 } 2902 2910 set mapAttrib [$dataobj hints "attribution"]
Note: See TracChangeset
for help on using the changeset viewer.