Reputation: 439
function clicked(Object){ //getting new object data when refreshing map
var marker=getMarkers(Object,map);//get the marker
var infowindow=gwtInfowindow(Object);// get the info window popup
if(currentList[Object.id].infowindow==undefined){
//getting if undefined popup
currentList[Object.id].infowindow= infowindow;
currentList[Object.id].infowindow.open(map,marker);
}
else{
infowindow=currentList[Object.id].infowindow;
currentList[Object.id].infowindow.open(map,marker);
//getting info window when map refreshed
}
}
infowindow
.infowindow
opened with old data(i.e. in else case infowindow assigned old data of currentList[Object.id].infowindow
).Upvotes: 2
Views: 134
Reputation: 161
try this
else{
currentList[Object.id].infowindow.close();
infowindow=currentList[Object.id].infowindow;
currentList[Object.id].infowindow.open(map,marker);
//getting info window when map refreshed
}
Upvotes: 1
Reputation: 582
Try this
var infowindow = null;
function clicked(Object){
if(infowindow !=null){
//close infowindow
infowindow.close();
}
var marker=getMarkers(Object,map);//get the marker
infowindow=gwtInfowindow(Object);// get the info window popup
if(currentList[Object.id].infowindow==undefined){ //getting if undefined popup
currentList[Object.id].infowindow= infowindow;
currentList[Object.id].infowindow.open(map,marker);
}else{
infowindow=currentList[Object.id].infowindow;
currentList[Object.id].infowindow.open(map,marker); //getting info window when map refreshed
}
}
Upvotes: 1