禁用所有其他视图,不包括地图视图Gmap2

时间:2012-02-05 23:07:03

标签: google-maps google-maps-api-2

我正在使用谷歌地图v2,我只想要地图视图,仅此而已。我也想摆脱放大和缩小按钮。

如果有人知道我需要添加到下面的内容那将会很棒。

function stores()
{
    $('#storelist ul#stores').html("");
    fetch(203,"task=location&location=vic");
    map = new GMap2(document.getElementById("map_canvas"));
    map.setCenter(new GLatLng(-37.810013, 144.962683), 8);
    map.setUIToDefault();
    yellowIcon.image = "http://gmaps-samples.googlecode.com/svn/trunk/markers/orange/blank.png";

    markerOptions = { icon:yellowIcon };

}

1 个答案:

答案 0 :(得分:0)

删除map.setUIToDefault()。它为Map添​​加了默认外观。 (参考文档:http://code.google.com/apis/maps/documentation/javascript/v2/reference.html#GMap2.setUIToDefault

如果需要,您还可以自定义地图的交互方式。例如map.disableDoubleClickZoom()map.disableDragging()。有关详细信息,请参阅上面的参考。