hi ross, i understand the array how its work....and now its removing
value from array as well.....but i think i m calling it in wrong
place. becoz its removing wrong markers....can you please see the
code...!
when you move map you will see its removing marker but wrong ones. can
you see the code when( or where) shell i call this for for each loop
for(id in batch){}

http://www.spotonsearch.co.uk/auto/xx/index.html

for(id in batch){
    alert(id +" "+batch[id].keep_it);
    if (batch[id].keep_it) {
        batch[id].keep_it = false;
    } else {
        map.removeOverlay(batch[id]);
        batch.splice(id,1);
    }
}

but code is working.....looking forward to your response.


On Jun 17, 6:37 pm, Rossko <[email protected]> wrote:
> > you can see its working very nice.....just i cant remove marker from
> > array.
>
> > batch[id].splice(batch[id],1);
>
> This will try to remove one element from the array batch[id] ,
> 'starting from' the element of the array batch[id] that has the index
> of 'batch[id]'.   That's to say, it will try to rub out an element
> batch[id][batch[id]] Confuses me too ....
>
> http://www.google.co.uk/search?hl=en&q=javascript+remove+array+elemen...
>
> Going one step at a time ... you've got an array 'batch' and you want
> to remove an element from it, that has the index 'id'.
>
>    batch.splice()
> is the tool to use, so all the tutorials tell us.  Note that we want
> to remove the element from the array; that's the array as a whole, so
> we don't say batch[something].splice(...) because that would only be
> searching within one element of the array 'batch' for the thing we
> want to remove.
>
> We want to remove the element indexed with 'id' so that's what we need
> to tell splice().  And we only want to remove one, not two or three
> consecutive elements, so we tell splice() that as well.
>    batch.splice(id,1)
>
> I strongly recommend trying to understand some of these -
>    http://www.google.co.uk/search?hl=en&q=javascript+array+tutorial&meta...
> When you can understand the difference between something, something
> [x], something[x][y], something.action(), and something[x].action
> () ...  you've got it ! ;)
>
> Not a maps issue, basic javascript.
>
> > what kind of database structure i need...
>
> No idea, and definitely not a maps issue.  You might need to hire a
> consultant.
>
> cheers, Ross K
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to