在Android中的MapBox上显示面板

时间:2019-02-12 08:22:16

标签: android mapbox mapbox-android

我在Android中使用MapBox并在其上显示一些要点。现在,我想在地图的左上方显示一个面板,并在此面板中显示一些信息。我怎样才能做到这一点? (示例显示在URL https://docs.mapbox.com/help/img/directions/gljs-plugin.png中的图像中,类似于该面板的面板在image中显示,左侧的黑色面板) 谢谢

private MapView mapView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

    Mapbox.getInstance(this, YOUR_MAPBOX_ACCESS_TOKEN);

    setContentView(R.layout.activity_main);

    mapView = (MapView) findViewById(R.id.mapView);
    mapView.onCreate(savedInstanceState);
    mapView.getMapAsync(new OnMapReadyCallback() {
    @Override
    public void onMapReady(@NonNull MapboxMap mapboxMap) {

        mapboxMap.setStyle(Style.MAPBOX_STREETS, new Style.OnStyleLoaded() {
        @Override
        public void onStyleLoaded(@NonNull Style style) {

            // Map is set up and the style has loaded. Now you can add data or make other map adjustments



        }
    });
    }
});

0 个答案:

没有答案