Opened 18 years ago

Closed 18 years ago

#1522 closed defect (fixed)

More constants to be exposed to mapscript

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

Description

I would be useful to reconsider which of the constants used by mapserver 
should be exposed to mapscript.

For example MS_MAXLAYERS, MS_MAXSTYLES, MS_MAXCLASSES should be exposed 
because the layers, styles and classes can be added dynamically.

Tamas Szekeres

Change History (3)

comment:1 by sgillies@…, 18 years ago

Tamas, instances of layerObj can be added to a mapObj's layer array, yes, but
the *length* of the layer array cannot be changed except at compile time. The
actual number of layers in a map is found with map.numlayers.

I don't think it is unreasonable that we should have read access to these three
constants, but they can not be mutated in the current state of MapServer.

comment:2 by szekerest, 18 years ago

Sean,

These constants should be exposed so as to make sure the number of elements 
(layers, classes, styles) will be less than the maximum before adding to the 
collection. However it cannot be guessed theese upper limits without adding 
them to the mapscript interface.  Certainly, theese constants shouldn't be 
modifyed at run time.

In addition I think that there is no reasonable sense to hide most of the 
constants, because the funcioning of the interface cannot be interfered by 
exposing them, but the absence may be cumbersome.

Tamas Szekeres
 

comment:3 by sgillies@…, 18 years ago

Resolution: fixed
Status: newclosed
OK, MS_MAXLAYERS, MS_MAXCLASSES, and MS_MAXSTYLES are exposed in the CVS HEAD
and for 4.8 beta2.
Note: See TracTickets for help on using tickets.