如何创建与Android版谷歌地图V2传感器轴承一个位置箭头标记? [英] How to create a Location arrow Marker with Sensor bearing in Android Google Maps v2?

查看:296
本文介绍了如何创建与Android版谷歌地图V2传感器轴承一个位置箭头标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设法创建一个箭头的ImageView ,并得到来自传感器的方位,之后我转动的ImageView 查看类的使用 setRotation()方法。我怎么可以使用Android谷歌地图V2标记标记做到这一点?

I have managed to create an arrow ImageView and get the azimuth from the sensors, after that I rotate the ImageView using setRotation() method of the View class. How I can do this for a marker using Android Google Maps v2 Markers?

推荐答案

我建议你看一看的 Android的地图从谷歌-utils 项目。

I suggest you take a look at the android-maps-utils project from Google.

它包含

  • BubbleIconFactory : Responsible for generating markers
  • RotationLayout : Responsible for rotating the contents of the layout (the marker) by multiples of 90 degrees

这应该给你你需要显示的箭头/标记,并给它一定的旋转积木。你可能需要定制rotationlayout了一下。

This should give you the building blocks you need to display your arrow/marker and give it a certain rotation. You'll probably need to customize the rotationlayout a bit.

这篇关于如何创建与Android版谷歌地图V2传感器轴承一个位置箭头标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆