istutor bugifx map
This commit is contained in:
parent
8fbce4d9d3
commit
66dba76ed4
@ -95,11 +95,12 @@ public class MapActivity extends BaseActivity
|
|||||||
private int bearingParam = 180;
|
private int bearingParam = 180;
|
||||||
private int tiltParam = 30;
|
private int tiltParam = 30;
|
||||||
private String myId;
|
private String myId;
|
||||||
|
private boolean isTutor;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
isTutor = PrefUtils.getIsTutor(this);
|
||||||
myId = PrefUtils.getUserId(getApplicationContext());
|
myId = PrefUtils.getUserId(getApplicationContext());
|
||||||
|
|
||||||
coordinateService = ApiClient.getClient(getApplicationContext())
|
coordinateService = ApiClient.getClient(getApplicationContext())
|
||||||
@ -136,8 +137,9 @@ public class MapActivity extends BaseActivity
|
|||||||
|
|
||||||
mapboxMap.setOnMarkerClickListener(marker -> {
|
mapboxMap.setOnMarkerClickListener(marker -> {
|
||||||
String id = markerUserHash.get(marker.getId());
|
String id = markerUserHash.get(marker.getId());
|
||||||
|
String locationLevel = PrefUtils.getLocationLevel(getApplicationContext());
|
||||||
|
|
||||||
if (id.equals(myId)) {
|
if (id.equals(myId) && (locationLevel.equals(SharingLevel.MANUAL.toString()) || locationLevel.equals(SharingLevel.PREDEFINED.toString()))) {
|
||||||
selectLocationButton.setVisibility(View.GONE);
|
selectLocationButton.setVisibility(View.GONE);
|
||||||
removeLocationButton.setVisibility(View.VISIBLE);
|
removeLocationButton.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
@ -157,8 +159,7 @@ public class MapActivity extends BaseActivity
|
|||||||
});
|
});
|
||||||
|
|
||||||
setToggleMapBoundsArea();
|
setToggleMapBoundsArea();
|
||||||
|
if (isTutor) {
|
||||||
if (PrefUtils.getIsTutor(this)) {
|
|
||||||
setOnMapLongClickListener();
|
setOnMapLongClickListener();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -380,7 +381,6 @@ public class MapActivity extends BaseActivity
|
|||||||
markerAnimator.start();
|
markerAnimator.start();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
coordsMap.put(id, element);
|
coordsMap.put(id, element);
|
||||||
marker.setPosition(toDestination);
|
marker.setPosition(toDestination);
|
||||||
|
|
||||||
@ -393,8 +393,6 @@ public class MapActivity extends BaseActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//Add new marker
|
//Add new marker
|
||||||
coordsMap.put(id, element);
|
coordsMap.put(id, element);
|
||||||
@ -435,18 +433,6 @@ public class MapActivity extends BaseActivity
|
|||||||
// For next fetch
|
// For next fetch
|
||||||
previousCoordsIds.clear();
|
previousCoordsIds.clear();
|
||||||
previousCoordsIds.addAll(currentCoordsIds);
|
previousCoordsIds.addAll(currentCoordsIds);
|
||||||
|
|
||||||
|
|
||||||
for (Coordinate coordinate : coordsMap.values()) {
|
|
||||||
// 300000 = 5mins
|
|
||||||
if ((System.currentTimeMillis() - coordinate.getTimeStamp()) > (long) 300000) {
|
|
||||||
String id = coordinate.getUserId();
|
|
||||||
Marker markerToRemove = markerHash.get(id).getMarker();
|
|
||||||
markerHash.remove(id);
|
|
||||||
coordsMap.remove(id);
|
|
||||||
mapboxMap.removeMarker(markerToRemove);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user