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 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.
Understand the Google APIs for Android Maps first:
and
Please see that you can overlay the map objects using this reference:
Please go through this documentation after you follow the above:
I think you should go through complete tutorial.
You need to understand the concept of tiles as well.
Now what
Uber
does is, it keeps twoLayout groups
, one to show the map, and the other one (FrameLayout
) to toggle between animatedImageView
with a staticImageView
, while the map is dragged and stopped. But these ImageViews stay in their place. So you have to takeMap Objects
that overlay on it and move along. In one of the objects you can place progress bar.
Happy Coding :-).