hi, I'm trying also to print and get (the composition of images) to
download and to include it in PDFs;
 I think the best solution is server coding. We can grab, using javascript,
the values of each WMS GetMap request at any moment (using Firebug can check
src values of each img in mainMapContainer div); these values can be passed
by ajax to PHP;
  using jquery (you can adapt it relatively easy to javascript) you can get
the visible images and pass the "src" parameter like this (I'm testing it
and works, also for remote WMS):

   //when we click the "print button"...
   $("#get_image").click( function()
                {
                var imatges=[]; 
                $("#mainMapContainer div div ").find("img").each( function()
                        {                               
                               //we check if the style says the layer is
visible or not
                                visibility=$(this).css("visibility");
                                if (visibility=='visible')
                                {
                                src=$(this).attr('src');
                                imatges.push(src);
                                }       
                                else
                                {
                                //we don't do anything??
                                }
                        }); // end of the foreach
         //GET AJAX request using jquery
         $.get('http://server_path/images.php', {params:
imatges.join('|')});
         });       //fi get_image

    and php code.... with GD compiled!
    
$params= $_GET['params'];
$array=str_replace("|"," ",$params);
$array=split(" ",$array);

$count=count($array);

$image0=imagecreatefrompng($array[0]);
$image1=imagecreatefrompng($array[1]);
//we merge the first 2 images
imagecopymerge($image0,$image1,0, 0, 0, 0, 760, 380,60); //60 is the opacity 

 for ($i=2;$i<$count;$i++)
{
$image=imagecreatefrompng($array[$i]);
//we merge the firstly generated image with the rest of images
imagecopymerge($image0,$image,0, 0, 0, 0, 760, 380,20); 
} //fi bucle for
//we save the image; now we can use it to download or to generate a PDF
(with existing libraries like FPDF)
imagepng($image0,'definitius.png');  

  hope it helps, 
  Pere Roca
  visit EDIT project! (http://edit.csic.es/edit_geo/prototype/edit.html)


Luke Michels wrote:
> 
> I have been working with mapbuilder and have found it a very nice tool. I 
> would like to enhance the way I have it now with a couple of things that I 
> cannot seem to find I was wondering if you could help me with this.
> 
> What I am using mapbuilder for is to take around 13 spatial layers and 10 
> vectors and turn them into a dynamic map. I have already gotten the map 
> working with Ka-Map, but Ka-Map does not provide some additional 
> components that mapbuilder does. The working Ka-Map version can be found 
> at "http://na.unep.net/swera_ims/map/";. While making this conversion to 
> mapbuilder may be an option, I need to provide the users of the system the 
> same functionality that is already provided by Ka-Map. There are three 
> major portions that have yet to be worked out.
> 
> Problem 1 is that I need to be able to print the map as an image as seen 
> on the page when some "Print" button or widget is activated. Does 
> mapbuilder allow this or is there some way to program around it. If not I 
> was thinking of saving the wmc to disk, which mapbuilder says it provides, 
> with a dynamic name and making a config  and html file on the fly to 
> produce just the map widget with some additional text and images also on 
> the html.
> 
> Problem 2 is that we have been using Ka-Map to tile and display the tiles 
> becuase some of the data sets are large and can take a long time to load. 
> I was wondering if Mapbuilder has a way to access the that file or 
> configuration the way that OL does. If not I have gotten mapbuilder to 
> pull in transparent maptiles from TileCache with the mapbuilder defined 
> resolutions. The problem with this is that for the levels of zoom that I 
> did not seed, I get pink blocks. I was wondering if there was a way to get 
> it to go to the tiles for certain resolutions and go to the map file for 
> others?
> 
> Problem 3 is that I have gotten a tree structure going with the layers and 
> vectors, but the layers that won't display till a lower resolution keep 
> showing up in that list. Is there anyway to hide the layers that won't be 
> displayed on the map for that resolution?
> 
> Thank you for taking the time to look at these questions and I look 
> forward to your response. 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
> Don't miss this year's exciting event. There's still time to save $100. 
> Use priority code J8TL2D2. 
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> mapbuilder-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mapbuilder-devel
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Printing%2C-Display%2C-and-Tiling-questions-tp16967413p17652011.html
Sent from the MapBuilder Devel mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
mapbuilder-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-devel

Reply via email to