API GOOGLE MAP V3

0

I'm in the middle of a problem, which I hope someone can throw an idea at me. The fact is that I have to open a popup window, which I must call it from the box that opens infowindow. Below I show you the code with which I can open a page, but in my case it does not work, what I must open is a popup. I have tried several ways, but I am already at a point where I think the tree does not let me see the forest.

          var contentString = '<div id="div_cliente">'+
          '<b>'+cliente+'</b><br/>' +
          rubro+'<br/>' +
          '<b>'+titular+'</b><br/>' +
          RUC+'<br/>' +
          '<b>'+tele+'</b><br/>' +
          tari+'<br/>' +
          '<b>'+deuda+'</b><br/>' +

           '<p>Prueba llamada, <a href="prueba_ventana.php?valor=111111">'+'Click aqui</a>' + '</p>'+
          '</div>';

This works, but as I said before, what I need is to open a popup, not open a new page.

Thank you in advance.

    
asked by Carlos 20.06.2017 в 00:57
source

1 answer

0

You do not indicate the complete code, but what you have to do is create a div on the web, position it as you want using CSS and maybe a bit of JavaScript to put it where the user has clicked.

On the other hand also by means of JavaScript to establish the content of said div with which you have indicated in the code.

Add for example at the end of your website's html:

<div id='popup'></div>

And in the event that the user should click inside the infoWindow where you generate the contentString, execute this JavaScript:

document.getElementById('popup').innerHTML( contentString );

You can also search and use a multitude of libraries to make these popups, with animations, lightboxes (darken the background below the popup), etc, etc.

    
answered by 20.06.2017 в 01:19