How do I hide the Google logo from Google maps by adding an Overlaid image to Google maps?

I am adding a bitmap image on Google maps using GroundOverlayOptions, this image will be superimposed on Google maps.

Below is my code.

 @Override
public void onLocationChanged(Location location) {

    TextView tvLocation = (TextView) findViewById(R.id.tv_location);
    location = generateRandomLoc(location, 0);
    double latitude = location.getLatitude();
    double longitude = location.getLongitude();
    LatLng latLng = new LatLng(latitude, longitude);

    //Setting padding to hide google logo
    mapView.setPadding(-10,0,0,0);

    CameraPosition cameraPosition = new CameraPosition.Builder().target(latLng).build();
    mapView.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
    mapView.moveCamera(CameraUpdateFactory.newLatLng(latLng));
    //get camera position frm map view
    LatLng cameraPosLatLng = mapView.getCameraPosition().target;
    if (isFlag) {
        BitmapDescriptor image = BitmapDescriptorFactory.fromResource(R.drawable.overlay_pink_image);
        mapView.addGroundOverlay(new GroundOverlayOptions()
                .image(image).position(latLng, 458, 274)
                .transparency(0.5f));
        mapView.animateCamera(CameraUpdateFactory.zoomTo(17));
    }
    if (cirle != null) {
        cirle.remove();
    }
    cirle = mapView.addCircle(new CircleOptions().center(cameraPosLatLng).strokeColor(Color.GREEN).fillColor(Color.GREEN).radius(0.7));
}

I am trying to hide the Google logo from MapView by installing an add-on, but this logo will not be hidden from MapView. When I set the -10 fill to the left or bottom, 10% of the view will be disabled. But in the case of viewing the map, this may be different. If I installed a gasket (50,0,0,0); This logo will be placed on the right. How to disable or hide the Google logo on Google maps.

Any help would be greatly appreciated.

+4
source share
4 answers

Google

9.4 .

  • , , Google, , Google. Google , , ( API ), .
  • "powered by Google" ( (), Google API ) Google. Google Google, , .

, .

[]

3.2.3 .

() . , (i) Google ( , ); (ii) . , .

+18

Google Google Google Google. , , . TOS .

https://developers.google.com/maps/terms

9.4 .

, , Google, , Google. Google , , ( API ), .

+1

Android, :

final ViewGroup googleLogo = (ViewGroup) findViewById(R.id.single_map).findViewWithTag(Const.GOOGLE_MAPS_WATERMARK).getParent();
googleLogo.setVisibility(View.GONE);

single_map - SupportMapFragment.

+1

Simply! I achieved this by following these steps, either directly on the fragment, or on any parent layout.

<RelativeLayout
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:layout_marginBottom="-30dp"
  android:layout_marginTop="-30dp">

   <fragment
      android:id="@+id/map_frag_main"
      android:name="com.google.android.gms.maps.SupportMapFragment"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".MainActivity" />

</RelativeLayout>

Adding layout_margin will remove the Google logo and will not require filling, just make sure you add drawable, otherwise you will violate TOS. Hurrah!

0
source

Source: https://habr.com/ru/post/1616012/


All Articles