Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android MapActivity on map movement

I want to monitor when someone moves to another place on the map in a MapActivity but I have no idea how to do that. Maybe some sort of OnMapChange() listener?

like image 510
Mats Hofman Avatar asked Jan 06 '11 21:01

Mats Hofman


People also ask

How will you add marker on map?

For adding a custom marker to Google Maps navigate to the app > res > drawable > Right-Click on it > New > Vector Assets and select the icon which we have to show on your Map. You can change the color according to our requirements. After creating this icon now we will move towards adding this marker to our Map.

What is map activity in Android?

A Map is an important thing to have in your app as it gives your user a perfect view of the location. The Google map can be implemented easily in android studio project because android studio gives a ready to use activity.


1 Answers

You can extend the MapView class to add the necessary map change event. http://bricolsoftconsulting.com/extending-mapview-to-add-a-change-event/

The post above shows you how to detect zooming and panning via virtually every way you can interact with the map: swipe (for pan), zoom control +/- (for zooming) and pinch (for combined pan and zoom).

like image 141
Theo Avatar answered Sep 22 '22 13:09

Theo