Google Maps Android API v2:我的位置标记总是超过其他标记?

eti*_*nne 4 android android-mapview google-maps-android-api-2 android-maps-v2

目前正在使用Google地图将Android应用迁移到Google Maps Android v2; 我希望地图显示内置位置标记以及自定义标记.使用以前的库,我习惯在"自定义标记"下方绘制位置标记

mapView.setReticleDrawMode(ReticleDrawMode.DRAW_RETICLE_UNDER);
Run Code Online (Sandbox Code Playgroud)

我在新API中找不到类似的选项.我错过了什么?

eti*_*nne 7

经过一番搜索,我找不到这样的选择.

我最后删除了位置图钉,并在地图上添加了类似的标记和圆圈; 因为它是一个经典的标记,它出现在其他标记之下.

map.setMyLocationEnabled(false);

// ...
// get the current location with Android LocationManager in some way
// ...

// then draw it on the map when it changes:
if (null == getMyLocation())
    return;

if (null != locationMarker) {
    locationMarker.remove();
}
if (null != locationCircle) {
    locationCircle.remove();
}
LatLng loc = getMyLocation();

locationMarker = map.addMarker(new MarkerOptions()
        .icon(BitmapDescriptorFactory
                .fromResource(R.drawable.blue_pin_12))
        .position(getMyLocation()).anchor(0.5f, 0.5f));

float accuracy = getMyLocationAccuracy();

locationCircle = map.addCircle(new CircleOptions().center(loc)
            .radius(accuracy)
            .strokeColor(Color.argb(255, 0, 153, 255))
            .fillColor(Color.argb(30, 0, 153, 255)).strokeWidth(2));
Run Code Online (Sandbox Code Playgroud)

定位销