php3-mapscript, how to use expression

Assefa Yewondwossen assefa1 at yahoo.com
Wed Aug 30 11:09:12 PDT 2000


Hi,

 Here is an example that dynamically creates classes
on a certain layer (assumes here that $gpoMap is the
map object and there is a layer called classified in
the .map file) :

$poLayer = $gpoMap->getlayerbyname("classified");
    
$poLayer->set("classitem", "VW");
            
$nColorId = $gpoMap->addColor(255, 0, 0);
                    
$poClass = ms_newClassObj($poLayer);

$poClass->set("color", $nColorId);
                                   
$poClass->setExpression("069");
 

 Hope it helps,
 
--- Christian <christian at gottschling.net> wrote:
> Hello,
> finally I got php3 with mapserver-expansion on
> Mandrake running. Hint for 
> all those that want to try it, too.
> The php3-module that came with Mandrake is compiled
> with gd1.7 (without 
> gif), so take care to compile mapserver with the new
> gd-version. Or 
> recompile the php with old gd.
> 
> But back to my questions. Here is an excerpt from my
> mapfile:
> 
> CLASSITEM 'VW'
>          CLASS
>            EXPRESSION '069' # City of Frankfurt
>            COLOR 250 0 0
>            OUTLINECOLOR 10 240 10
> END
> 
> Short Info: This colorizes a region with the prefix
> 069 red.
> 
> Now I like to colorize regions "dynamically", on the
> fly, within my 
> php-script. Different colors for different prefixes.
> Any hints how to do that?
> 
> The gmap-example is nice, but very large and not
> easy to understand for a 
> rookie like me.
> Are there any more examples out?
> 
> --
> Christian
> 
> 
> --
> christian
> 


=====


__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/



More information about the MapServer-users mailing list