Jump to content

Problem with JavaScript


usman07

Recommended Posts

I am adding the google maps feature on my website, and I have added a line to include a image in the windowinfo. The problem Im having is when I click the pointer the image sticks out of the windowinfo, but when I click it the second time the windowinfo stretches. why does it do this? How can I resolve it? heres the link to the website and click the yellow pointer: http://www.mumtazproperties.hostei.com/map.html

 

Heres some of the Javascript code:

GDownloadUrl("phpsqlajax_genxml.php", function(data) {
          var xml = GXml.parse(data);
          var markers = xml.documentElement.getElementsByTagName("marker");
          for (var i = 0; i < markers.length; i++) {
            var name = markers[i].getAttribute("name");
            var address = markers[i].getAttribute("address");
            var type = markers[i].getAttribute("type");
            var image = markers[i].getAttribute("image");
            var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")),
                                    parseFloat(markers[i].getAttribute("lng")));
            var marker = createMarker(point, name, address, type, image);
            map.addOverlay(marker);
          }
        });
      }
    }

    function createMarker(point, name, address, type, image) {
      var marker = new GMarker(point, customIcons[type]);
      var html = "<img src='" + image + "'/><span class='mapinfo'>" + name + "</span> <br/><br/>" + address;
      GEvent.addListener(marker, 'click', function() {
        marker.openInfoWindowHtml(html);
      });
      return marker;
    }

 

The code which is for the 'image' is what I have added in.

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/262568-problem-with-javascript/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.