Changeset 6008 for trunk/gui/scripts/map.tcl
- Timestamp:
- Feb 12, 2016 5:22:38 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/map.tcl
r5997 r6008 34 34 public method deleteLayer { layerName } 35 35 public method deleteViewpoint { viewpointName } 36 public method earthfile {}37 36 public method getPlacardConfig { layerName } 38 37 public method hasLayer { layerName } … … 865 864 return [expr {[hints "type"] eq "geocentric"}] 866 865 } 867 868 itcl::body Rappture::Map::earthfile {} {869 array set info [$_tree get root]870 append out "<map"871 append out " name=\"$info(label)\""872 append out " type=\"$info(type)\""873 append out " version=\"2\""874 append out ">\n"875 # Profile is optional876 if { [info exists info(projection)] } {877 append out " <options>\n"878 append out " <profile"879 append out " srs=\"$info(projection)\""880 if { [info exists info(extents)] && $info(extents) != "" } {881 foreach {x1 y1 x2 y2} $info(extents) break882 append out " xmin=\"$x1\""883 append out " ymin=\"$y1\""884 append out " xmax=\"$x2\""885 append out " ymax=\"$y2\""886 }887 append out "/>\n"888 append out " </options>\n"889 }890 foreach node [$_tree children root->"layers"] {891 array unset info892 array set info [$_tree get $node]893 set label [$_tree label $node]894 switch -- $info(type) {895 "image" {896 append out " <image"897 append out " name=\"$label\""898 append out " driver=\"gdal\""899 if { [info exists info(opacity)] } {900 append out " opacity=\"$info(opacity)\""901 }902 if { $info(visible) } {903 append out " visible=\"true\""904 } else {905 append out " visible=\"false\""906 }907 append out ">\n"908 append out " <url>$info(url)</url>\n"909 append out " </image>\n"910 }911 "elevation" {912 append out " <elevation"913 append out " name=\"$label\""914 append out " driver=\"gdal\""915 if { $info(visible) } {916 append out " visible=\"true\""917 } else {918 append out " visible=\"false\""919 }920 append out ">\n"921 append out " <url>$info(url)</url>\n"922 append out " </elevation>\n"923 }924 default {925 puts stderr "Type $info(type) not implemented in earthfile"926 }927 }928 }929 append out "</map>\n"930 }
Note: See TracChangeset
for help on using the changeset viewer.