I have a map application that follows the user and what I want to know is how to add a marker that follows the user. how close is it to just adding a marker at a set place? Can I switch the overlay to track somehow?
Thanks
mapView.getOverlays.clear() to remove the old overlay. And then place it again the way you placed the first overlay with the position you want. Place the overlay and the overlay item.
Related
I have several markers with different colors, every color is used for specific purpose(like user's location etc). for each color I want to add short description of marker on the map.Is it possible to add short description of color on google map in right side corner?
In your layout file of map you can add any thing apart from MapFragment. but ensure that in your xml add other views after Mapfragment then they will appear above map fragment.
I am tracking my employees position on google map what I want to do is
to move the marker from its old position to a new position.
I am using this library for the cluster marker and the custom marker icons.
I want to move the marker from one position to another one, like other apps move their icons like any online cab application
Please help me, it's very important for me.
If you want to move the Marker along with the user interactions on the map something like few Cab Service do, you can refer the below link for the solution :
Map style like other Cab Service
I am creating user navigation application but,there is problem in change the user position. I have to create the path every time from origin to destination when user change the potion , but i don't want this. Actually i want output like Google navigation application as the person moving . Object is moving on the path.
Thanks in advance .
So it is better option that if on map whenever you have long press click on map then that current marker is disappear and new marker create at a position where you Touch on map??
In my apps, I have few overlay items,
some are locations of schools,
others is a circle of 30metres around the current point.
As the current location changes from time to time, I want to clear the circle of overlay and redraw it again, however, the locations of schools are fixed, they do not need to change.
The question is, how can I clear part of overlay items?
Thanks a lot!
if you want to clear Overlays
mapView.getOverlays().clear();
and if you want to clear all in mapview
mapView.removeAllViews();
Then refresh your mapview
How do i go about changing the location of an overlay. Now, one way is to remove the original overlay n draw a new one. Doing this changes the index of all overlays drawn after it.
For my application, each overlay represent a user with a certain ID. when this user moves, i need to update his location. If i remove the overlay from the list, them the hashmap i am using to locate the overlay for this user, will be rendered useless.
How should I go about doing this?
There is no way that I know of. You can simply
// remove the old key association
hMap.remove(idForOverlay);
// add a new one
hMap.put(idForOverlay, newOverlayItem);
// add item to the overlays
mapView.getOverlays().add(newOverlayItem);
mapView.invalidate();
Actually you don't even have to remove() and put() will replace the current association with the newly added association with the key. The current association is returned as an Object
If I understand right you can change the overlay point and then call MapView.invalidate.