您好 我正在研究gmap infoWindow的自定义。 我写了以下代码..
<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}
);
});
return marker;
}
但是在错误控制台中显示它 错误:marker.openExtInfoWindow不是函数 源文件:http://localhost:8080/SearchEngine/list?ps= *&amp; pt = property_type%3A *&amp; loc = Kolkata 行:72
可以告诉我为什么不能识别marker.openExtInfoWindow ...... ??
答案 0 :(得分:1)
我认为你所寻找的不是openExtInfoWindow它的marker.openInfoWindowHtml你可以使用上面的代码填充它。
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("Some other stuff");
});
检查这些链接,他们非常适合掌握GoogleMaps