On 5/1/09 at 10:02 AM, [email protected] (doodle) wrote:
>Can you tell me ( show me the code ) how I would go about including
>the createSidebarEntry() function within the loop of makeSidebar() ??
Right now, createSidebarEntry() takes several arguments, starting with
marker. The marker variable not only holds the marker object, but also
has the site-specific data (title, bed, sleep, heat, pet, park, smoke,
postcode, phone, distance). So as makeSidebar() iterates through
gmarkers, it has the site data available for each marker. That means
that makeSidebar() could have something like this in it:
var html = "";
for (var i=0; i<gmarkers.length; i++) {
if (!gmarkers[i].isHidden()) {
html += createSidebarEntry(marker, marker.title,
marker.bed, marker.sleep, [etc.] )
}
}
Note that [etc.] is not code -- I just didn't want to type all the
marker.XX attributes. Be sure to get them in the order that the
function expects.
BTW, this shows that the marker is all you really need to pass to
createSidebarEntry(); you can get its attributes inside the function.
Then the order of the args to the function is much simpler and if you
change the function you don't risk messing up the args.
The above is untested. We list members can't really write your code
for you, but I think this could guide you.
Code, test, debug, post followup questions here, repeat.
HTH.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---