[OpenLayers-Users] RE RE how to remove selected marker

Steve.Toutant at inspq.qc.ca Steve.Toutant at inspq.qc.ca
Wed Mar 18 11:20:43 EDT 2009


Perhaps I misunderstood what you are trying to do but Could you just 
create one markerLayer and add all your markers in it?




wrap map <wrapmap at gmail.com>@openlayers.org 
Envoyé par : users-bounces at openlayers.org
18/03/2009 10:48 AM

A
users at openlayers.org
cc

Objet
[OpenLayers-Users] RE  how to remove selected marker










---------- 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




_______________________________________________
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/b74d3c19/attachment.html


More information about the Users mailing list