diff --git a/src/main/java/smartcity/accessibility/navigation/Navigation.java b/src/main/java/smartcity/accessibility/navigation/Navigation.java index cdff34ea..2c2f3b26 100644 --- a/src/main/java/smartcity/accessibility/navigation/Navigation.java +++ b/src/main/java/smartcity/accessibility/navigation/Navigation.java @@ -37,7 +37,7 @@ public static LatLng[] showRoute(Location source, Location destination, Integer return arrayToLatLng(s.getShapePoints()); } - private static LatLng[] arrayToLatLng(Double[] shapePointsArr) { + public static LatLng[] arrayToLatLng(Double[] shapePointsArr) { LatLng[] $ = new LatLng[shapePointsArr.length / 2]; int k = 0; for (int i = 0; i < shapePointsArr.length - 1; i += 2) { diff --git a/src/test/java/smartcity/accessibility/navigation/NavigationTest.java b/src/test/java/smartcity/accessibility/navigation/NavigationTest.java index 441ff70c..34f6e810 100644 --- a/src/test/java/smartcity/accessibility/navigation/NavigationTest.java +++ b/src/test/java/smartcity/accessibility/navigation/NavigationTest.java @@ -50,7 +50,7 @@ public void getRouteFromServersWithLinksToAvoid() throws CommunicationFailed { Latlng to = new Latlng(31.770981, 34.620567);// HaYam HaTichon Blvd 1 List segmentsToAvoid = new ArrayList(); segmentsToAvoid.add(Navigation.getMapSegmentOfLatLng(31.769955, 34.623123));// bareket - // st + // st Route r = Navigation.getRouteFromMapQuest(from, to, segmentsToAvoid); Shape shape = r.getShape(); Double[] shapePoints = shape.getShapePoints(); @@ -70,15 +70,21 @@ public void getRouteFromServersWithLinksToAvoid() throws CommunicationFailed { } @Test - @Ignore - public void avoidSegement() throws CommunicationFailed { + public void avoidOneSegement() throws CommunicationFailed { // TODO this test is temporal for it relay on things that will change! Latlng from = new Latlng(31.768762, 34.632052);// abba ahimeir Latlng to = new Latlng(31.770981, 34.620567);// HaYam HaTichon Blvd 1 List segmentsToAvoid = new ArrayList(); segmentsToAvoid.add(Navigation.getMapSegmentOfLatLng(31.76935, 34.626793));// sd Double[] shapePoints = Navigation.getRouteFromMapQuest(from, to, segmentsToAvoid).getShape().getShapePoints(); - + MapView mapview = JxMapsFunctionality.getMapView(); + JxMapsConvertor.displayRoute(mapview, Navigation.arrayToLatLng(shapePoints)); + try { + Thread.sleep(10000000); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } } @Test @@ -96,4 +102,5 @@ public void displayMap() throws CommunicationFailed { e.printStackTrace(); } } + }