On Aug 2, 4:31 am, allankliu <allank...@gmail.com> wrote: > 4) When marker is removed, the related entry should be removed (NOT > YET) > 5) When remove button in entry is clicked, the marker should be > removed (NOT YET, BUT archiveable)
> In principle, the sidebar entries can be updated by "dragend" event, > it should be updated by some other event such as "update content by > post method from InfoWindows" or "remove from InfoWindows". But I am a > newbie in JavaScript. Is there any demo for this features? By closure? > I am not quite understanding about closure in JS. (5) appears to have been done. The issue with (4) is that when the sidebar entries are created, they are simply created. There is no reference included in order to be able to refer to a particular entry later on. There is a removeFeatureEntry () function, but it's empty. So: you need to create a reference within the sidebar entry so you can refer to it again. I suggest the following, but none of it is tested, so make a copy of your code first! Alter line 169 of gmarkers.js to read var cells = addFeatureEntry("Placemark " + (++markerCounter_), color, markerCounter_); in order that markerCounter is passed in its own right to the sidebar function. This is the most problematic line, because we need the two values of markerCounter to be the same and the first one increments it. You may need to split it up like ++markerCounter_; var cells = addFeatureEntry("Placemark " + markerCounter_, color, markerCounter_); Alter line 112 so it makes use of it: function addFeatureEntry(name, color, number) { After line 113, add a new line to use that parameter: currentRow_.setAttribute("id","PM" + number); // ids need to start with a letter // This adds an id attribute to the placemark's row in the table Then write the content of the removeFeatureEntry() function: document.getElementById("featuretbody").removeChild("PM"+number); // This removes the row from the tbody element Andrew --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to Google-Maps-API@googlegroups.com To unsubscribe from this group, send email to google-maps-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---