Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MapBox Android how to hide mapbox label

Tags:

android

mapbox

Screenshot

How to hide mapbox info label at bottom left corner?

like image 881
elya_a Avatar asked May 30 '16 08:05

elya_a


3 Answers

Just disable the attribution and logo, as follows:

mapboxMap.getUiSettings().setAttributionEnabled(false);
mapboxMap.getUiSettings().setLogoEnabled(false);
like image 153
Gabriel Perez Avatar answered Nov 06 '22 10:11

Gabriel Perez


The marked answer is wrong, incanus was referring to the older, now deprecated, SDK. Attribution is required because:

  • Mapbox’s map designs are copyrighted
  • The OpenStreetMap data source’s ODbL license requires attribution
  • Other data sources used in our satellite, streets, and terrain maps also require attribution

If your map does not use any of these data sources, and does not use Mapbox’s designs, like Streets, Light, or Outdoors, then you are not required to provide attribution.

In Android you can move the attribution to another position if you need to using the correct attribute in the mapview XML. If your map doesn't fit any of the cases listed above, removing the attribution can be done in XML like so:

mapbox:attribution_enabled="false"

When it comes to hiding the Mapbox logo, All non-Enterprise accounts are required to display the Mapbox logo when using any Mapbox maps. Therefore, you can't remove it.

Sources: https://www.mapbox.com/help/attribution/, https://www.mapbox.com/help/mapbox-logo/

like image 37
cammace Avatar answered Nov 06 '22 08:11

cammace


Try this,please:

 mapView.getMapAsync(new OnMapReadyCallback() {
        @Override
        public void onMapReady(MapboxMap mapboxMap) {
            mapboxMap.animateCamera(CameraUpdateFactory.newCameraPosition(new CameraPosition.Builder()
                            .target(new LatLng(36,50))
                            .zoom(10)
                            .tilt(45.0)
                            .build()),
                    10000);

            mapboxMap.getUiSettings().setAttributionEnabled(false);
            mapboxMap.getUiSettings().setLogoEnabled(false);

        }
    });
like image 5
ch65 Avatar answered Nov 06 '22 10:11

ch65