How to open an Infobox when you click on the BING MAPS marker

0

Galera, I had to change the map of google for bing, and now I can not make it when clicking on the marker open an infobox. The event is called, and it arrows the settings but it simply does not appear ... When I add a bookmark on the map, or several works, when I handle anything works, less when opening the infobox ... Could anyone help me? / p>

I will show the properties and the two functions that do not do what should ... I already tried to use the function I saw in a response has hideInfobox, display info box and tbm did not appear ....

  var config = {
      map: undefined,
      infobox: undefined,
      latlng: undefined,
      marcador: undefined,
      carregado: false
   }
   function MapearImoveis(position, imovel, icone) {
       //faz umas coisas aq...........

       Microsoft.Maps.Events.addHandler(config.marcador, 'click', function (event) {
        abrirInfobox(imovel, event); //chama quando clico
     });

     config.map.entities.push(config.marcador);
     }

     function abrirInfobox(imovel, marcador) {
     var info = $("#info");
     //crio o html q vai no infobox 
     ...
     //

    config.infobox = new Microsoft.Maps.Infobox(marcador.location, { visible: true });
    config.infobox.setHtmlContent(info.html());
    config.map.entities.push(config.infobox);

    document.getElementById("infoFoto").onerror = function (e) {
    e.target.src = "../Content/imagens/imovel_sem_imagem.jpg";
    }
}
    
asked by anonymous 08.10.2016 / 04:31

1 answer

0

Well, just set config.infobox.setMap (config.map).

    
08.10.2016 / 05:09