[OpenLayers-Users] How to use WMS, PHP MAPScript and Openlayers (all together :-) )

"tschobber tschöbbi" tschobber at gmx.at
Wed Apr 1 08:28:12 EDT 2009


Hi,

I have the following problems:

I've seen the following example how to use PHP Mapscript with WMS - here's the link to the example:

http://mapserver.org/ogc/mapscript.html#php-example

I have a index.php file - in this file I load an OpenLayers (.htm) file that shows a map. My intention is to modify/switch a single parameter (in my case the "DATA" attribute) in the .map file dynamically with PHP Mapscript (PHP function in index.php) and Openlayers (WMS) should show me the new map affected by the changed parameter but using the same shapefile.

I.e if this is a layer of my mapfile - I want to dynamically switch 
"DATA "testA.png" to "DATA "testB.png" over WMS/Openlayers"

in the index.php :

LAYER                                                           
NAME "test"                                  
DATA "testA.png" 
TYPE RASTER                                                     
STATUS ON                                                                                                
UNITS METERS                                           
PROJECTION                                             
"init=epsg:31297"
END     
                METADATA                                                                        
 "wms_name" "blayer"     
 "wms_title" "blayer"           
 "wms_srs" "EPSG:31297" 
END
END

Concerning the code of the tutorial:

How am I able to change this "DATA" object in the above layer with php mapscript? The following code looks very suspicious to me - is this code changing the Format type? If yes I want to do the same with the DATA object - but how?

$contenttype = ms_iostripstdoutbuffercontenttype();

if ($contenttype == 'image/png')
   header('Content-type: image/png');

Would be very cool if someone could help me.

best regards + thanks!






-- 
Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss für nur 17,95 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a



More information about the Users mailing list