Perl Mapscript Problem

Sean Gillies sgillies at FRII.COM
Thu Sep 15 08:02:28 PDT 2005


On Sep 13, 2005, at 7:09 PM, Stephen Woodbridge wrote:

> Hi All,
>
> I had dynamic symbol manipulation working on MS 4.01 but can not get it
> to work on 4.4.1 or 4.6.1. In the following code snippets every think
> works with the default symbol that is defined in symbolset file, but 
> the
> code does not let me change the imagepath on the fly.
>
> Also, I can not get the label on the umarker layer to show unless I
> specify     LABELCACHE FALSE    and umarker layer is the last in the
> mapfile.
>
> Any ideas or help would be appreciated.
>
> -Steve W.
>

Steve,

Perhaps mutating the imagepath has no effect due to caching of symbol 
images. About the labelcache, I would guess that the label is losing 
the battle against other in the map.

This is how I do dynamic symbols

     # create a new symbol
     new_symbol = mapscript.symbolObj('symbol_a', 
'/path/to/symbol_a.png')

     # add a *copy* of the symbol to the map symbolset and get the index
     new_symbol_index = map.symbolset.appendSymbol(new_symbol)

See http://zcologia.com/mapserver/mapscript#symbolobj and 
http://zcologia.com/mapserver/mapscript#symbolsetobj or the same docs 
on the new mapserver site.

The symbolObj also has a method to set symbol imagery directly. See 
http://zcologia.com/mapserver/imagery-howto#images-and-symbols.

Sean

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



More information about the MapServer-users mailing list