[ka-Map-users] printing maps with added objects & printing
transparent layers
Lorenzo Becchi
lorenzo at ominiverdi.com
Thu Aug 31 03:49:25 EDT 2006
Hi Donald,
> What is the best way to print a map showing objects that have been
added using
> myKaMap.addObjectGeo( canvas, x, y, img );
>
> print_map.php seems to just read the layers in the map file. How
can I let it know that I have extra 'stuff'.
From the code, as you've seen, it's clear that print_map.php need to
have a mapfile as reference and then print the image as a normal
mapserver instance.
If you want to add something that's not in your mapfile you should
add it on the fly in print_map.php using mapscript.
> On a different note, to take into account layer transparency I had
to add
>
> $opacity = $oLayer->getMetaData('opacity');
> if($opacity != ''){
> $oLayer->set('transparency',$opacity);
> }
>
>when looping through the layers in print_map.php.
thanks, it sounds useful. I've forgot to put transparence reference
in print_map.
Anyway I think there's something more to do: as you are doing
trasparency is get only from the mapfile.
If you want ka-Map trasparency to be respected printing you'll need
to pass this information from myPrint() function (startUp.js, pay
attention to change the startUp.js you are including in your
application).
So:
var params='map='+cMap+'&scale='+scale+'&img_width='+img_width
+'&groups='+szLayers+'&extent='+extent[0]+'|'+extent[1]+'|'+extent[2]
+'|'+extent[3];
should include, as example, the &trasparence=100,80,100,20 parameter
to define each layer trasparency.
then you'll need to parse this string during your check looping layers.
If you have time to do this, please contribute your code.
I'll be happy to put this code in the CVS.
ciao
Lorenzo
More information about the ka-Map-users
mailing list