我正在使用谷歌地图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 };
}
答案 0 :(得分:0)
删除map.setUIToDefault()
。它为Map添加了默认外观。
(参考文档:http://code.google.com/apis/maps/documentation/javascript/v2/reference.html#GMap2.setUIToDefault)
如果需要,您还可以自定义地图的交互方式。例如map.disableDoubleClickZoom()
或map.disableDragging()
。有关详细信息,请参阅上面的参考。