use of com.google.maps.android.data.geojson.GeoJsonPolygon in project android-maps-utils by googlemaps.
the class MultiGeometryTest method testGetGeometryType.
public void testGetGeometryType() throws Exception {
ArrayList<LineString> lineStrings = new ArrayList<>();
lineStrings.add(new LineString(new ArrayList<>(Arrays.asList(new LatLng(0, 0), new LatLng(50, 50)))));
lineStrings.add(new LineString(new ArrayList<>(Arrays.asList(new LatLng(56, 65), new LatLng(23, 23)))));
mg = new MultiGeometry(lineStrings);
assertEquals("MultiGeometry", mg.getGeometryType());
ArrayList<GeoJsonPolygon> polygons = new ArrayList<GeoJsonPolygon>();
ArrayList<ArrayList<LatLng>> polygon = new ArrayList<ArrayList<LatLng>>();
polygon.add(new ArrayList<LatLng>(Arrays.asList(new LatLng(0, 0), new LatLng(20, 20), new LatLng(60, 60), new LatLng(0, 0))));
polygons.add(new GeoJsonPolygon(polygon));
polygon = new ArrayList<ArrayList<LatLng>>();
polygon.add(new ArrayList<LatLng>(Arrays.asList(new LatLng(0, 0), new LatLng(50, 80), new LatLng(10, 15), new LatLng(0, 0))));
polygon.add(new ArrayList<LatLng>(Arrays.asList(new LatLng(0, 0), new LatLng(20, 20), new LatLng(60, 60), new LatLng(0, 0))));
polygons.add(new GeoJsonPolygon(polygon));
mg = new MultiGeometry(polygons);
assertEquals("MultiGeometry", mg.getGeometryType());
}
Aggregations