User Tools

Site Tools


doc:appunti:linux:sa:debian_11_12_mapserver_upgrade

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:appunti:linux:sa:debian_11_12_mapserver_upgrade [2023/11/23 17:55] – [MAP:TRANSPARENT not longer valid] niccolodoc:appunti:linux:sa:debian_11_12_mapserver_upgrade [2023/11/23 18:11] (current) – [MAP:TRANSPARENT not longer valid] niccolo
Line 43: Line 43:
 </code> </code>
  
-==== MAP:TRANSPARENT not longer valid ====+===== MAP:TRANSPARENT not longer valid =====
  
-In MapServer 8 mapfiles it is not longer accepted the **TRANSPARENT** identifier inside the MAP object, you have to move it into the **OUTPUTFORMAT** objectsomething like this:+In MapServer 8 mapfiles the **TRANSPARENT** identifier is not longer accepted inside the MAP object, you have to move it into the **OUTPUTFORMAT** objectsomething like this:
  
 <file> <file>
Line 58: Line 58:
 </file> </file>
  
-==== Name change of CGI parameters ====+===== Name change of CGI parameters ====
 + 
 +One of the biggest problem of the upgrade is the change of the name of some CGI parameters; notably the **map_size** option is not longer supported. 
 + 
 +I had web application based on OpenLayers 2.11, which included a MapServer bitmap layer. The JavaScript code automatically generates the request URL, something like this (parameters are split on different lines for readability): 
 + 
 +<code> 
 +/cgi-bin/mapserv?map=/usr/local/lib/mapserver/mie_strade.map 
 +    &format=image%2Fpng 
 +    &mode=map 
 +    &map_imagetype=png 
 +    &mapext=1235758.1079621+5432310.5814201+1242666.1043925+5443174.1940635 
 +    &imgext=1235758.1079621+5432310.5814201+1242666.1043925+5443174.1940635 
 +    &map_size=1446+2274 
 +    &imgx=723 
 +    &imgy=1137 
 +    &imgxy=1446+2274 
 +</code> 
 + 
 +Unfortunately the **map_size** option is not longer accepted and the resulting PNG image has the default size declared into the MAP:SIZE object of the mapfile, instead of the requested 1446x2274 pixels. This causes a **totally distorted map** image into the web application! 
 + 
 +This problem cannot be easily fixed, because the URL options are hard-coded into the OpenLayers code. So I had to replace all the OpenLayers 2.x code with the current **OpenLayers 8.x**, which required a total refactory of the code.
  
-One of the biggest problem is the change of the name of some CGI parameters. 
  
doc/appunti/linux/sa/debian_11_12_mapserver_upgrade.1700758522.txt.gz · Last modified: 2023/11/23 17:55 by niccolo