java mapscript map annotations

Steve Lime Steve.Lime at DNR.STATE.MN.US
Thu Aug 31 13:14:33 EDT 2006

Symbols and annotation are scalable. See the SYMBOLSCALE layer
Basically you set a reference scale at which no scaling is applied and
there stuff gets bigger or smaller accordingly. With MINSIZE/MAXSIZE
can set bounds so a symbol or text does not become too large or small.

Another option is setting SIZEUNITS. This applies to symbols only but
computes the SIZE of marker based on the cellsize of the map so a
could always be, say, 5 miles wide.


>>> mikiet <mike.talbutt at DOTTEDEYES.COM> 8/31/2006 10:15:34 AM >>>
There are 2 reasons why I did not want to accomplish this using a
Firstly when I annotate a map with a circle I want to be able to
specify the
radius of that circle, so when I zoom in and out of the map the size of
annotation will change correspondingly. If I use a symbols as I zoom in
out of the map the size of the circle remains constant regardless of
maps zoomwidth. 

Secondly if I wanted to produce an ellipse I could not work out how to
change the appearance of the symbol, presumably I read the symbol and
the points, however when I did this it did not change the way the
symbol was
rendered on the screen. 

I have got round this problem by creating a polygon then represents my
circle/elipse with the code below, I just wondered if I was doing
overly complicated for what should be a simple operation

shapeObj shape = new shapeObj(MS_SHAPE_TYPE.MS_SHAPE_POLYGON);
lineObj line = new lineObj();
for (double w = 0.0; w <= 2*Math.PI; w = w+0.1){
double x = (iRadius * Math.cos(w)) + dX;
	double y = (iRadius * Math.sin(w)) + dY;
	pointObj point = new pointObj(x, y, 0d);
double x = (iRadius * Math.cos(0)) + 295785d;
double y = (iRadius * Math.sin(0)) + 260734d;
pointObj point = new pointObj(x, y, 0d);

Umberto Nicoletti wrote:
> On 8/31/06, mikiet <mike.talbutt at> wrote:
>> Hi there,
>> I am new to mapserver and am using java mapscript to create a new
>> application. I have found documentation on java mapscript prettu
hard to
>> come by, however have managerd to get most of my application up and
>> running
>> pretty quickly.
>> Hoever I've fallen into problems annotation the map. My application
>> to
>> be able to annonate the map with rectangles, circles and ellipses.
>> rectangles were easy, I simply created a new lineObj and added the
>> for my rectangle, create a shapeObj adding my lineObj  to it and
>> added
>> my shape to the layer as an feature.
>> Hoever how would I do this with a circle ?, in previose examples
when I
>> have
>> rendered  points on a map as circles I have created a circle symbol
in my
>> .sym file and applied that symbol to the features, however in my
>> application
>> when I draw the circle I need to be able to specify the radius. Also
>> would
>> prefer the circle annonation to actually be a circle rather then a
>> using a circle symbol to render it.
> Doesn't setting the symbol size accomplish exactly this?
> Umberto
>> Any help or pointers to documentation would be greatfully
>> --
>> View this message in context:

>> Sent from the Mapserver - Dev forum at

View this message in context:

Sent from the Mapserver - Dev forum at

More information about the mapserver-dev mailing list