Index: trunk/gui/scripts/mapviewer.tcl
===================================================================
--- trunk/gui/scripts/mapviewer.tcl	(revision 5892)
+++ trunk/gui/scripts/mapviewer.tcl	(revision 5896)
@@ -116,4 +116,5 @@
     private method Rotate {option x y}
     private method Select {option x y}
+    private method SendFiles { path }
     private method SetHeading { {value 0} }
     private method SetLayerOpacity { dataobj layer {value 100} }
@@ -2337,4 +2338,25 @@
 }
 
+itcl::body Rappture::MapViewer::SendFiles { path } {
+    if {[string range $path 0 7] != "local://"} {
+        return
+    }
+    DebugTrace "Local path: $path"
+    set path [string range $path 8 end]
+    set basename [file rootname $path]
+    set files [glob -path $basename .*]
+    foreach file $files {
+        set name $file
+        set type [file type $file]
+        set size [file size $file]
+        set f [open $file "r"]
+        fconfigure $f -translation binary -encoding binary
+        set data [read $f]
+        close $f
+        SendCmd [list file put $name $type $size]
+        SendData $data
+    }
+}
+
 itcl::body Rappture::MapViewer::SetLayerStyle { dataobj layer } {
     array set info [$dataobj layer $layer]
@@ -2370,4 +2392,5 @@
                     "colorramp" {
                         set cmapName $layer
+                        SendFiles $info(colorramp.url)
                         SendCmd [list colormap define $cmapName $info(colorramp.colormap)]
                         SendCmd [list map layer add $layer image colorramp \
@@ -2379,4 +2402,5 @@
                     }
                     "gdal" {
+                        SendFiles $info(gdal.url)
                         SendCmd [list map layer add $layer image gdal \
                                      $info(gdal.url) $info(cache) $coverage]
@@ -2412,4 +2436,5 @@
                 switch -- $info(driver)  {
                     "gdal" {
+                        SendFiles $info(gdal.url)
                         SendCmd [list map layer add $layer elevation gdal \
                                      $info(gdal.url) $info(cache)]
@@ -2464,4 +2489,5 @@
                 lappend cmd $style(-minrange) $style(-maxrange)
             }
+            SendFiles $info(ogr.url)
             SendCmd $cmd
         }
@@ -2489,4 +2515,5 @@
             switch -- $info(driver)  {
                 "ogr" {
+                    SendFiles $info(ogr.url)
                     if {[info exists style(-minrange)] && [info exists style(-maxrange)]} {
                         SendCmd [list map layer add $layer 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)]
@@ -2537,4 +2564,5 @@
             switch -- $info(driver)  {
                 "ogr" {
+                    SendFiles $info(ogr.url)
                     if {[info exists style(-minrange)] && [info exists style(-maxrange)]} {
                         SendCmd [list map layer add $layer point ogr {} {} $info(ogr.url) $info(cache) $r $g $b $style(-size) $style(-minrange) $style(-maxrange)]
@@ -2588,4 +2616,5 @@
             switch -- $info(driver)  {
                 "ogr" {
+                    SendFiles $info(ogr.url)
                     if {[info exists style(-minrange)] && [info exists style(-maxrange)]} {
                         SendCmd [list map layer add $layer icon ogr {} {} $info(ogr.url) $info(cache) $style(-icon) $style(-scale) $style(-heading) $style(-declutter) $style(-placement) $style(-align) $style(-minrange) $style(-maxrange)]
@@ -2640,4 +2669,5 @@
             switch -- $info(driver)  {
                 "ogr" {
+                    SendFiles $info(ogr.url)
                     if {[info exists style(-minrange)] && [info exists style(-maxrange)]} {
                         SendCmd [list map layer add $layer polygon ogr {} {} $info(ogr.url) $info(cache) $r $g $b $style(-strokewidth) $strokeR $strokeG $strokeB $style(-clamping) $style(-clamptechnique) $style(-minrange) $style(-maxrange)]
@@ -2704,4 +2734,5 @@
             switch -- $info(driver)  {
                 "ogr" {
+                    SendFiles $info(ogr.url)
                     if {[info exists style(-minrange)] && [info exists style(-maxrange)]} {
                         SendCmd [list map layer add $layer 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)]
