<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Donal thanks for your code. I've put it on CVS but with some changes.<DIV><BR class="khtml-block-placeholder"></DIV><DIV>Why have you changed this line?</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">header("Content-Disposition: attachment; filename=\"".$oMap->name.".tiff\"");</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><BR>in this:</P><DIV><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">header("Content-Disposition: attachment; filename=".$oMap->name.".tiff");</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><BR>and why this:</P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">header("Content-Disposition: attachment; filename=\"".$oMap->name.".".strtolower($_REQUEST['output_type'])."\"");</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><BR class="khtml-block-placeholder"></P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><BR>in this:</P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><BR class="khtml-block-placeholder"></P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">header("Content-Disposition: attachment; filename=".$oMap->name.".".$_REQUEST['output_type']);</SPAN></FONT></DIV><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN><BR><SPAN class="Apple-style-span" style="white-space: pre;"><SPAN class="Apple-style-span" style="white-space: normal;"><BR class="khtml-block-placeholder"></SPAN></SPAN>        </P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px">All that strange syntax was granting some compatibility with filenames with all browsers in windows and mac.</P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px">I suggest you to put it on again.</P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><BR class="khtml-block-placeholder"></P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px">and why did you skipped </P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><FONT class="Apple-style-span" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">location.href=</SPAN></FONT><FONT class="Apple-style-span" color="#2A00FF" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">'tools/print/print_map.php?'</SPAN></FONT><FONT class="Apple-style-span" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">+params;</SPAN></FONT></P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><FONT class="Apple-style-span" face="Monaco" size="3"><SPAN class="Apple-style-span" style="font-size: 11px;">using the old winOpener ?</SPAN></FONT></P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><BR class="khtml-block-placeholder"></P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px">I know there's not a perfect solution, I'm interested in your opinion.</P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><BR class="khtml-block-placeholder"></P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px">Testing the new solution I've found another limitation of my code: if you move layers up and down the printed map is maintaining the orginal disposition.</P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px">This means looping layers inside a new loop of "group" array caching correspondences.</P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><SPAN class="Apple-tab-span" style="white-space:pre"></SPAN>Do you want to do this too?<BR></P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><BR class="khtml-block-placeholder"></P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px">I've put your name in the code. Update from CVS.</P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><BR class="khtml-block-placeholder"></P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px">ciao </P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px">Lorenzo</P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><BR class="khtml-block-placeholder"></P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px">ps: please if you don't want to use a line of code leave it commented in your new code so I can understand quickly what you've change without looking for diffs.</P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><BR class="khtml-block-placeholder"></P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><BR class="khtml-block-placeholder"></P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><BR class="khtml-block-placeholder"></P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><BR class="khtml-block-placeholder"></P><P style="margin: 0.0px 0.0px 0.0px 0.0px; min-height: 14.0px"><BR class="khtml-block-placeholder"></P><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR><DIV><DIV>On 01/set/06, at 04:13, Donal Regan wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite">Lorenzo, <BR><BR>I have attached a copy of print_map.php that now takes into account layer opacity. The changes to the javascript function myPrint() are shown down below.<BR>I took on board what you suggested so print_map.php now checks for opacitys in the querystring:<BR><BR><BR>if (isset($_REQUEST['opacitys']))$opacitys=$_REQUEST['opacitys'];<BR>else $opacitys="";<BR>$aOpacity=explode(',',$opacitys);<BR><BR><BR>and while looping through the layers we can now do the following<BR><BR>elseif (in_array($oLayer->group,$aGroup)){<BR> $oLayer->set('status',MS_ON);<BR> $opacity = $aOpacity[array_search($oLayer->group,$aGroup)];<BR> if($opacity!='')$oLayer->set('transparency',$opacity);<BR> if(!$oLayer->isVisible() && ($oLayer->minscale < $scale && $oLayer->maxscale > $scale )){<BR> $oLayer->set("minscale",0);<BR> $oLayer->set("maxscale",(200000000)); // has to be greater that map maximum scale<BR> }<BR> }<BR><BR>The myPrint() function should now look like the following<BR><BR>function myPrint() {<BR> var szLayers = '';<BR> var szOpacitys = '';<BR> <BR> var layers = myKaMap.getCurrentMap().getLayers();<BR> for (var i=0;i<layers.length;i++) {<BR> szLayers = szLayers + "," + layers[i].name;<BR> szOpacitys = szOpacitys + "," + layers[i].opacity;<BR> }<BR><BR> var extent = myKaMap.getGeoExtents();<BR> var scale = myKaMap.getCurrentScale();<BR> var cMap = myKaMap.getCurrentMap().name;<BR> <BR> var img_width = '600';// pixel dimension. max_img_width set inside print_map.php<BR> var params='map='+cMap+'&scale='+scale+'&img_width='+img_width+'&groups='+szLayers+"&opacitys="+szOpacitys+'&extent='+extent[0]+'|'+extent[1]+'|'+extent[2]+'|'+extent[3];<BR><BR> WOOpenWin( 'Print', '../tools/print/print_map.php?'+params, 'resizable=yes,scrollbars=yes,width=600,height=400' );<BR><BR>}<BR><BR><BR>The code works for me on Windows 2000, IE6 and Firefox 1.5.06.<BR><BR>Cheers.</BLOCKQUOTE></DIV></DIV></BODY></HTML>