[Mapserver-users] can I use different symbols in the samedynamic layer?
Frieso ter Haseborg
ter-haseborg at sf-datentechnik.de
Wed Sep 24 00:56:32 PDT 2003
Hi Eric,
thanx, yes this helped a lot. It works - but so far only, when using the
StyleObj-Class.
I did the following in PHP:
$sym1 = $map->getSymbolByName ( "excl" );
$sym2 = $map->getSymbolByName ( "tent" );
$class = $layer->getClass (0);
$style = $class->getStyle(0);
$style->set ( 'symbol', $sym1 );
[...]//draw point1
$style->set ( 'symbol', $sym2 );
[...]//draw point2
It looks like the symbol attribute is obsolete in MS and PHP/MapScript
version 4.0, though no error is raised. It simply effects nothing in my
configuration. Which version do you use?
Anyway it works, thanx again!
Best regards,
Frieso ter Haseborg
- Software Development -
--
--------------------------------------------------
S&F Datentechnik GmbH&Co.KG
Reimersstr. 41b
26789 Leer, Germany
>-----Original Message-----
>From: Eric Bridger [mailto:eric at gomoos.org]
>Sent: Tuesday, September 23, 2003 1:10 PM
>To: Frieso ter Haseborg
>Cc: Mapserver List
>Subject: Re: [Mapserver-users] can I use different symbols in the
>samedynamic layer?
>
>
>I do this all the time. You probably could acheive this using
>CLASSITEM
>and EXPRESSION, but typically I'll use a layer with a single class for
>such a layer. Then based on my data: (Perl mapscript, sorry not PHP)
>
>my $sym_idx_1 = $map->getSymbolByName("symbol_1");
>my $sym_idx_2 = $map->getSymbolByName("symbol_2");
>my $class = $layer->getClass(0);
>
>if(we want symbol 1){
> $class->{symbol} = $sym_idx_1;
>}
>if(we want symbol 2){
> $class->{symbol} = $sym_idx_2;
>}
>...
>$point->draw($map, $layer, $img, 0, 'label');
>
>HTH
>
>Eric
>
>
>On Tue, 2003-09-23 at 07:45, Frieso ter Haseborg wrote:
>> Hi,
>>
>>
>> I'm using PHP/MapScript to draw dynamic point-layers in a map. What I
>> would like to do is using different symbols for different
>points in the
>> same layer. Is there any way to achieve this using the mapfile
>> (expressions or something) or can this be done using PHP/MapScript?
>>
>> Here are parts of my setup:
>>
>> //points are created with mapscript
>> [...]
>> $pt = ms_newPointObj();
>> $pt->setXY( -700000, 5950000 );
>> $pt->draw($map, $layer, $image, 0, "Pt1");
>> [...]
>>
>> //Symbol- and label-attributes are specified in the mapfile.
>> [...]
>> LAYER
>> NAME p
>> TYPE POINT
>> STATUS ON
>> #CLASSITEM "" //is there a classItem when creating a layer dynamic?
>> CLASS
>> SYMBOL 17
>> COLOR 128 128 255
>> SIZE 35
>> #EXPRESSION "" //would this work, when having a
>> classitem on a dynamic layer?
>> LABEL
>> POSITION AUTO
>> END
>> END
>> END
>> [...]
>>
>> I had some attempts using a class/expression, but since I
>don't know the
>> correct classItem I think this can't work. Well, is there a possible
>> "classitem" at all, when the layer isn't retrieved from a shapefile?
>>
>> Is there a way to do this, or must there be different layers for each
>> symbol-type?
>>
>> Any hints would be appreciated.
>>
>> TIA,
>>
>> Frieso ter Haseborg
>> - Software Development -
>>
>> --
>>
>> --------------------------------------------------
>> S&F Datentechnik GmbH&Co.KG
>> Reimersstr. 41b
>> 26789 Leer, Germany
>>
>>
>> _______________________________________________
>> Mapserver-users mailing list
>> Mapserver-users at lists.gis.umn.edu
>> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>>
>
>
>
>
More information about the MapServer-users
mailing list