On Jun 28, 1:59 pm, paul <[email protected]> wrote: > http://www.medalto.co.uk/ex1.htm > > Ive got data in 2 groups ( 1and 2) which i am labelling A and B . > Soon to be more.......... > > I want to eventually to give an option of which groups to display > display them > perlishly id put them in a hash of arrays > ie $a{1} => [marker,marker,marker] , $a{2} => > [marker,marker,marker] > > or as the data is numerical an array of arrays > a[1]= (marker,marker,marker), a[2]= [marker,marker,marker] > > ive tried to implement both of these but failed > the latest effort is commented out in the function createmarker on > this page > ive also tried > declaring the array > var a = new Array(10); > > then addding the marker to the array > a[i].push(marker) > > but they both fail . > is there a way of dynamically creating the keys to the hash and > assigning an array to it , or of creating and array of arrays so i > cin loop through them .
This is not a Google Maps API question. It is a javascript question. http://www.google.com/search?client=gmail&rls=gm&q=javascript%20array%20of%20arrays One way of doing it (not extensively tested: declare in the global scope (equivalent to your "a" object): var groups = new Array(); then inside your create marker function, this will work: if (!groups[i]) groups[i] = new Array(); groups[i].push(marker); -- Larry -- 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.
