use of cl.smartcities.isci.transportinspector.map.model.busStop.IconBuilder in project androidApp by InspectorIncognito.
the class BusStopPlugin method updateSelectedBusStopIcons.
private void updateSelectedBusStopIcons() {
ArrayList<IconBuilder> buildingList = new ArrayList<>();
buildingList.add(new BusStopIconsBuilder(FeatureCollection.fromFeatures(new Feature[] { selectedBusStop })).toBuilder());
final GenerateViewIconTask task = new GenerateViewIconTask(new GenerateViewIconTask.ImageLoaderListener() {
@Override
public void onImageGenResult(HashMap<String, View> viewMap, HashMap<String, Bitmap> bitmapHashMap) {
if (mapboxMap != null) {
mapboxMap.addImages(bitmapHashMap);
}
refreshBusStopSource();
}
}, viewMap, buildingList);
task.execute();
}
use of cl.smartcities.isci.transportinspector.map.model.busStop.IconBuilder 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