myLocationOverlay 更改标记 [英] myLocationOverlay change the marker

查看:23
本文介绍了myLocationOverlay 更改标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改谷歌地图中 MyLocationOverlay 的默认蓝色动画标记?

how do i change the default blue animated marker for MyLocationOverlay in google maps?

推荐答案

第 1 步:创建 MyLocationOverlay 的子类.

Step #1: Create a subclass of MyLocationOverlay.

第 2 步:覆盖 drawMyLocation() 并根据需要绘制标记.请记住,此方法不仅绘制标记,而且如果用户的位置移动到屏幕边缘附近,并且我们在构造函数中获得了一个 MapController,我们将滚动到重新调整新阅读".

Step #2: Override drawMyLocation() and draw the marker however you like. Bear in mind that this method not only draws the marker, but "if the user's position moves near the edge of the screen, and we've been given a MapController in our constructor, we'll scroll to recenter the new reading".

这篇关于myLocationOverlay 更改标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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