[mapserver-dev] python mapscript, reference map and color problem

Jachym Cepicky jachym.cepicky at gmail.com
Thu Sep 29 09:36:39 EDT 2011


Hi,

I'm configuring the mapObj using python, and it seems, that it is not 
possible to set *no color* to mapObj.reference.color attribute

Example code:


import sys
import mapscript

if len(sys.argv) > 1:
     mapObj = mapscript.mapObj()

     mapObj.reference.status = mapscript.MS_ON
     mapObj.reference.image = "/foo/bar"
     mapObj.reference.extent = mapscript.rectObj(0,0,1,1)
     mapObj.reference.color = mapscript.colorObj(-1,-1,-1)
     mapObj.reference.outlinecolor = mapscript.colorObj(255,0,0)

     mapObj.save(sys.argv[1])
else:

     print """Usage:
     %s [outout filename]
     """ % sys.argv[0]


Result:

...

   REFERENCE
     EXTENT 0 0 1 1
     IMAGE "/foo/bar"
     OUTLINECOLOR 0 0 0
     SIZE 0 0
     STATUS ON
     MARKERSIZE 0
     MAXBOXSIZE 0
     MINBOXSIZE 3
   END # REFERENCE
...

So there is *NO* COLOR attribute in the map, and default (255,0,0) is taken.

Is there s bug in mapscript implementation?

Thanks

Jachym


More information about the mapserver-dev mailing list