On Mar 3, 10:39 am, Olha Buchel <[email protected]> wrote: > Larry, > > Thank you so much for all your suggestions, but it still does not work. > > I had only gmarkers[i] = marker; before and it did not work. > > What I noticed when I had both entries, the sidebar was setting overlays and > opening the infowindow of my the last item in the xml file. > Now when I removed gmarkers[i] = marker;, the sidebar chooses the first > entry. > > The good thing now is that the map side acts fine on the sidebar. > The problem remains with the sidebar actions.
Your problem now it the two copies of your myclick function, neither of which have the fix in them (which is why it is using the global "i" which is set to zero every time). You really only want one as it is hard to predict which one a particular browser will use, and different browsers may choose differently. -- Larry > But you identified the problem correctly, it is related to gmarkers[0]. > > Olha > > On Thu, Mar 3, 2011 at 12:29 PM, [email protected] > <[email protected]>wrote: > > > > > On Mar 3, 10:13 am, Olha Buchel <[email protected]> wrote: > > > I have exactly the same. I think you might be using IE, and it had cashed > > my > > > previous version. > > > In the previous version I did not have i in the myclick function. > > > But the script still does not work. > > > Looks to me like you are adding each marker to the gmarkers array > > twice now: > > gmarkers[i] = marker; > > gmarkers.push(marker); > > > That is going to cause problems. > > > -- Larry > > > > Olha > > > > On Thu, Mar 3, 2011 at 11:59 AM, [email protected] > > > <[email protected]>wrote: > > > > > On Mar 3, 9:29 am, Olha Buchel <[email protected]> wrote: > > > > > I placed i++ before side_bar_html. > > > > > The script works better now. > > > > > whenever I click on the markers, the sidebar entries are highlighted. > > > > > I like it. But now I cannot click back from the sidebar and open the > > > > > markers. > > > > > compare your myclick function to Mike Williams': > > > > yours: > > > > function myclick() { > > > > GEvent.trigger(gmarkers[i], "click"); > > > > } > > > > > Mike Williams': > > > > function myclick(i) { > > > > GEvent.trigger(gmarkers[i], "click"); > > > > } > > > > > The difference is important... > > > > > -- Larry > > > > > > Olha > > > > > > On Thu, Mar 3, 2011 at 10:33 AM, [email protected] > > > > > <[email protected]>wrote: > > > > > > > On Mar 3, 7:44 am, Olha Buchel <[email protected]> wrote: > > > > > > > There is another problem with the script now. > > > > > > > When I click on the labels in the sidebar, the map opens the same > > > > marker > > > > > > for > > > > > > > all labels. > > > > > > > And the yellow background sticks to the second label in the > > sidebar, > > > > it > > > > > > does > > > > > > > not move. > > > > > > > All your sidebar entries call myclick(0), therefore they all open > > the > > > > > > infowindow associated with gmarkers[0]. > > > > > > > The "i" variable is always zero, that is what you initialize it to > > and > > > > > > you return from the createMarker function before incrementing it. > > > > > > > -- Larry > > > > > > > > On Thu, Mar 3, 2011 at 9:38 AM, Olha Buchel <[email protected]> > > > > wrote: > > > > > > > > I just fixed the mistake with the labels. But now I have a > > problem > > > > with > > > > > > the > > > > > > > > overlay. > > > > > > > > It looks like it is attached to one marker only. > > > > > > > > > Olha > > > > > > > > > On Thu, Mar 3, 2011 at 9:32 AM, Olha Buchel <[email protected] > > > > > wrote: > > > > > > > > >> Thank you, yes, I had a mistake there. > > > > > > > >> I corrected it, the script got better, but it still does not > > show > > > > > > labels > > > > > > > >> in the sidebar. > > > > > > > > >> Olha > > > > > > > > >> On Thu, Mar 3, 2011 at 9:21 AM, Rossko < > > > > [email protected] > > > > > > >wrote: > > >http://abuchel.apmaths.uwo.ca/%7Eobuchel/maps/iframes_example/example. > > > > > > > >>> .. > > > > > > > > >>> My browser tells me about a javascript error, "parent.frame2 > > is > > > > not > > > > > > an > > > > > > > >>> object" in > > > > > > > >>> parent.frame2.sideBar(side_bar_html); > > > > > > > >>> and it is correct. Are you supposed to be doing some sort of > > > > value > > > > > > > >>> assigning here? > > > > > > > > >>> -- > > > > > > > >>> You received this message because you are subscribed to the > > > > Google > > > > > > Groups > > > > > > > >>> "Google Maps API V2" 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.-Hidequoted > > > > > > text - > > > > > > > > - Show quoted text - > > > > > > > -- > > > > > > You received this message because you are subscribed to the Google > > > > Groups > > > > > > "Google Maps API V2" 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.-Hidequoted > > text > > > > - > > > > > > - Show quoted text - > > > > > -- > > > > You received this message because you are subscribed to the Google > > Groups > > > > "Google Maps API V2" 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.-Hide quoted text > > - > > > > - Show quoted text - > > > -- > > You received this message because you are subscribed to the Google Groups > > "Google Maps API V2" 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.- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Google Maps API V2" 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.
