需要设置 .anchor(0.5f,0.5f) Log.v("pcw","setMarker : lat : "+ lat+" lon : " + lon); //定义Maker坐标点 LatLng point = new LatLng(lat, lon); //构建Marker图标 BitmapDescriptor bitmap = BitmapDescriptorFactory .fromResource(R.drawable.timg); //构建MarkerOption,用于在地图上添加Marker // anchor(0.5f,0.5f) 用来设置经纬度旁边的Marker偏移问题 OverlayOptions option = new MarkerOptions() .position(point) .anchor(0.5f,0.5f) .icon(bitmap); //在地图上添加Marker,并显示 mBaiduMap.addOverlay(option); ********************//修改已经添加上去的marker******************** Marker marker= (Marker) mBaiduMap.addOverlay(option); mMarkers.add(marker); Marker marker = mMarkers.get(mMarkers.size()-2); Marker marker1 = mMarkers.get(mMarkers.size()-1); marker.setIcon(BitmapDescriptorFactory.fromBitmap(BitmapFactory.decodeResource(getResources(),R.drawable.timg))); marker1.setIcon(BitmapDescriptorFactory.fromBitmap(BitmapFactory.decodeResource(getResources(),R.drawable.zhinanzhen))); marker1.setRotate(190f);
后期如若遇到其他问题,会及时更新