Search in sources :

Example 1 with TextOptions

use of com.amap.api.maps.model.TextOptions 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);
}
Also used : MarkerOptions(com.amap.api.maps.model.MarkerOptions) Marker(com.amap.api.maps.model.Marker) TextOptions(com.amap.api.maps.model.TextOptions)

Aggregations

Marker (com.amap.api.maps.model.Marker)1 MarkerOptions (com.amap.api.maps.model.MarkerOptions)1 TextOptions (com.amap.api.maps.model.TextOptions)1