From 0eda008c0439dc149e093165326968c5fad3a338 Mon Sep 17 00:00:00 2001
From: berengerpro
" + shipment.getPickupLocation().getCoordinate().getX() + ", " + shipment.getPickupLocation().getCoordinate().getY() + "
" + @@ -166,13 +167,14 @@ private void initMapView(RouteInfo route) { "Départ : " + pickupTime.plusSeconds((long) (shipment.getPickupServiceTime()/1000)).format(timeFormat); LocalTime deliveryTime = departureTime.plusSeconds((long) activityTime(route.tourActivities.get(0), shipment.getDeliveryLocation().getId())); + int deliveryOrder = activityOrder(route.tourActivities.get(0), shipment.getDeliveryLocation().getId()); String deliveryLabel = "Delivery
" + shipment.getDeliveryLocation().getCoordinate().getX() + ", " + shipment.getDeliveryLocation().getCoordinate().getY() + "
" + "Arrivée : " + deliveryTime.format(timeFormat) + "
" + "Départ : " + deliveryTime.plusSeconds((long) (shipment.getDeliveryServiceTime()/1000)).format(timeFormat); - mapView.addMarker(from(shipment.getPickupLocation()), "Pickup", new PickupMarker(hex), 1, pickupLabel, "pickup" + idMarker); - mapView.addMarker(from(shipment.getDeliveryLocation()), "Delivery", new DeliveryMarker(hex), 1, deliveryLabel, "delivery" + idMarker); + mapView.addMarker(from(shipment.getPickupLocation()), "Pickup", new PickupMarker(hex, pickupOrder), 1, pickupLabel, "pickup" + idMarker); + mapView.addMarker(from(shipment.getDeliveryLocation()), "Delivery", new DeliveryMarker(hex, deliveryOrder), 1, deliveryLabel, "delivery" + idMarker); k++; } double lastRouteTime = 0.0; @@ -457,4 +459,15 @@ private double activityTime(TourActivities tourActivity, String id){ } return 0.0; } + + private int activityOrder(TourActivities tourActivity, String id){ + int i = 1; + for (TourActivity a : tourActivity.getActivities()){ + if (a.getLocation().getId().equals(id)){ + return i; + } + i++; + } + return 0; + } }