fix live location updates for own locations

This commit is contained in:
cyBerta
2019-03-23 11:16:40 +01:00
parent 3fe0adfb8d
commit d88cae015d
2 changed files with 5 additions and 2 deletions
@@ -83,6 +83,7 @@ public class MapActivity extends BaseActivity implements Observer {
mapboxMap.easeCamera(CameraUpdateFactory.newLatLngBounds(latLngBounds, 50), 1000);
});
mapboxMap.addOnMapClickListener(point -> {
final PointF pixel = mapboxMap.getProjection().toScreenLocation(point);
Log.d(TAG, "on item clicked.");
@@ -114,6 +114,7 @@ public class MapDataManager implements DcEventCenter.DcEventDelegate, GenerateIn
e.printStackTrace();
}
}
dcContext.eventCenter.addObserver(DC_EVENT_LOCATION_CHANGED, this);
}
public void onResume() {
@@ -340,17 +341,18 @@ public class MapDataManager implements DcEventCenter.DcEventDelegate, GenerateIn
@Override
public void handleEvent(int eventId, Object data1, Object data2) {
Log.d(TAG, "updateEvent in MapDataManager called. eventId: " + eventId);
int contactId = (Integer) data1;
int contactId = ((Long) data1).intValue();
if (contactMapSources.containsKey(contactId)) {
//FIXME: ---------v this is wrong, but there's no other opportunity for now
updateSource(chatIds[0], contactId);
generateMissingInfoWindows(contactId);
refreshSource(contactId);
}
}
@Override
public boolean runOnMain() {
return false;
return true;
}