I\'ve been using the code from this V3 example to set up a links bar that dynamically populates when different category filters are selected, but have two problems at the mo
The reason your links are not working is that you are defining your my_click
and makeSidebar
functions inside of your mapInit
function and so they are not available outside of the scope of mapInit
. Simply move them outside of mapInit
and everything should just work.
As for the load event ... what you are looking for is the addDomListener
method of google.maps.event. Simply use
google.maps.event.addDomListener(window, 'load', name_of_your_inital_function);
// e. g. google.maps.event.addDomListener(window, 'load', mapInit);
Finally; notta bene ... don't do this:
var image = [];
image['attraction'] = 'data';
image['food'] = 'more data';
Arrays are not meant to be used as hashes in Javascript. Use objects for dictionaries / hashes instead -- it's what you are actually doing (Array "subclasses" Object) and it will make it easier for others to use your code (and save you from headaches down the line).
var image = {};
image['attraction'] = 'data';
image['food'] = 'more data';