[mapserver-users] mapplet draw cross / circle

Stephen Lime steve.lime at dnr.state.mn.us
Wed Nov 7 22:21:30 EST 2001


Should be pretty easy although you need to extend the applet with a new public method. Then use javascript to define a function to take the map coordinate and convert it to image coordinates and then pass that coordinate (plus a label?) to the new public method.
Everything you need for the calculation should be there for you. All that public java method has to do is set the coordinates of a couple of java variables and then call repaint(). Update repaint to draw the circle at the given location based on the values set in the public method.

Piece of cake.

Steve

Stephen Lime
Data & Applications Manager

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937
>>> "Kralidis, Tom" <Tom.Kralidis at ccrs.nrcan.gc.ca> 11/07/01 14:01 PM >>>

Hi,

Using the mapplet Java applet, I'd like to create functionality where, when
a user clicks a link (eg. placename), a circle can be drawn on the map,
i.e.:

- HTML select list (lat/long coords hidden foreach option)
- user selects an item
- item's lat/long are picked up from hidden value
- calculation of x/y pixel location of lat/long to corresponding map
(mapplet)
- draw a small circle on the map

Any ideas?

Thanks

..Tom




More information about the mapserver-users mailing list