Make image linkable xml script google map

Hello i’m newbie i have found a script that display marker on google map with infowindow that show image
you can check demo here:

i want make image linkable
for example
<a href=""><img src=""></a>

Can you show how to modify script?
any help?

It seems to work if you:

  • remove line 46, where you append the image to the window.
  • remove line 51, where you put the name in the text link (unless you want that as well as the image)
  • add a line after 51:

so you add your previously-created image element to the new link element, not to the window directly.

That bit of code looks like:

               var imageEl = document.createElement('img');
               //infowincontent.appendChild(imageEl);   <- commented this out
           var text = document.createElement('a');
           //text.textContent = name;   <- commented this out
           text.appendChild(imageEl);   <- added this
1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.