Polyline polyline = mPolylines.get(0); // Get copy of the points List<LatLng> points = polyline.getPoints(); mPolylines.get(0).remove(); mPolylines.remove(0); for (int i=3000; i<7000; i++) { points.remove(i); } // Create a PolylineOptions object with the new points PolylineOptions polylineOptions = new PolylineOptions().addAll(points); mPolylines.add(0, mMap.addPolyline(polylineOptions));
for(Polyline pol : allcrumbs){ List<LatLng> points = pol.getPoints(); for (LatLng point : points){ // dude never initialize variables in a loop again // its automatic fail for speed of execution. // String never = "Do this in a loop"; // int padding = 40; // offset from edges of the map in pixels builder.include(point); } }
Polyline polyline = ... List<LatLng> extractedPoints = polyline.getPoints();
private void moveToBounds(Polyline p){ LatLngBounds.Builder builder = new LatLngBounds.Builder(); for(int i = 0; i < p.getPoints().size();i++){ builder.include(p.getPoints().get(i)); } LatLngBounds bounds = builder.build(); int padding = 0; // offset from edges of the map in pixels CameraUpdate cu = CameraUpdateFactory.newLatLngBounds(bounds, padding); mMap.animateCamera(cu); }
private void moveToBounds(Polyline p) { LatLngBounds.Builder builder = new LatLngBounds.Builder(); List<LatLng> arr = p.getPoints(); for(int i = 0; i < arr.size();i++){ builder.include(arr.get(i)); } LatLngBounds bounds = builder.build(); int padding = 40; // offset from edges of the map in pixels CameraUpdate cu = CameraUpdateFactory.newLatLngBounds(bounds, padding); mMap.animateCamera(cu); }
public String getPolylinePoints(int ROIIndex, int shapeIndex) { // Parents: None // Points is not a reference return ((Polyline)root.getROI(ROIIndex).getUnion().getShape(shapeIndex)).getPoints(); }
public String getPolylinePoints(int ROIIndex, int shapeIndex) { // Parents: None // Points is not a reference return ((Polyline)root.getROI(ROIIndex).getUnion().getShape(shapeIndex)).getPoints(); }
@Test (groups = {"11-06-u-roi"}, dependsOnMethods = {"testROI2AndUnion"}) public void testShape6() { Assert.assertNotNull(union2); shape6 = union2.getShape(6); Assert.assertEquals(Polyline.class.getName(), shape6.getClass().getName()); Polyline polyline6 = (Polyline) shape6; Assert.assertEquals(ref.ROI2Shape6Stroke, polyline6.getStrokeColor()); Assert.assertEquals(ref.ROI2Shape6StrokeWidth, polyline6.getStrokeWidth()); Assert.assertEquals(ref.ROI2Shape6PolylinePoints, polyline6.getPoints()); Assert.assertEquals(ref.ROI2Shape6MarkerStart, polyline6.getMarkerStart()); }
@Test (groups = {"11-06-u-roi"}, dependsOnMethods = {"testROI2AndUnion"}) public void testShape5() { Assert.assertNotNull(union2); shape5 = union2.getShape(5); Assert.assertEquals(Polyline.class.getName(), shape5.getClass().getName()); Polyline polyline5 = (Polyline) shape5; Assert.assertEquals(ref.ROI2Shape5Stroke, polyline5.getStrokeColor()); Assert.assertEquals(ref.ROI2Shape5StrokeWidth, polyline5.getStrokeWidth()); Assert.assertEquals(ref.ROI2Shape5PolylinePoints, polyline5.getPoints()); Assert.assertEquals(ref.ROI2Shape5MarkerStart, polyline5.getMarkerStart()); Assert.assertEquals(ref.ROI2Shape5MarkerEnd, polyline5.getMarkerEnd()); }
map.animateCamera(CameraUpdateFactory.newLatLngZoom( newPoint, ZOOM_LEVEL)); points = polyline.getPoints(); points.add(newPoint); polyline.setPoints(points);
String points = polyline.getPoints(); int[][] coordinates = parsePoints(points); roi = new PolygonRoi(coordinates[0], coordinates[1],
String points = polyline.getPoints(); int[][] coordinates = parsePoints(points); roi = new PolygonRoi(coordinates[0], coordinates[1],