Bug 1835, proposed changes

Tamas Szekeres szekerest at GMAIL.COM
Fri Aug 25 18:04:22 EDT 2006


According to the IRC meeting we were agreed in that
should be handled as a bug. When setting the styleObj.symbolname
styleObj.symbol should also be set by calling msGetSymbolIndex

I have proposed to impement this by redefining the setter of
styleObj.symbolname, because the interface would remain the same at
the user's perspective. After digging into the code it seems almost
impossible to implement the proposed solution since styleObj does not
contain a reference to the map object so as to call msGetSymbolIndex

Therefore i will create a new member function for styleObj similarly
to the PHP implementation as:


%extend styleObj {
int setSymbolByName(mapObj *map, char* symbolname)
        self->symbol = msGetSymbolIndex(&map->symbolset, symbolname, MS_TRUE);
        self->symbolname = symbolname;
        return self->symbol;

FYI, if the symbolObj would contain a reference to the map the first
one should be implemented as:


#ifdef SWIG
%typemap(memberin) char* symbolname {
  $self->symbol = msGetSymbolIndex(&$self->map->symbolset, $input, MS_TRUE);
  $1 = $input;
typedef struct {
} styleObj;

#ifdef SWIG
%typemap(memberin) char* symbolname;

I seems a bit strange to place a typemap to map.h but in this
situation it is inevitable so as to restrict the typemap to the scope
of the styleObj.


More information about the mapserver-dev mailing list