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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.