use of com.amap.api.maps.model.MarkerOptions in project YourEyes by SevenLJY.
the class MapActivity method showMarker.
/**
* showMarker():在指定位置显示一个marker
* 参数:latLng:要加marker的位置
* marker暂时已指定
* */
private void showMarker(LatLng latLng) {
MarkerOptions markerOptions = new MarkerOptions();
markerOptions.position(latLng);
markerOptions.icon(BitmapDescriptorFactory.fromResource(R.drawable.smallplaceholder));
markerOptions.draggable(true);
//添加marker
Marker marker = aMap.addMarker(markerOptions);
}
use of com.amap.api.maps.model.MarkerOptions in project ride-read-android by Ride-Read.
the class ProfileFragment method addSignInMarker.
private void addSignInMarker(LatLng latLng) {
MarkerOptions markerOption = new MarkerOptions();
markerOption.position(latLng);
//设置Marker可拖动
markerOption.draggable(false);
markerOption.icon(BitmapDescriptorFactory.fromBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.ic_map_label)));
// 将Marker设置为贴地显示,可以双指下拉地图查看效果
//设置marker平贴地图效果
markerOption.setFlat(true);
mAMap.addMarker(markerOption);
}
use of com.amap.api.maps.model.MarkerOptions in project ride-read-android by Ride-Read.
the class MapFragment method addMomentMarker.
private void addMomentMarker(LatLng latLng, Bitmap bitmap, MapMoment 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(false);
Marker marker = mAMap.addMarker(markerOption);
marker.setObject(moment);
TextOptions textOptions = new TextOptions().position(latLng).text(moment.getCount() + "").fontColor(Color.WHITE).backgroundColor(getResources().getColor(R.color.green_common)).fontSize(30).zIndex(1.f);
mAMap.addText(textOptions);
}
use of com.amap.api.maps.model.MarkerOptions in project ride-read-android by Ride-Read.
the class MapFragment method addMarker.
private Marker addMarker(LatLng latLng) {
MarkerOptions markerOption = new MarkerOptions();
markerOption.position(latLng);
//设置Marker可拖动
markerOption.draggable(false);
markerOption.icon(BitmapDescriptorFactory.fromBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.ic_map_label)));
// 将Marker设置为贴地显示,可以双指下拉地图查看效果
//设置marker平贴地图效果
markerOption.setFlat(true);
return mAMap.addMarker(markerOption);
}
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);
}
Aggregations