I had to change the code the following way, so that the tabbed infowindow
is created within the function that creates the new marker.
To clear the infowindow after inserting the data to the database I added
infowindow=null at the end of the saveData()-function.
<code>
//Add listener to map, to insert new Marker and create infowindow
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);
infowindow = new google.maps.InfoWindow({
content: contentString});
google.maps.event.addListener(infowindow, 'domready', function() {
addTabbar();
});
</code>
and in saveData() i added to the end of the function:
<code>
if (responseCode == 200 && data.length <= 1) {
alert("Baum in der Datenbank gespeichert.");
infowindow.close();
marker.setDraggable(false);
infowindow=null;
</code>
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-maps-js-api-v3/-/qLXee7nbV7oJ.
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-js-api-v3?hl=en.