..let me try it... mylayer.removeFeatures(mylayer.getFeatureById(&quot;start&quot;))<div><br></div><div>uuh yes its works! </div><div><br></div><div>thank you !</div><div><br></div><div>regards</div><div>mehmet sirin c.</div>
<div><br></div><div><br></div><div><div class="gmail_quote">2009/11/26 Ivan Grcic <span dir="ltr">&lt;<a href="mailto:igrcic@gmail.com">igrcic@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
mylayer.removeFeatures(mylayer.getFeatureById(<a href="http://startpoint.id" target="_blank">startpoint.id</a>))<br>
<br>
Andreas, I think that array param is not necessary, single feature<br>
should also work<br>
<br>
* APIMethod: removeFeatures line 581:<br>
if (!(features instanceof Array)) {<br>
            features = [features];<br>
}<br>
<br>
BTW features automatically get id, so  I wouldnt asign IDs manually.<br>
<br>
Cheers<br>
<div><div></div><div class="h5"><br>
On Thu, Nov 26, 2009 at 8:40 AM, Andreas Hocevar &lt;<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; Mehmet Sirin wrote:<br>
&gt;&gt; I&#39;m failing when trying to remove a feature selected by its ID:<br>
&gt;&gt;<br>
&gt;&gt; var startpoint= new OpenLayers.Feature.Vector(point,null,start_style);<br>
&gt;&gt; <a href="http://startpoint.id" target="_blank">startpoint.id</a> &lt;<a href="http://startpoint.id" target="_blank">http://startpoint.id</a>&gt;=&quot;hey&quot;;<br>
&gt;&gt; mylayer.addFeatures([startpoint]);<br>
&gt;&gt; ...<br>
&gt;&gt; var something=getFeatureById(&quot;hey&quot;); //works<br>
&gt;&gt; mylayer.removeFeatures(mylayer.features[something]);<br>
&gt;<br>
&gt; The removeFeatures method takes an array of features as argument:<br>
&gt;<br>
&gt; myLayer.removeFeatures([something]);<br>
&gt;<br>
&gt; Regards,<br>
&gt; Andreas.<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Maybe  it&#39;s in general not possible choosing a feature by an<br>
&gt;&gt; associative key ?<br>
&gt;&gt; Then how solving this problem in another, elegant way ? (i have a<br>
&gt;&gt; solution for my problem, but it&#39;s definitely not fine or elegant^^)<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; leaving you kind regards<br>
&gt;&gt; mehmet sirin c.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; ------------------------------------------------------------------------<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Users mailing list<br>
&gt;&gt; <a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
&gt;&gt; <a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Andreas Hocevar<br>
&gt; OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
&gt; Expert service straight from the developers.<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Users mailing list<br>
&gt; <a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
&gt; <a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
&gt;<br>
<br>
<br>
<br>
--<br>
</div></div><font color="#888888">Ivan Grcic<br>
</font></blockquote></div><br></div>