如何让我的圆圈越过建筑物,而不是透明度

问题描述 投票:0回答:1

我无法禁用建筑物或手势,因为这不是问题:

googleMap.getUiSettings().setZoomControlsEnabled(false);
googleMap.getUiSettings().setAllGesturesEnabled(false);
GoogleMap.setBuildingsEnabled(false);

我想要建筑物,但处于足迹模式,而不是 3D,该怎么做?或者如果可能的话,直接在建筑物上画圈

int colorWithOpacity = Color.argb(255, 255, 0, 0);

// Ajuster les coordonnées pour déplacer légèrement la position vers la droite et vers le bas
double offsetLat = 0.1; // Ajoutez une petite valeur à la latitude
double offsetLng = 0.1; // Ajoutez une petite valeur à la longitude
LatLng adjustedLocation = new LatLng(startPoint.latitude + offsetLat, startPoint.longitude + offsetLng);


// Ajouter une nouvelle superposition de cercle avec la précision
accuracyOverlay = googleMap.addCircle(new CircleOptions()
        .center(adjustedLocation)
        .radius(location.getAccuracy())
        .strokeColor(colorWithOpacity)
        .fillColor(colorWithOpacity));
java android google-maps overlay
1个回答
0
投票

试试这个方法:

int colorWithOpacity = Color.argb(255, 255, 0, 0);

    double offsetLat = 0.1; // Add a small value to the latitude
    double offsetLng = 0.1; // Add a small value to the longitude
    LatLng adjustedLocation = new LatLng(startPoint.latitude + offsetLat, startPoint.longitude + offsetLng);
    
   
    accuracyOverlay = googleMap.addCircle(new CircleOptions()
            .center(adjustedLocation)
            .radius(location.getAccuracy())
            .strokeColor(colorWithOpacity)
            .fillColor(colorWithOpacity)
            .zIndex(1f)); // Set a high Z-index to ensure it is drawn on top
    
    
    googleMap.setBuildingsEnabled(false);
© www.soinside.com 2019 - 2024. All rights reserved.