Search code examples
androidgoogle-mapsandroid-studiocustom-overlay

Hide everything except Custom Overlay in Android Google Maps Activity


I currently have an overlay set up in my app for google maps on a google maps activity.

The image lines up perfectly, but when you leave the area of the overlay you see the normal google maps view.

I want to hide everything except Custom Overlay, how can I go about doing that?

In order to prevent a user from zooming out from where I have the camera zoomed in and losing the custom overlay, can I lock the user to only be within certain gps coordinates? (The area covered by the custom overlay)


Solution

  • It looks like the answer is creating another overlay like I did, and like cYrixmorten said making it a huge size when putting it in. I used 10,000:

    GroundOverlayOptions audubonTrailMap = new GroundOverlayOptions()
                .image(BitmapDescriptorFactory.fromResource(R.drawable.trailmapimage))
                .position(schlitzAudubon, 10000f, 10000f);
    
    mMap.addGroundOverlay(audubonTrailMap);