Hello Folk,
i have a strange problem with the maximizeclick. I want load ajax
content in a maximized bubble. My Map has 11.000 Markers from an xml
document. MarkerClusterer is already running. In one inner tab of the
maximized infowindow i placed a streetview pano. But the problem ist,
wehn i load the map and click the first marker, is the streetview
pano, ok, the i click another marker i have 2 streetview panos, when i
get an alert for a element, the alert appears in same number ehre i
clicked on markers.... huh? Whats the problem here?
The code:
function refreshMapMarkers(catid,rid,mode) {
if (catid) {
for (var pin in markersArray[rid]){
map.removeOverlay(markersArray[rid][pin]);
}
GDownloadUrl("index.php?type=3613&mode=mapmarkers&submode="+mode
+"&uid="+catid, function(data, responseCode) {
var xml = GXml.parse(data);
var markers =
xml.documentElement.getElementsByTagName("marker");
var bounds = new GLatLngBounds();
map.closeInfoWindow();
function createMarker(point,a,elid) {
if(rid==2) pjicon = getDtIcon();
if(rid==1) pjicon = getFrIcon();
markerOptions = {icon:pjicon};
var marker = new
GMarker(point,markerOptions);
markersArray[rid][a] = marker;
GEvent.addListener(marker, "click",
function() {
map.panTo(new
GLatLng(this.getPoint().lat(), this.getPoint().lng
()));
var maxContentDiv = document.createElement
('div');
maxContentDiv.innerHTML = 'Loading...';
marker.openInfoWindowHtml(getMarkerContent
(elid,"markerContent"), {
maxContent: maxContentDiv,
maxTitle: " ",
maxWidth: 300
});
var iw ="";
var iw = map.getInfoWindow();
GEvent.addListener(iw, "maximizeclick",
function(){
maxContentDiv.innerHTML
= getMarkerContent
(elid,"markerMoreContent");
});
GEvent.addListener(iw, "maximizeend", function
(){
refreshInfoWindow(this.getPoint().lat(), this.getPoint().lng
());
});
});
return marker;
}
markersComb = [];
for (var i = 0; i < markers.length; i++) {
var point = new GLatLng(
parseFloat(markers[i].getElementsByTagName("lat")
[0].firstChild.data),
parseFloat(markers[i].getElementsByTagName("lng")
[0].firstChild.data)
);
var elid =
parseFloat(markers[i].getElementsByTagName("uid")
[0].firstChild.data);
bounds.extend(point);
markersComb.push(createMarker(point,i,elid));
}
if (markerClusterer != null) {
markerClusterer.clearMarkers();
}
markerClusterer = new MarkerClusterer(map,
markersComb);
map.setZoom(map.getBoundsZoomLevel(bounds));
map.setCenter(bounds.getCenter());
setStatus("Karte aktualisiert");
});
}
}
function refreshInfoWindow(lat,lng) {
J("#tabs").tabs();
alert(J("#pano").html);
setInnerPano(lat,lng);
}
Many thanx.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---