MapServer / MapServer-import

3 stars 2 forks source link

setSymbolSet should update symbol indexes #1676

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: szekerest Date: 2006/02/20 - 23:34

mapObj.setSymbolSet allows to replace the symbol set of the map, however it does
not update the symbol indexes, so the map might drawn unexpectedly using
incorrect symbols. msGetSymbolIndex should be called for the layers.

This bug may belong to the mapserver C library if msLoadSymbolSet should be changed.

Tamas
tbonfort commented 12 years ago

Author: sgillies@frii.com Date: 2006/02/23 - 22:05

Tamas, mapObj.setSymbolSet was not intended to be used in this way. It should be
called early on, not after style symbols are set.

If you have to add symbols conditionally during program execution, I would
recommend using symbolSetObj.appendSymbol instead. For example:

    square = mapscript.symbolObj('square')
    square.type = mapscript.MS_SYMBOL_VECTOR
    square.filled = mapscript.MS_TRUE
    line = mapscript.lineObj()
    line.add(mapscript.pointObj(0,0))
    line.add(mapscript.pointObj(0,2))
    line.add(mapscript.pointObj(2,2))
    line.add(mapscript.pointObj(2,0))
    line.add(mapscript.pointObj(0,0))
    square.setPoints(line)
    square.sizex = 2
    square.sizey = 2
    mo.symbolset.appendSymbol(square)