[OpenLayers-Users] RE how to remove selected marker

wrap map wrapmap at gmail.com
Wed Mar 18 10:48:05 EDT 2009


---------- Forwarded message ----------
From: wrap map <wrapmap at gmail.com>
Date: Wed, Mar 18, 2009 at 3:47 PM
Subject: Re: RE [OpenLayers-Users] how to remove selected marker
To: Steve.Toutant at inspq.qc.ca


thanks for the answers, But this is also not working, i can define my case
even more better,

1. I had added each marker in diffrent layers, where layer name=marker name
and each marker has numerical value as i need to establish these marker as
some data later.'
2. i am listing all markers and its data in one HTML table.
3. when i like to delete row of the table, it cannot delete the Marker even
i did ;

   - markers.removeMarker(markerName);// also not working it work of recent
   marker only
   - markerName.removeLayer()
   - markerName.destroy(),  // removes one of the recent layer only, if i
   enter the layer name in text  box and want to delete that it cannot work.

the markerName here is name of the new layer which contains marker.

I could not found out the error in concept i am using.




On Wed, Mar 18, 2009 at 3:14 PM, <Steve.Toutant at inspq.qc.ca> wrote:

>
> Try
>
> markers.removeMarker(markerName);
>
> steve
>
>
>  *wrap map <wrapmap at gmail.com>@openlayers.org*
> Envoyé par : users-bounces at openlayers.org
>
> 18/03/2009 10:05 AM
>   A
> users at openlayers.org  cc
>   Objet
> [OpenLayers-Users] how to remove selected marker
>
>
>
>
>
>
> hey all,
>
> function CreateNewMarker() {
>     markerName = document.getElementById("markerName").value;
>     if (document.getElementById("markerName").value.length == 0)
>     alert("You cannot leave markername empty");
>     else {
>         markers = new OpenLayers.Layer.Markers(markerName);
>         map.addLayer(markers);
>         add();
>
>     }
> }
>
> now i want to remove marker that i added as the definite layer, i tried to
> make layer delete but that is not working for me.
>
> i tired as:
>
> markerName.removeLayer()
>
> or how can i remove selected layer which i can get the name from text box
> and delete them
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090318/bb23062d/attachment.html


More information about the Users mailing list