On May 7, 9:25 am, jaymundaka <[email protected]> wrote:
> Hi all.
>
> Nearly finished my site, but one bug I can't get beyond and although
> I've searched, I can't find an answer. Please help.
How? If you provided a link as requested in the posting guidelines, I
don't see it.
>
> My problem is that I have a googlemap, sidebar and markerclusterer
> running on a page. It's all linked to a mysql database which holds all
> my user's info. 'primaryinstrument' takes the place of 'category' in
> the sample code I've encorporated. The map shows users, the sidebar
> shows users listed under headings of 'primaryinstrument', and when I
> click on the first user in the sidebar it correctly displays username,
> primaryinstrument and genre correctly, but when I then click on
> another user, it displays a user elsewhere on the map. If it's not in
> the code, could it be that I've deleted users from the database and
> the id field has gaps in it causing the map page to error?
>
> The following is what I suspect to be the faulty code:-
>
> // == a checkbox has been clicked ==
> function boxclick(box,primaryinstrument) {
> if (box.checked) {
> show(primaryinstrument);
> } else {
> hide(primaryinstrument);
> }
> // == rebuild the side bar
> makeSidebar();
> }
>
> function myclick(i) {
> GEvent.trigger(gmarkers[i],"click");
> }
>
> // == rebuilds the sidebar to match the markers currently displayed ==
> function makeSidebar() {
> var html = "<table>";
> var primaryinstrument = "";
> for (var i=0; i<displayed_gmarkers.length; i++)
> {
> if (!displayed_gmarkers[i].isHidden()) {
> // GLog.write("last primaryinstrument="+primaryinstrument+",
> primaryinstrument="+gmarkers[i].mycategory+",
> heading="+gmarkers[i].myheading);
> if (primaryinstrument != displayed_gmarkers[i].mycategory) {
> html += '<tr><th><u>'+displayed_gmarkers[i].myheading+'<\/u><\/th><\/
> tr>';
> primaryinstrument = displayed_gmarkers[i].mycategory;
> }
> html += '<tr><td><a href="javascript:myclick(' + i + ')">' +
> displayed_gmarkers[i].myname + '<\/a><\/td><\/tr>';
> }
> }
> html += '</table>';
> // GLog.write("side_bar="+html);
> document.getElementById("side_bar").innerHTML = html;
> }
>
> Many thanks in anticipation.
Can you provide a link to a map that exhibits the problem?
You might also consider posting your question on stackoverflow,
someone there might be able to help.
-- Larry
--
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.