【发布时间】:2013-07-13 04:19:14
【问题描述】:
我想显示一个我自己选择的标记来代替默认的蓝色图标。我怎样才能改变它。
目前我在当前位置手动添加。
@Override
public void onMyLocationChange(Location location) {
// Creating a LatLng object for the current location
LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
// Showing the current location in Google Map
CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(
latLng, 15);
googleMap.animateCamera(cameraUpdate);
marker = googleMap.addMarker(new MarkerOptions()
.position(latLng)
.title("Current Location(You)")
.snippet("Current")
.icon(BitmapDescriptorFactory
.fromResource(R.drawable.green_loc_icon))
.draggable(true));
}
});
【问题讨论】:
标签: android google-maps-android-api-2 currentlocation