禁用mapssdk的android特性

w1jd8yoj  于 2021-06-29  发布在  Java
关注(0)|答案(0)|浏览(167)

我创建了一个android应用程序 Maps SDK for Android 以便在其中显示Map。
我需要最基本的Map=一张有我当前位置标记的Map。
我不需要导航/位置/任何东西,我的目标是确保我的使用将在sdk的免费使用范围内,根据:

这也意味着禁用街景。
有什么方法可以在我的代码中禁用这些特性吗?
现在,我使用的最基本的代码来自他们的教程-链接:

public class MapsActivity extends AppCompatActivity implements OnMapReadyCallback {

    private GoogleMap mMap;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_maps);
        // Obtain the SupportMapFragment and get notified when the map is ready to be used.
        SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
                .findFragmentById(R.id.map);
        mapFragment.getMapAsync(this);
    }

    @Override
    public void onMapReady(GoogleMap googleMap) {
        mMap = googleMap;

        // Add a marker in Sydney and move the camera
        LatLng sydney = new LatLng(-34, 151);
        mMap.addMarker(new MarkerOptions()
                .position(sydney)
                .title("Marker in Sydney"));
        mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
    }
}

谢谢您

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题