0

我正在使用Google Maps v2 Android MapView. 用户位置的标记是一个蓝色圆圈。我想将其更改为我的drawable.

这可能吗?

我知道我可以添加这样的标记,但这不适用于用户自己的位置:

this.marker = BitmapDescriptorFactory.fromResource(R.drawable.marker);
this.map.addMarker(new MarkerOptions().position(position).title(name)
                .draggable(false).icon(this.marker));
4

2 回答 2

0

是的,您可以添加自定义标记以显示用户当前位置....但您需要使用 locationListener 计算您自己的纬度和经度,并在地图上显示该位置,如下所示:

public void setCurretnLocMarker(loc) {

        LatLng mLatLng=new LatLng(loc.getLatitude(), loc.getLongitude());
        getMap().animateCamera(CameraUpdateFactory.newLatLng(mLatLng));

        getMap().addMarker(new MarkerOptions().position(mLatLng).title(mLatLng.toString()).draggable(false));
    }
于 2013-03-04T16:00:49.123 回答
0

我想到的方法是这样的。

1)你有当前位置的latlng ...添加带有自定义drawable的标记。2)禁用googlemap上的当前位置..禁用它认为调用是

mGoogleMapObject.setLocationEnable(false);

而已。

于 2013-03-04T16:07:04.130 回答