谷歌地图 Android 上的 GPS 标记

发布于 2024-09-27 13:14:51 字数 145 浏览 0 评论 0原文

我正在开发一个显示用户当前位置的应用程序。我想在用户的当前位置显示一个标记。

我使用图像作为标记来显示当前位置。但我想显示一个动画箭头来显示范围,就像在谷歌地图 Android 应用程序中一样。谁能告诉我如何实现这一目标。任何示例代码都会有很大帮助......

I am developing an application which shows the current location of the user. I want to display a marker on the current location of the user.

I have used an image as marker to display current location. But i want to display an animated arrow showing the range just like in the google maps android app. Can anyone please tell me how to achieve this. Any sample code will be of great help...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

两仪 2024-10-04 13:14:51

尝试这个棘手的解决方案......
如果你使用 javascript,如果 .gif 不起作用,请尝试 setInterval() 来更改图像。

函数运行动画(回调){
设置间隔(函数(){
// 在这里设置新标记
// var newVal = 回调(); <-- 使用回调来获取新值
}
, 500); // 间隔(以毫秒为单位)
}

try this tricky solution...
if u use javascript, try setInterval() to cahnge image if .gif doesn't work.

function runAnimation(callback){
setInterval(function(){
// set new marker here
// var newVal = callback(); <-- use callback to get new value
}
, 500); // interval in millisec
}

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文