根据API参考,地图对象应该有一个getProjection方法:http:
//code.google.com/apis/maps/documentation/v3/reference.html#Map
虽然在此示例中加载地图应警告x,y点,但是将值抛出为undefined.这是onload中调用的以下示例代码.
function initialize() {
var mapOptions = {
zoom: 8,
center: new google.maps.LatLng(-34.397, 150.644),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
alert("projection:"+map.getProjection());
}
Run Code Online (Sandbox Code Playgroud)