user3599212
user3599212

Reputation: 439

how to get single popup info windows when click boxdiv

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
    }
}

Upvotes: 2

Views: 134

Answers (2)

ravi
ravi

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

maj
maj

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

Related Questions