[mapserver-users] drawing a circle

Steve Lime Steve.Lime at dnr.state.mn.us
Mon Sep 8 14:33:47 EDT 2008


Create a layer in your mapfile like so:

SYMBOL 
  NAME 'circle'
  TYPE ELLIPSE
  FILLED TRUE
  POINTS 1 1 END
END

LAYER
  NAME 'myPoiint'
  TYPE POINT
  STATUS OFF
  CLASS
    STYLE
      COLOR 255 0 0
      SIZE 15
    END
  END
END

Then in your script, the steps would be like so:

1) get the 'myPoint' layer
2) add a point feature to it 
3) set the STATUS appropriately

Now draw as normal. Assuming the point is in map coordinates you should see a red circle at the location
you specified.

Steve

>>> On 9/8/2008 at 11:15 AM, in message
<3702658f0809080915y38b42472le294cbda8e40b45e at mail.gmail.com>, "ramya
srinivasan" <hellomps at gmail.com> wrote:
> Hi,
> iam using php/mapscript.I will have to display the point clicked by the user
> on the map. This is my task.Can u pls help me
> 
> On Mon, Sep 8, 2008 at 9:18 PM, Steve Lime <Steve.Lime at dnr.state.mn.us>wrote:
> 
>> Can you explain a bit more about your environment (CGI vs. MapScript),
>> context of the need etc...?
>>
>> The easiest path will likely involve a point layer that you'll populate
>> dynamically (with the click coordinate) and then display that point with a
>> circle symbol. You can scale that symbol appropriately using a style SIZE
>> and SIZEUNITS.
>>
>> Steve
>>
>> >>> "ramya srinivasan" <hellomps at gmail.com> 09/07/08 10:51 AM >>>
>> Hi all,
>>  * I want to draw a circle with the center clicked by the user on the
>> map.Can anyone help me??*
>> **
>> *Thanks*
>>
>>



More information about the mapserver-users mailing list