use of cl.smartcities.isci.transportinspector.database.RouteHelper in project androidApp by InspectorIncognito.
the class BusStopPlugin method busFeatureClick.
private void busFeatureClick(Feature selectedBusFeature) {
Log.d("BusStopPlugin", "busFeatureClick");
Feature busFeature = getFeatureByStringProperty(selectedBusFeature, busesFeatures, BusMarker.PROPERTY_ID);
if (busFeature == null) {
return;
}
if (selectedBus != null) {
if (busFeature.getId().equals(selectedBus.getId())) {
boolean maximized = selectedBus.getBooleanProperty(BusMarker.PROPERTY_MAXIMIZED);
selectedBus.addBooleanProperty(BusMarker.PROPERTY_MAXIMIZED, !maximized);
refreshBusSource();
return;
} else {
deselectSelectedBusFeature();
}
}
busFeature.addBooleanProperty(BusMarker.PROPERTY_MAXIMIZED, true);
selectedBus = busFeature;
selectedBusStop.addBooleanProperty(BusStopMarker.PROPERTY_MAXIMIZED, false);
refreshBusSource();
refreshBusStopSource();
RouteHelper helper = new RouteHelper(getContext());
ServerSentBus bus = ((BusMarker) busFeature).getBus();
ArrayList<LatLng> points = helper.getRoute(bus.getService(), bus.getDirection());
busPolyline = addBusRoutePolyline(points, Constants.BUS_COLOR.get(bus.getColorArrayIndex()));
animateCameraToSelection(busFeature);
}
use of cl.smartcities.isci.transportinspector.database.RouteHelper in project androidApp by InspectorIncognito.
the class BusSearchResultActivity method setRouteLists.
private void setRouteLists(Service service) {
RouteHelper routeHelper = new RouteHelper(this);
ServiceHelper serviceHelper = new ServiceHelper(this);
BusStopHelper busStopHelper = new BusStopHelper(this);
activePoints = routeHelper.getRoute(service.getName(), "I");
if (activePoints == null) {
activePoints = new ArrayList<>();
}
inactivePoints = routeHelper.getRoute(service.getName(), "R");
if (inactivePoints == null) {
inactivePoints = new ArrayList<>();
}
String busStopByService = serviceHelper.getBusStopByService(service.getName(), "I");
if (busStopByService == null || busStopByService.equals("")) {
activeBusStops = new ArrayList<>();
} else {
activeBusStops = busStopHelper.getAllBusStopsIn(busStopByService.split("-"));
}
busStopByService = serviceHelper.getBusStopByService(service.getName(), "R");
if (busStopByService == null || busStopByService.equals("")) {
inactiveBusStops = new ArrayList<>();
} else {
inactiveBusStops = busStopHelper.getAllBusStopsIn(busStopByService.split("-"));
}
}
use of cl.smartcities.isci.transportinspector.database.RouteHelper in project androidApp by InspectorIncognito.
the class OnBusEngine method setOnBus.
public void setOnBus(ServerSentBus bus) {
this.bus = bus;
RouteHelper helper = new RouteHelper(TranSappApplication.getAppContext());
ArrayList<LatLng> points = helper.getRoute(bus.getService(), bus.getDirection());
busPolyline = addBusRoutePolyline(points, Constants.BUS_COLOR.get(bus.getColorArrayIndex()));
setBusStopDrawable();
getRouteBusStop();
}
Aggregations