usman07 Posted May 15, 2012 Share Posted May 15, 2012 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 More sharing options...
The Letter E Posted May 15, 2012 Share Posted May 15, 2012 Check if this works, just a hunch, not for sure. var html = "<div><img src='" + image + "'/><span class='mapinfo'>" + name + "</span> <br/><br/>" + address + "</div>"; Link to comment https://forums.phpfreaks.com/topic/262568-problem-with-javascript/#findComment-1345664 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.