Hi everyone,
I have been working on website that shows properties for sale and it
also shows points on map which refer to each row on the table
(property for ale).
I decided to go with AJAX to update table with rows (properties), but
then i need to remove all markers and add all the new ones in.
For some reason after the ajax loads with new code, addListener is not
adding infowindow on click event properly. Even though the markers are
nicely removed and new ones are being put on the map.
Therefore as far as im concerned the markers are removed and added in
properly, however for some reason addListener doesnt add properly
infowindow to the event.
I tried opening the infowindow while the markers are loaded and it
shows infowindow fine.
This is part of the code
[...]
var row = $('div.result_row:eq('+(simplePoint.index-1)+')');
var content =
$('div.result_content:eq('+
(simplePoint.index-1)+')');
google.maps.event.addListener(marker,
'click',
function() {
infowindow.open(map, marker); // THIS IS WHERE IT DOESNT SEEM
TO WORK
row.click();
});
google.maps.event.addListener(infowindow, 'closeclick',
function() {
infowindow.close(map, marker);
row.click();
});
row.click(function(event){
if(content.css("display")=="none"){
infowindow.open(map,
marker);
if(!isScrolledIntoView(row)){
row.parent().scrollTo(row, 1000, {offset: {top:-50} });
}
}else{
infowindow.close();
}
});
[...]
I have commented the line that i think is not working properly. The
code works fine the first time page loads.
After ajax loads other data and all points are re-added using this
method, the info window is not showing any more.
The link for live website (early beta) is http:// zoomie dot bounceme
d0t net/
To get to where the problem is, click on search and search random
location which will bring up map with rows.
Click on order by and reorder data after which the infowindow is not
displayed any more.
I have also tried to setting map to null and recreating it when ajax
loads, but it didnt affect anything.
Any ideas would be greatly appreciated.
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.