Appcelerator Titanium 地图视图 - 默认显示注释标题
Appcelerator Titanium Map View - Show Annotation Title By Default
我有地图视图:
<View id='map' class='smallMap' module='ti.map' />
我设置了:
$.map.setRegion({
latitude: r.y,
longitude: r.x,
latitudeDelta: 0.1,
longitudeDelta: 0.1
});
我添加注释:
var annotation = mapModule.createAnnotation({
latitude: x,
longitude: y,
title: location.street,
});
$.map.addAnnotation(annotation);
最新的文档是这样说的:
An annotation has two states: selected and deselected. A deselected annotation is marked by a pin image. When the user selects the pin, the full annotation is displayed.
有没有办法使注释的默认状态变为 selected,或者在没有用户交互的情况下变为 select。使用 annotation.fireEvent('click')
失败了。我必须在地图上叠加自定义视图吗?
可以使用selectAnnotation方法,例如:
$.map.selectAnnotation(annotation);
我有地图视图:
<View id='map' class='smallMap' module='ti.map' />
我设置了:
$.map.setRegion({
latitude: r.y,
longitude: r.x,
latitudeDelta: 0.1,
longitudeDelta: 0.1
});
我添加注释:
var annotation = mapModule.createAnnotation({
latitude: x,
longitude: y,
title: location.street,
});
$.map.addAnnotation(annotation);
最新的文档是这样说的:
An annotation has two states: selected and deselected. A deselected annotation is marked by a pin image. When the user selects the pin, the full annotation is displayed.
有没有办法使注释的默认状态变为 selected,或者在没有用户交互的情况下变为 select。使用 annotation.fireEvent('click')
失败了。我必须在地图上叠加自定义视图吗?
可以使用selectAnnotation方法,例如:
$.map.selectAnnotation(annotation);