tags:

views:

9

answers:

0

Hi,

I am using the following code to create marker and infowindow in google map. But the data is overflowing from the infowindow. Can someone please tell me how can I change the size of infowindow so that all the information can fit in.

        // Create a base icon 
        var baseIcon = new GIcon();
        baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
        baseIcon.iconSize = new GSize(20, 34);
        baseIcon.shadowSize = new GSize(37, 34);
        baseIcon.iconAnchor = new GPoint(9, 34);
        baseIcon.infoWindowAnchor = new GPoint(9, 2);
        baseIcon.infoShadowAnchor = new GPoint(18, 25);

        // Creates a marker whose info window displays given information
        function createMarker(point, name, location, phonenum, address, latitude, longitude, urladdress, locationNumber) {
          var icon = new GIcon(baseIcon);  
          icon.image = "images/markers" + locationNumber + ".png";
          var marker = new GMarker(point, icon);
          GEvent.addListener(marker, "mouseover", function() {
            marker.openInfoWindowHtml('<img src="test.gif" width=162 height=50>'+ '<br>' +'<a target="_blank" href="http://maps.google.com/maps?f=q&amp;hl=en&amp;q=from:'+homeSpatialInfo.fromAddress+'+to:'+latitude+','+longitude+'('+urladdress+')'+'"&gt;Directions&lt;/a&gt;'+ '<br>' + '<br>'+name + '<br>'+ location+ '<br>' +address + '<br>');
          });
          return marker;
        }