Opened 18 years ago

Closed 18 years ago

#1676 closed defect (wontfix)

setSymbolSet should update symbol indexes

Reported by: szekerest Owned by: sgillies@…
Priority: high Milestone:
Component: MapScript-SWIG Version: 4.8
Severity: normal Keywords:
Cc:

Description

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

Change History (1)

comment:1 by sgillies@…, 18 years ago

Resolution: wontfix
Status: newclosed
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)

Note: See TracTickets for help on using tickets.