自定义谷歌地图的InfoWindow

时间:2011-01-22 11:42:48

标签: javascript google-maps

我想在google maps v3中完全自定义infowindow?我只是想在那里展示一个图像,没有带箭头的白色圆形背景。

v3有可能吗?或任何解决方法?

像这样的东西

alt text

2 个答案:

答案 0 :(得分:3)

查看this示例的来源 - 完全自定义的信息窗口(使用Google Map API v3)。
我在Google Map API v3群组中找到了这个示例 - “Custom InfoWindow examples” - 以防您需要更多信息

答案 1 :(得分:0)

如果您只需要图像作为标记,那么您就不需要InfoWindow。您可以将自定义图像设置为位置标记。

pin=new google.maps.LatLng(50.00, 50.00);

if(marker) {
    marker.setMap(null);
}

var markerIcon = "car.png";

marker=new google.maps.Marker({
    position:pin,
    zIndexProcess: function( m )
    {
        return 9999999
    },
    icon:markerIcon
});

marker.setMap(map);

map.setCenter(marker.getPosition());