[MAPSERVER-USERS] php database mapfile

Brent Wood pcreso at pcreso.com
Sat Apr 5 20:38:09 EDT 2008


--- nickthegreek- <nickthegreek_ at hotmail.com> wrote:

You can use variables & classes as one way, I've done that with variables in a
PostGIS SQL string. Your mapfile would have someyhing like:

LAYER countries
STATUS ON
...
CLASS 
EXPRESSION
   country='%country%'
...

You need to pass the value called country & set it to the value returned from
your map query. As long as no country values are null in your data, nothing
gets plotted in that class unless there is a match. If there is, this class
gets added to the map, using whatever symbology you defined for that class.
This enables similar functionality without mapscript.

For info on using variables like this, see
http://mapserver.gis.umn.edu/docs/reference/mapfile/variable_sub



> 
> hello.. what i wanna know is.. i have in my application a box checked box
> which say e,g rivers..
> 
> when someone ticks it.. then in the map apperas the rives..what i mean is
> ..in php code.. the status in the rivers layer is converting in ON and
> display..from the code below
> 
> 
>  if (preg_match("/cities/", $layers)){
>  	
>  	$cities = "CHECKED";
>  	$this_layer = $map->getLayerByName('europe cities');
>  	$this_layer->set('status', MS_ON);
>     
>  
>  }
>  
>  else {
>  	$cities = "";
>  	$this_layer = $map->getLayerByName('europe cities');
>  	$this_layer->set('status', MS_OFF);
>  }
> 
> what i wanna know is..i have down drop list.. i do a click and i have manu
> with all countries..if i made a select and i the menu a country ..how could
> i change the data in the mafile? i mean 
> data "the_geom from table where name=greece" in a way like the above i wrote
> ...??
> 
> 
> thanks
> 
> -- 
> View this message in context:
> http://www.nabble.com/php-database-mapfile-tp16519414p16519414.html
> Sent from the Mapserver - User mailing list archive at Nabble.com.
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 



More information about the mapserver-users mailing list