Perl Mapscript Problem

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Thu Sep 15 11:27:44 EDT 2005


Sean Gillies wrote:
> 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.

Sean,

Thank you for your response. You are probably correct on the labelcache 
issue now that I think about it. While it is the last layer and should 
take priority in the cache, it is being drawn after all the other labels 
in the cache are drawn so the only way to get it on top is to not use 
the cache as it is too late in the process.

> 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.

I will look at this, but my concern is that we generate a large number 
of symbols (actually numbered dots on the map) and I'm concerned we will 
exceed the hardcoded limit on symbols in map.h

I think that the mapscript API needs to fix the cached image if the 
image file is changed. This is a bug. What good is it to change the 
symbol name if it does not change the symbol also? Would you concur on this?

Thank you for your suggestions, I will see if I can get them to work.

-Steve



More information about the mapserver-users mailing list