javaandroidprogress-barmarkermapactivity

How to add a ProgressBar and a button underneath a marker



I would like to add a button and a progress bar underneath every marker in my map.
Let me show you my map:

[Here you can see 4 different markers created in random locations[1]

Here you are the method I use to spawn 5 different markers (in my code they are the enemies):

public void spawnEnemies(Location location){
   Random r = new Random();

    for (int i = 0; i < 5; i++) {
        enemies[i] = new Enemy("Name", 0, location);
        markerOptions= new MarkerOptions().position(enemies[i].position).title("Monster" + enemies[i].name).snippet("Level" + enemies[i].livello + "\n" + enemies[i].printHealth());
        circleOptions= new CircleOptions().center(nemici[i].position).radius(nemici[i].radius).fillColor(color).strokeColor(strokeColor).strokeWidth(8);
        enemies[i].marker = map.addMarker(markerOptions);
        enemies[i].circle = map.addCircle(circleOptions);

        quantityOfEnemies++;

    }
}

Is there any method to add objects below markers?
Thank you for your time and consideration.


Solution

  • Understand the Google APIs for Android Maps first:

    Google Map APIs

    and

    Maps With Markers

    Please see that you can overlay the map objects using this reference:

    Map Objects

    Please go through this documentation after you follow the above:

    Ground Overlays on Map

    I think you should go through complete tutorial.

    You need to understand the concept of tiles as well.

    Tile Overlays

    Now what Uber does is, it keeps two Layout groups, one to show the map, and the other one (FrameLayout) to toggle between animated ImageView with a static ImageView, while the map is dragged and stopped. But these ImageViews stay in their place. So you have to take Map Objects that overlay on it and move along. In one of the objects you can place progress bar.

    Happy Coding :-).