Ticket #1670 (new defect)

Opened 7 years ago

Last modified 7 years ago

SYMBOL is not written to the Map File

Reported by: condit@… Owned by: sdlime
Priority: high Milestone:
Component: MapServer C Library Version: 4.8
Severity: normal Keywords:
Cc:

Description

I'm using C# MapScript on Windows Server 2003.  I can add a symbol to the map
object using the following code:
private void AddSymbols()
		{			
			symbolObj circle = new symbolObj("circle", null);
			circle.type = (int)MS_SYMBOL_TYPE.MS_SYMBOL_ELLIPSE;
			circle.filled = mapscript.MS_TRUE;
			lineObj line = new lineObj();
			line.add(new pointObj(1, 1, 0, 0));
			int test = circle.setPoints(line);
			circle.sizex = 0;
			circle.sizey = 0;				
			map.symbolset.appendSymbol(circle);			
		}
However, when I call
map.save("targetfile.map");

no SYMBOL objects are written to the mapfile.
I certainly don't know the code but it looks like the inmap field never gets set
true for a symbol.

Please let me know if more information is needed.

Change History

Changed 7 years ago by szekerest

  • cc szekeres.tamas@… added
You should save the symbolset before saving the map, like:

                symbolObj circle = new symbolObj("circle", null);
                circle.type = (int)MS_SYMBOL_TYPE.MS_SYMBOL_ELLIPSE;
                circle.filled = mapscript.MS_TRUE;
                lineObj line = new lineObj();
                line.add(new pointObj(1, 1, 0, 0));
                int test = circle.setPoints(line);
                circle.sizex = 0;
                circle.sizey = 0;
                map.symbolset.appendSymbol(circle);
                map.symbolset.save("mysymbols.txt");
                map.save("targetfile.map");

However I am not sure if it is intentional.

Tamas

Changed 7 years ago by condit@…

But then I'll have an extra file lying around.

The original problem was that I wanted to use the same symbol set for every user
session.  I don’t know why that failed.  But now I've got it working - I hacked
mapserver so that symbols always gets inMapFile set TRUE.  This solves my
problem for now.  I guess I should add a check to see if symbolsetname is null.
 If not, then write to mapfile, otherwise write to symbolfile.  Or I guess you
should be able to have both!  Symbols in the mapfile and external symbols...

Changed 7 years ago by szekerest

It should be user selectable. inMapFile may be exposed to mapscript for example.
I don't know why setSymbolSet makes that error for you, I will try it later.

Tamas
Note: See TracTickets for help on using tickets.