The code works fine in Firefox, but not in IE8. I'm getting an error: 'address' is null or not an object.
Have been googling for days and couldn't get a clear answer on how to fix/debug this. Hope stackoverflow.com can help.
var latlng = [
{
address: new GLatLng(-6.1364941,106.8000411),
marker0: myIcon0
},
{
address: new GLatLng(-6.1364941,106.8000411),
marker0: myIcon0
},
{
address: new GLatLng(1.3520831,103.8198361),
marker0: myIcon0
},
{
address: new GLatLng(14.06666671,121.33333331),
marker0: myIcon
},
];
var markers = [];
for ( var i = 0; i < latlng.length; i++ )
{
var marker = new GMarker( latlng[ i ].address, latlng[ i ].marker0 );
map.addOverlay( marker );
markers[i] = marker;
}
$(markers).each(function(i,marker){
GEvent.addListener(marker,"click", function(){
// map.panTo(marker.getLatLng());
map.setCenter(marker.getLatLng(), 10);
marker.openInfoWindowHtml($('.view-display-id-attachment_1 .views-row-'+(i+1)).html(), {maxWidth:200});
});
$("<li />")
.html($('.view-display-id-attachment_1 .views-row-'+(i+1)).html())
.click(function(){
map.setCenter(marker.getLatLng(), 10);
marker.openInfoWindowHtml($('.view-display-id-attachment_1 .views-row-'+(i+1)).html(), {maxWidth:200}); // custom balloon text
// alert($('.view-display-id-attachment_1 .views-row-'+(i+1)).html()); // VIEWS ROW COUNT DEBUG
})
.appendTo("#wtb-list");
});