我用钛(iPhone)编写了一个演示地图视图。这是我从厨房水槽得到的密码:
var win = Titanium.UI.currentWindow;
var annotation = Titanium.Map.createAnnotation({
latitude:42.334537,
longitude:-71.170101,
title:"Boston College",
subtitle:'Newton Campus, Chestnut Hill, MA',
animate:true,
leftButton:'../images/atlanta.jpg'
});
var boston = {latitude:42.334537,longitude:-71.170101,latitudeDelta:0.010, longitudeDelta:0.018};
//
// CREATE MAP VIEW
//
var mapview = Titanium.Map.createView({
mapType: Titanium.Map.STANDARD_TYPE,
region: boston,
animate:true,
regionFit:true,
userLocation:true,
annotations:[annotation]
});
win.add(mapview);
问题是,当我捕获事件“regionChanged”时,映射区域是错误的。我的代码是:
var win = Titanium.UI.currentWindow;
var annotation = Titanium.Map.createAnnotation({
latitude:42.334537,
longitude:-71.170101,
title:"Boston College",
subtitle:'Newton Campus, Chestnut Hill, MA',
animate:true,
leftButton:'../images/atlanta.jpg'
});
var boston = {latitude:42.334537,longitude:-71.170101,latitudeDelta:0.010, longitudeDelta:0.018};
//
// CREATE MAP VIEW
//
var mapview = Titanium.Map.createView({
mapType: Titanium.Map.STANDARD_TYPE,
region: boston,
animate:true,
regionFit:true,
userLocation:true,
annotations:[annotation]
});
win.add(mapview);
// map view click event listener
mapview.addEventListener('regionChanged',function(evt)
{
});
在这件事上,我甚至什么都没写。在模拟器中,它作为第一种情况很好,但在真实电话中,地图缩放水平突然最大。虽然我设置了LaTutuDeld= 1,但是缩放的映射级别仍然最大化,就像LaTutuDeld= 0.001。
那么,这个虫子的根源是什么?有人能帮我吗?