Search in sources :

Example 1 with MarkerOptions

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

Example 2 with 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);
}
Also used : MarkerOptions(com.amap.api.maps.model.MarkerOptions)

Example 3 with MarkerOptions

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

Example 4 with MarkerOptions

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

Example 5 with MarkerOptions

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

Aggregations

MarkerOptions (com.amap.api.maps.model.MarkerOptions)7 Marker (com.amap.api.maps.model.Marker)4 CameraUpdate (com.amap.api.maps.CameraUpdate)1 LatLng (com.amap.api.maps.model.LatLng)1 TextOptions (com.amap.api.maps.model.TextOptions)1