O
O
OM12016-10-31 18:32:56
Android
OM1, 2016-10-31 18:32:56

Android GoogleMaps: how to add and remove marker groups?

Good evening.

MarkerOptions markerOptions = new MarkerOptions().position(new LatLng(lat, lon)).title(owner_id);
Marker marker = mMap.addMarker(markerOptions);

How to group markers, something like List<Marker>for further operations with markers (delete a group, update markers in a group)?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
peacemakerv, 2016-11-02
@peacemakerv

Т.к. нет свойства для идентификации маркеров, то я в Snippet пишу идентификаторы, типа:
MarkerType:me (MarkerType:myobject, MarkerType:person....)
Subgroup:654646
....
Сохраняя их также, в List.

O
OM1, 2016-10-31
@OM1 Автор вопроса

Пока сделал так:

private List<Marker> markers;
markers = new ArrayList<>();
...
markers.add(marker);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question