2014-02-12 49 views
0

为什么Maptypecontrol仍然会在我的地图上显示在主页上,即使它的值为假? www.driftcoffeehouse.com地图类型控制虚假值

if (status == 'OK' && results.length > 0) { 
var latlng = new google.maps.LatLng(results[0].geometry.location.b,results[0].geometry.location.c); 
var myOptions = { 
zoom: 13, 
maptypecontrol: false, 
center: results[0].geometry.location, 
mapTypeId: google.maps.MapTypeId.ROADMAP 
}; 

回答

0

它仍然存在,因为你使用maptypecontrol代替mapTypeControl

JavaScript是区分大小写的语言:关键字,函数名称,变量,标识符......所有内容都区分大小写,因此maptypecontrolmapTypeControl不同。并且因为mapTypeControl不存在,所以使用默认值true

+0

谢谢!那很完美。 – Owen