Forums General How to show an image overlay on the map in an android app.

This topic contains 1 replies, has 2 voice, and was last updated by James Milleree 1 day, 16 hours ago
  • Abhay Singh

    Hi,
    The HERE Maps API for JavaScript provides an easy means of overlaying the region on the map with the bitmap image by using the H.map.Overlay object.
    Now I want to implement similar functionality in an android app to overlay an image onto the
    map by providing the bounding box coordinates and an image URL. Can someone guide me how to implement this?

    James Milleree

    Hi,

    I was facing the same issue. Here is the solution that worked for me and I hope it will also help in your case.

    Did you try Add a Ground Overlay? Well, you can use the GroundOverlay class to overlay an image on the map. You need to provide the bounding box coordinates, image URL, and other relevant properties.
    For Example:

    LatLngBounds bounds = new LatLngBounds(
    new LatLng(minLatitude, minLongitude), // South west corner
    new LatLng(maxLatitude, maxLongitude) // North east corner
    );

    GroundOverlayOptions overlayOptions = new GroundOverlayOptions()
    .image(BitmapDescriptorFactory.fromUrl(imageUrl))
    .positionFromBounds(bounds);

    googleMap.addGroundOverlay(overlayOptions);

    After doing that ensure that your app has the necessary permissions for accessing the internet if you are loading images from URLs.

    Remember to replace placeholders like minLatitude, minLongitude, maxLatitude, maxLongitude, and imageUrl with your actual data.

    Resource- Power Apps certification

    Thanks

    • This reply was modified 1 day, 16 hours ago by James Milleree.
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.