use of com.amap.api.maps.model.MarkerOptions in project ride-read-android by Ride-Read.
the class PersonalityMapActivity method addMarker.
private void addMarker(LatLng latLng, Bitmap bitmap, Moment moment) {
if (null == latLng || null == bitmap)
return;
MarkerOptions markerOption = new MarkerOptions();
markerOption.position(latLng);
//设置Marker可拖动
markerOption.draggable(false);
markerOption.icon(BitmapDescriptorFactory.fromBitmap(bitmap));
// 将Marker设置为贴地显示,可以双指下拉地图查看效果
//设置marker平贴地图效果
markerOption.setFlat(true);
Marker marker = mAMap.addMarker(markerOption);
marker.setObject(moment);
}
use of com.amap.api.maps.model.MarkerOptions in project YourEyes by SevenLJY.
the class MapActivity method updatePosition.
/**
* updatePosition():更新地图位置
* 在更新位置加上marker
* */
private void updatePosition(LatLng location) {
LatLng pos = location;
//创建一个设置经纬度的CameraUpdate
CameraUpdate cuLoc = CameraUpdateFactory.changeLatLng(pos);
//更新地图显示区域
aMap.moveCamera(cuLoc);
//清除地图所有覆盖物
aMap.clear();
//创建一个MarkerOptions对象并使用自定义图标
MarkerOptions markerOptions = new MarkerOptions();
markerOptions.position(pos);
markerOptions.icon(BitmapDescriptorFactory.fromResource(R.drawable.smallplaceholder));
markerOptions.draggable(true);
//添加marker
Marker marker = aMap.addMarker(markerOptions);
}
Aggregations