I am in the process of creating a Google Maps Mashup.
When I add a marker to the map, I am dynamically building up an HTML string with certain elements I am populating using JS. This string is then passed on to the info "popup" window. This needs to be done on the fly so that each marker has it's own unique pop window.
Now, the HTML that I am passing to the popup window contains a jQuery tab.
What I cannot seem to wrap my head around is how I would "initialise" (not sure if correct word) the createTabs function.
My code works like this:
1 - Call JS function to add marker to map
2 - This function in turns calls another function to build up the dynamic HTML string (row 16)
3 - HTML string is passed to the popup window
Now I am not sure how/where I would call $("#tab-panel-323168416").createTabs();
Line 36 show the fact that the tabs are named dynamically.
Here is my code:
function createMarker(a, b, c, d, e, f) {
var location = new google.maps.LatLng(c, d);
var marker = new google.maps.Marker({
position: location,
icon: e,
animation: google.maps.Animation.DROP,
map: map,
id: a
});
marker.setTitle(b);
map.panTo(location);
var contentString = buildInfoWindowContent(a, b, c, d, e, f);