开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信号发送消息登录论坛

新人指南 邀请好友注册 - 我关注人的新帖 教你赚取精币 - 每日签到


求职/招聘- 论坛接单- 开发者大厅

论坛版规 总版规 - 建议/投诉 - 应聘版主 - 精华帖总集 积分说明 - 禁言标准 - 有奖举报

查看: 13003|回复: 1
收起左侧

[android教程] android开发之百度地图marker点添加,删除,动画等操作实例

[复制链接]
结帖率:0% (0/1)
发表于 2018-10-17 21:14:10 | 显示全部楼层 |阅读模式   湖北省宜昌市

    android开发之百度地图marker点添加,删除,动画等操作实例

[Java] [color=rgb(51, 102, 153) !important]查看源文件 [color=rgb(51, 102, 153) !important]复制代码
[color=rgb(160, 160, 160) !important]
[color=#a0a0a0 !important]?

1

2

3

LatLng point = new LatLng(markx,marky);//坐标参数(纬度,经度)
BitmapDescriptor bitmap = BitmapDescriptorFactory
  .fromResource(R.mipmap.drone);//自定义marker点图片





[Java] [color=rgb(51, 102, 153) !important]查看源文件 [color=rgb(51, 102, 153) !important]复制代码
[color=rgb(160, 160, 160) !important]
[color=#a0a0a0 !important]?

1

2

3

4

//构建MarkerOption,用于在地图上添加Marker
OverlayOptions option = new MarkerOptions()
  .position(point)
  .icon(bitmap);





[Java] [color=rgb(51, 102, 153) !important]查看源文件 [color=rgb(51, 102, 153) !important]复制代码
[color=rgb(160, 160, 160) !important]
[color=#a0a0a0 !important]?

1

marker = (Marker) map.addOverlay(option);//将marker添加到地图,并获取该marker点对象




        marker.remove();//删除

[Java] [color=rgb(51, 102, 153) !important]查看源文件 [color=rgb(51, 102, 153) !important]复制代码
[color=rgb(160, 160, 160) !important]
[color=#a0a0a0 !important]?

1

2

3

4

AlphaAnimation animation = new AlphaAnimation(1.0f,0.0f);//marker点动画(需导入百度地图的Animation包)
animation.setDuration(3000);
marker.setAnimation(animation);
marker.startAnimation();





[Java] [color=rgb(51, 102, 153) !important]查看源文件 [color=rgb(51, 102, 153) !important]复制代码
[color=rgb(160, 160, 160) !important]
[color=#a0a0a0 !important]?

1

2

OverlayOptions ooCircle = new CircleOptions().fillColor(R.color.colorAccent)//地图上已point为中心添加圆
  .center(point).stroke(new Stroke(5, R.color.colorPrimary)).radius(1400);





发表于 2019-2-12 13:14:57 | 显示全部楼层   上海市上海市
https://github.com/michael007js/-DEMO/tree/master/app/src/main/java/com/sss/operation 全套
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 致发广告者

发布主题 收藏帖子 返回列表

sitemap| 易语言源码| 易语言教程| 易语言论坛| 诚聘英才| 易语言模块| 手机版| 广告投放| 精易论坛
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报电话0663-3422125,QQ: 800073686,邮箱:800073686@b.qq.com
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司 ( 粤ICP备12094385号-1) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173

快速回复 返回顶部 返回列表