我想用我自己的图片替换安卓地图V2在“我的位置”中使用的默认图标。我已经创建了自己的瓦片提供商,它引入了一些以蓝色为主的地图,因此默认的我的位置图标,小蓝色箭头,很难看到。

以前,我只会覆盖MyLocationOverlay的draw方法,但新的API中似乎没有这样的方法。
我还需要图标能够旋转,同样的方式,箭头做取决于你面对的方向。所以我不能只用普通的记号笔。基本上,我只需要为该箭头创建一个自定义图像。
发布于 2013-02-12 14:07:20
我的简单解决方法是禁用谷歌地图的“我的位置”
然后使用我的图标在地图上创建ImageView,然后使用捕获ImageView
onClick和getMyLocation,onClick中的animateCamera
this.mGoogleMap.getUiSettings().setMyLocationButtonEnabled(false);
this.mGoogleMap.setMyLocationEnabled(true);。
@Override
public void onClick(final View v) {
Location location = this.mGoogleMap.getMyLocation();
if (location != null) {
LatLng target = new LatLng(location.getLatitude(), location.getLongitude());
CameraPosition position = this.mGoogleMap.getCameraPosition();
Builder builder = new CameraPosition.Builder();
builder.zoom(15);
builder.target(target);
this.mGoogleMap.animateCamera(CameraUpdateFactory.newCameraPosition(builder.build()));
}
}https://stackoverflow.com/questions/14826345
复制相似问题