use of cl.smartcities.isci.transportinspector.map.tasks.GenerateViewIconTask in project androidApp by InspectorIncognito.
the class BusUserPlugin method updateUserEvents.
public void updateUserEvents(ArrayList<ServerSentEvent> newEvents, String reporterId) {
if (currentUserBus != null && reporterId.equals(currentUserBus.getId())) {
currentUserBus.setEvents(newEvents);
final GeoJsonSource locationGeoJsonSource = mapboxMap.getSourceAs(LocationLayerConstants.LOCATION_SOURCE);
ArrayList<IconBuilder> buildingList = new ArrayList<>();
buildingList.add(new UserBusIconsBuilder(currentUserBus).toBuilder());
GenerateViewIconTask task = new GenerateViewIconTask(new GenerateViewIconTask.ImageLoaderListener() {
@Override
public void onImageGenResult(HashMap<String, View> viewMap, HashMap<String, Bitmap> bitmapHashMap) {
mapboxMap.addImages(bitmapHashMap);
if (locationGeoJsonSource != null) {
locationGeoJsonSource.setGeoJson(userLocationFeature);
}
}
}, viewMap, buildingList);
task.execute();
}
}
Aggregations