Всем привет,подскажите пожалуйста,как можно для разных групп маркеров,создающихся через
Map<String, Marker> artefacts = new HashMap();
Marker Artefact;
Artefact = mMap.addMarker(new MarkerOptions()
.position(new LatLng(a_lat, a_lon)) //setting position
.draggable(false)
.title(name)
.snippet(a_key)
.icon(icon)); //Adding a title
artefacts.put(dataSnapshot.getKey(), Artefact);
и через
Map<String, Marker> markers = new HashMap();
test = BitmapDescriptorFactory.fromResource(R.mipmap.me);
Marker uAmarker = mMap.addMarker(new MarkerOptions()
.position(new LatLng(latitude, lontitude)) //setting position
.draggable(false)
.title("Моя позиция")
.icon(test)); //Adding a title
markers.put(dataSnapshot.getKey(), uAmarker);
Сделать разные infoWindow? То есть чтобы у каждой "группы" был свой дизайн и т.п
Создайте свой класс, чтобы управлять маркерами и примените к нему GoogleMap.InfoWindowAdapter, а маркером управляйте в getInfoContents(Marker marker)
Например,
public class MapInfoWindowAdapter implements GoogleMap.InfoWindowAdapter{
private Context context;
private View myView;
...
@Override
public View getInfoContents(Marker marker) {
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
//получаем маркер проверяем его на что-то и строим нужный View
if(marker.getTitle().equals("Я")){
myView = inflater.inflate(R.layout.infowindow1, null);
}else
myView = inflater.inflate(R.layout.infowindow2, null);
return myContentsView;
}
}
Продвижение своими сайтами как стратегия роста и независимости