<html><body bgcolor="#FFFFFF"><div>Thanks, Arnd, I'll give it a crack <br><br>Sent from my mobile device</div><div><br>On Jun 13, 2011, at 2:13 AM, "Arnd Wippermann" <<a href="mailto:arnd.wippermann@web.de">arnd.wippermann@web.de</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div>
<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"><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></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"><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></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</font></span></div><font color="#0000ff" size="2" face="Arial"><pre id="line53"> </pre></font>
<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> <a href="mailto:openlayers-users-bounces@lists.osgeo.org">openlayers-users-bounces@lists.osgeo.org</a>
[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> <a href="mailto:users@openlayers.org"><a href="mailto:users@openlayers.org">users@openlayers.org</a></a><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"><a href="mailto:rossko@culzean.clara.co.uk">rossko@culzean.clara.co.uk</a></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"><a href="http://osgeo-org.1803224.n2.nabble.com/help-with-removing-replacing-a-marker-after-click-event-tp6463400p6464936.html">http://osgeo-org.1803224.n2.nabble.com/help-with-removing-replacing-a-marker-after-click-event-tp6463400p6464936.html</a></a><br>Sent
from the OpenLayers Users mailing list archive at
<a href="http://Nabble.com">Nabble.com</a>.<br>_______________________________________________<br>Users
mailing list<br><a href="mailto:Users@lists.osgeo.org"><a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a></a><br><a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank"><a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a></a><br></font></blockquote></div><br></div>
</div></blockquote></body></html>