如何改变在Android的地图V2标记的位置 [英] How to change the position of a Marker on a Android Map v2

查看:133
本文介绍了如何改变在Android的地图V2标记的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要做到以下几点: 我在地图上的标记,我需要改变它的位置。因此,我试过如下:

I need to do the following: I have a Marker on the map and I need to change the position of it. So I tried the following:

MarkerOptions a = new MarkerOptions()
            .position(new LatLng(50,6)));
        map.addMarker(a);
        a.position(new LatLng(50,5));

其中,地图是一个 GoogleMap的。我想我必须刷新地图或财产以后等于?

where map is a GoogleMap. I think I have to refresh the map or somthing equal?

推荐答案

找到了解决办法,需要做的是这样的:

Found the solution, Need to do it like this:

MarkerOptions a = new MarkerOptions()
    .position(new LatLng(50,6)));
Marker m = map.addMarker(a);
m.setPosition(new LatLng(50,5));

这篇关于如何改变在Android的地图V2标记的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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