geom
unread,Feb 22, 2012, 4:43:47 AM2/22/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Maps JavaScript API v3
I use an tabbed infowindow to add infos to a database.
When the infowindow displays first, everything works fine.
The second infowindow shows only the tabs, but without my form.
The infowindows are creted by this way:
<code>
infowindow = new google.maps.InfoWindow({content: contentString});
//Add listener to map, to insert new Marker
google.maps.event.addListener(map, "click", function(event) {
marker = new google.maps.Marker({
position: event.latLng,
map: map,
draggable: true
});
map.setCenter(event.latLng);
map.setZoom(17);
google.maps.event.addListener(infowindow, 'domready', function() {
addTabbar();
});
</code>
where the addTabbar-function looks like this, where tab1, tab2 and
tab3 are the id's of the div's with the forms:
<code>
function addTabbar() {
tabbar=new dhtmlXTabBar("tabbar","top");
tabbar.setImagePath("./dhtmlx/imgs/");
tabbar.addTab("b1","Sorte","100px");
tabbar.addTab("b2","Zustand","100px");
tabbar.addTab("b3","Pflanzung","100px");
tabbar.setContent("b1","tab1");
tabbar.setContent("b2","tab2");
tabbar.setContent("b3","tab3");
tabbar.setTabActive('b1');
}
</code>
After the form is filled in the data is saved via saveData() to the
database and on success the infowindow is closed.
<code>
if (responseCode == 200 && data.length <= 1) {
alert("Baum in der Datenbank gespeichert.");
infowindow.close();
marker.setDraggable(false);
</code>
But it seems that the infowindow still persists so that the next
infowindow cannot create the divs with the same id's.
Is there a way to reinitiate the infowindows so that the second, and
third one will behave like the first one created?
Georges