[OpenLayers-Users] Add markers on click

Sajjad Anwar sajjadkm at gmail.com
Wed Jan 20 02:32:18 EST 2010


Hello.

I'm a new user of OpenLayers. Im trying to create a website in which a layer
of OpenStreetMap is displayed. And when the user clicks on a point, I need
to add a marker to that point. I have added the OSM layer and configured so
that once a click occurs it returns an alert with the lat/lon, by following
an example at OpenLayers Click Handler
Example<http://openlayers.org/dev/examples/click-handler.html>.

But I need to put the marker at the point where the click occurs. Tried many
examples, but could not figure that out.
My current code snippet is here http://pastebin.com/m24d302f2

Please help.

Thank you.

-- 
Sajjad Anwar
http://sajjad.in
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100120/3d0732bc/attachment.html


More information about the Users mailing list