<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19046"></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=078465806-13062011>if you use Feature.Vector markers to display your
markers, try</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=078465806-13062011></SPAN></FONT><FONT color=#0000ff size=2
face=Arial><SPAN class=078465806-13062011></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=078465806-13062011>if(vectorLayer.features.length>0)</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN
class=078465806-13062011>
</SPAN>vectorLayer.removeFeatures(vectorLayer.features);</FONT></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2
face=Arial></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN
class=078465806-13062011>to remove the marker before you add a marker at the new
position.</SPAN></FONT></DIV></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2
face=Arial></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial><A
href="http://gis.ibbeck.de/ginfo/apps/OLExamples/OL210/Map_mit_Marker.asp">http://gis.ibbeck.de/ginfo/apps/OLExamples/OL210/Map_mit_Marker.asp</A></FONT></DIV><FONT
color=#0000ff size=2 face=Arial></FONT><FONT color=#0000ff size=2
face=Arial></FONT><FONT color=#0000ff size=2 face=Arial></FONT>
<DIV><BR><SPAN class=078465806-13062011><FONT color=#0000ff size=2 face=Arial>or
use a DragFeature.Control to drag the marker around.</FONT></SPAN></DIV>
<DIV><SPAN class=078465806-13062011><FONT color=#0000ff size=2
face=Arial></FONT></SPAN><SPAN class=078465806-13062011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=078465806-13062011><FONT color=#0000ff size=2 face=Arial><A
href="http://gis.ibbeck.de/ginfo/apps/OLExamples/OL26/examples/gc_example.html">http://gis.ibbeck.de/ginfo/apps/OLExamples/OL26/examples/gc_example.html</A></FONT></SPAN></DIV>
<DIV><SPAN class=078465806-13062011><FONT color=#0000ff size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=078465806-13062011><FONT color=#0000ff size=2
face=Arial> Or both.</FONT></SPAN></DIV>
<DIV><SPAN class=078465806-13062011></SPAN> </DIV>
<DIV><SPAN class=078465806-13062011><FONT color=#0000ff size=2 face=Arial>i was
not able to update the position of the marker by updating the geometry and
redraw the feature. The label moves to the new position, but the marker (the
externalGraphic) wouldn't move!?</FONT></SPAN></DIV>
<DIV><SPAN class=078465806-13062011><FONT color=#0000ff size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=078465806-13062011><FONT color=#0000ff size=2
face=Arial>Arnd</DIV><PRE id=line53> </PRE></FONT></SPAN>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT> </DIV>
<DIV><FONT color=#0000ff size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr lang=de class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>Von:</B> openlayers-users-bounces@lists.osgeo.org
[mailto:openlayers-users-bounces@lists.osgeo.org] <B>Im Auftrag von </B>Nicholas
Efremov-Kendall<BR><B>Gesendet:</B> Samstag, 11. Juni 2011 18:43<BR><B>An:</B>
Rossko<BR><B>Cc:</B> users@openlayers.org<BR><B>Betreff:</B> Re:
[OpenLayers-Users] Re: help with removing/replacing a markerafter click
event<BR></FONT><BR></DIV>
<DIV></DIV>Hi Rosco,
<DIV><BR></DIV>
<DIV>No, I hadn't thought of that. Any suggestions on how to update the position
of the marker, maybe a loop with a new LonLat?<BR><BR>
<DIV class=gmail_quote>On Sat, Jun 11, 2011 at 5:00 AM, Rossko <SPAN
dir=ltr><<A
href="mailto:rossko@culzean.clara.co.uk">rossko@culzean.clara.co.uk</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV class=im>> The issue is that each time the user clicks, another marker
is placed. This<BR>isn't really a problem, but for<BR>> aesthetic purposes,
I'd like to destroy or remove the first marker if the<BR>> clicks
again<BR><BR></DIV>Have you considered a different approach to coding this,
create one marker<BR>and move it around.<BR><FONT color=#888888><BR>--<BR>View
this message in context: <A
href="http://osgeo-org.1803224.n2.nabble.com/help-with-removing-replacing-a-marker-after-click-event-tp6463400p6464936.html"
target=_blank>http://osgeo-org.1803224.n2.nabble.com/help-with-removing-replacing-a-marker-after-click-event-tp6463400p6464936.html</A><BR>Sent
from the OpenLayers Users mailing list archive at
Nabble.com.<BR>_______________________________________________<BR>Users
mailing list<BR><A
href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</A><BR><A
href="http://lists.osgeo.org/mailman/listinfo/openlayers-users"
target=_blank>http://lists.osgeo.org/mailman/listinfo/openlayers-users</A><BR></FONT></BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>