开发者

Custom google map infoWindow

Hi I was working on customization of gmap infoWindow. I wrote the following code..

    <script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAWFxfdA2Gu9LJMJw80x2tKhQhoncwM0SGfm1Opx_70t50wOiSWxRz3mt77PVPCsnMPENBxlx9FaX5AQ"></script>
<script src="javascript/extinfowindow.js" type="text/javascript"></script>
<script type="text/javascript">



var gmarkers = [];
function createMarker(point,name,html,map) {

    var myIcon = new GIcon(G_DEFAULT_ICON);
    myIcon.image = "images/koodya_map_pointer.png";
    myIcon.iconSize = new GSize(22, 31);
    var markerOptions = { icon:myIcon };

    var marker = new GMarker(point,markerOptions);    

      GEvent.addListener(marker, 'click', function(){ 

        marker.openExtInfoWindow(
          map,
            "extInfoWindow_coolBlues",
            "<div>"+
                "<div style='width: 78px;float:left;border:1px red solid;padding:0px'><img src='http://earth.google.com/outreach/images/mymaps_custom_icons_ss.jpg' width='77px' height='50px'/></div>"+
                "<div style='width: 130px;float:right;border:1px red solid;padding:0px'>Description Description Description Description Description Description Description</div>"+
                "<div style='border:1px red solid;padding:0px'>option option option option </div>"+
            "</div>",
          {beakOffset:1}
        ); 

   开发者_Python百科   });

    return marker;
  }

But in Error console it showing Error: marker.openExtInfoWindow is not a function Source File: http://localhost:8080/SearchEngine/list?ps=*&pt=property_type%3A*&loc=Kolkata Line: 72

can any1 tell me why marker.openExtInfoWindow is not recognised...??


I think what your looking for isn't openExtInfoWindow its marker.openInfoWindowHtml and you can populate that with your code above.

  GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml("Some other stuff");
  });

Check these links they are really good for getting to grips with GoogleMaps

Info Markers Tutorial

Google Maps Tutorials

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜