首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >make make multiple注释

make make multiple注释
EN

Stack Overflow用户
提问于 2011-12-12 19:29:50
回答 1查看 1.2K关注 0票数 1

我是钛金工作室的初学者。我可以打开一个mapview,并且可以创建一个注释。如何在给定的纬度和经度的地图视图上进行多个注解?提前谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-12-12 22:13:41

您可以对多个注释使用循环。

假设您有一个包含元素{纬度、经度、标题}的数据数组

代码语言:javascript
复制
var annotations = [];
 for ( var i = 0 ; i<data.length; i++ ) {

         // this section will create annotations and add them on the mapview
          var pin  = Titanium.Map.createAnnotation({
                   latitude:this.data[i].latitude,
                    longitude:this.data[i].longitude,
                    title:this.data[i].title,
                    animate:true
          });

           annotations[i] = pin;

           // suppose mapView is your map object
           mapView.addAnnotation(annotations[i]);
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8473612

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档