[ka-Map-users] Re: Point removal.

Pg pg.navone at gmail.com
Sun Jun 18 08:04:45 EDT 2006


I know.
You will find the correct code in the next CVS version.

In the meanwhile use your patch (or one of the others circulated in the list).
Fell free to send yourself a new version for CVS.

Bye

2006/6/18, Wei Yang, Ng <genii6 at gmail.com>:
> Hi Pg,
>      I refer to a post sent much earlier by Justin George. I confirm
> that the removePoint() function in
> kaXmlOverlay has a bug as it does not remove all points from the
> overlay. I tested this by inserting points
> all over my map. I also have a button that invokes the removePoint
> function when clicked on. I noticed
> some points are removed each time I click on it. By the third click, no
> points are removed. You can confirm
> this by doing a similar test. The following code basically does a
> reverse loop and removes all the points thus
> eliminating the need for array splicing.
>
>     if ( (this.removePoint.arguments.length < 1) || (pid == null) ) {
>         for (var i=this.ovrObjects.length; i-- > 0; ) {
>             if (this.ovrObjects[i] != null) {
>                 this.ovrObjects[i].removeFromMap();
>                 delete this.ovrObjects[i];
>                 this.ovrObjects[i] = null;
>             }
>         }
>     } else {
>         var re = new RegExp(pid);
>         for (var i=this.ovrObjects.length; i-- > 0; ) {
>             if (this.ovrObjects[i] != null) {
>                 if (re.test(this.ovrObjects[i].pid)) {
>                     this.ovrObjects[i].removeFromMap();
>                     delete this.ovrObjects[i];
>                     this.ovrObjects[i] = null;
>                 }
>             }
>         }
>     }
>
> Not sure if the code has been fixed already but I hope this helps. :)
>
> Cheers,
> Wayne
>


More information about the ka-Map-users mailing list