Trying to show distinct symbol points dynamically
Frederico Lucca
fredlucca at GMAIL.COM
Thu May 11 08:12:52 PDT 2006
Hello list,
I'm trying to show distinct symbols in the map using request parameters.
Explaining:
Each client can upload your own png, then i need to show this symbols in the
map, in accordance with the request parameters that are a point(x,y) and a
image(my.png)
I tried the code below, but as expected, all points have the same symbol,
the last one.
-----------Mapfile------------
LAYER
NAME COSMETICPOINT
TYPE POINT
STATUS DEFAULT
CLASS
LABEL
TYPE TRUETYPE
FONT Arial
SIZE 12
POSITION lc
BUFFER 5
ANGLE auto
COLOR 0 0 0
OUTLINECOLOR 255 255 255
END
COLOR 0 0 0
END
END
--------------------------------
Well, I run this for each point I want to draw in the map.
---------Mapscript----------
layerObj layer = map.getLayerByName("COSMETICPOINT");
symbolObj symbol = new symbolObj(value,"/var/www/images/"+value+".png");
symbol.setType(mapscript.MS_SYMBOL_PIXMAP);
map.getSymbolset().appendSymbol(symbol);
layer.getClass(0).getStyle(0).setSymbol(map.getSymbolset().index(value));
lineObj line = new lineObj();
line.add(new pointObj(x,y,0));
shapeObj shp = new shapeObj(mapscript.MS_SHAPEFILE_POINT);
shp.add(line);
shp.setText(label);
layer.addFeature(shp);
map.draw();
---------------------------------
How can I do what I need?
Thanks in advance.
Fred
--
"Everything under the sun is in tune
But the sun is eclipsed by the moon"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060511/9f869062/attachment.htm>
More information about the MapServer-users
mailing list