[Mapserver-users] Hwo to change OVERLAYSIZE from perl/php?

Sean Gillies sgillies at frii.com
Tue Jun 1 10:21:51 EDT 2004


On Jun 1, 2004, at 7:50 AM, Hermann-Marcus Behrens wrote:

> Hello,
>
> I'm using the new mapserv/mapscript 4.2 and I would
> like to access OVERLAYSYMBOL and OVERLAYSIZE from within mapscript 
> with perl.
>
> Is this not possible anymore? I tried to change the values with 
> "classObj" and "styleObj", but
> both attempts failed.
>
> I need OVERLAYSIZE to change dynamically the "border" around polylines 
> for streets.
> Before OVERLAYSYMBOL etc. were introduced, I drew the streets twofold,
> once a little bit thicker and in a darker color and the second time 
> thinner with a lighter color.
>
> Is this a reasonable way to create borders around polylines?
>
> Greetings from Germany,
>
> Hermann Behrens

Hello Hermann,

The OVERLAYSYMBOL is deprecated.  The best practice is to use multiple 
styles.

In your mapfile, define two styles for a class.  The second will be 
rendered
over the first, the same order as layers are drawn.

To dynamically add a second (overlay) style with mapscript, do 
something like
this:

     $style = $class->getStyle(0);                       # underneath 
style
     $overlay_style = new mapscript::styleObj($class);   # new style at 
index 1
     $overlay_style->{symbol} = $overlay_symbol;         # a symbol 
index number
     $overlay_style->{size} = $overlay_size;             # new symbol 
size

cheers,
Sean

--
Sean Gillies
sgillies at frii dot com
http://users.frii.com/sgillies




More information about the mapserver-users mailing list