Opened 9 years ago

Last modified 2 years ago

#634 new enhancement

HQ-Print with wrapper (hidden mapfile)

Reported by: frankjaeger Owned by: astrid_emde
Priority: minor Milestone:
Component: print Version: 2.5.1
Keywords: wrapper highqualitymapfiles _4.map Cc:

Description

Wrapping the mapfile of umn-mapserver in the url like

http://www.mapbender.org/SecureInstall#Kapselung_des_.27map.3D.27_CGI_Parameters

may not work with HQ-Print. Path and name to the mapfile has to be modified with "_4".

May be it will work with Double-Wrapper (a "_4"-Wrapper for "_4"-Mapfile).

So not only ".map" has to be replaced but also ".xml".

Change History (2)

comment:1 Changed 9 years ago by astrid_emde

Owner: changed from dev to astrid_emde

we already solved this in another project where the WMS are linked like :

This is the code for in mod_printPDF_pdf.php:

if($factor>1){
	for($i=0; $i<count($array_urls); $i++){
		if(strpos($array_urls[$i], ".xml?")===false){
			$m = new stripRequest($array_urls[$i]);
			$m->set('width',(intval($m->get('width'))*4));
			$m->set('height',(intval($m->get('height'))*4));
			
			if(in_array($m->get('map'),$highqualitymapfiles)){	
				$m->set('map',preg_replace("/\.map/","_4.map",$m->get('map')));			
			}
			$array_urls[$i] = $m->url;
		}
		else{
			$a = explode("?",$array_urls[$i]);
			$patterns = explode("&", $a[1]);
			for($k=0; $k<count($patterns); $k++){
				$tmp = explode("=", $patterns[$k]);
				if(mb_strtoupper($tmp[0]) == mb_strtoupper("width")){
					$replacement = mb_strtoupper("width") . "=" . $tmp[1]*4;
					$currentPattern = $patterns[$k];
					$array_urls[$i] = str_replace($currentPattern, $replacement, $array_urls[$i]);
				}
				if(mb_strtoupper($tmp[0]) == mb_strtoupper("height")){
					$replacement = mb_strtoupper("height") . "=" . $tmp[1]*4;
					$currentPattern = $patterns[$k];
					$array_urls[$i] = str_replace($currentPattern, $replacement, $array_urls[$i]);
				}
			}
			for($j=0;$j<count($highqualitymapfiles);$j++){
			
				if(strpos($array_urls[$i], $highqualitymapfiles[$j])===false){
					$array_urls[$i] = $array_urls[$i];
				}
				else{
					$array_urls[$i] = preg_replace("/\.xml/","_4.xml",$array_urls[$i]);
				}
			}
		}
	}
}

comment:2 Changed 2 years ago by astrid_emde

Milestone: 3.0 release

Ticket retargeted after milestone deleted

Note: See TracTickets for help on using tickets.