polygon.setVisible(isVisible); if (hasDrawOrder) { polygon.setZIndex(drawOrder);
@Override public void setVisible(boolean visible) { polygon.setVisible(visible); }
@Override public void setVisible(boolean visible) { real.setVisible(visible); }
/** * Adds a single geometry object to the map with its specified style * * @param geometry defines the type of object to add to the map * @param style defines styling properties to add to the object when added to the map * @return the object that was added to the map, this is a Marker, Polyline, Polygon or an array * of either objects */ private Object addToMap(KmlPlacemark placemark, KmlGeometry geometry, KmlStyle style, KmlStyle inlineStyle, boolean isVisible) { String geometryType = geometry.getGeometryType(); if (geometryType.equals("Point")) { Marker marker = addPointToMap(placemark, (KmlPoint) geometry, style, inlineStyle); marker.setVisible(isVisible); return marker; } else if (geometryType.equals("LineString")) { Polyline polyline = addLineStringToMap((KmlLineString) geometry, style, inlineStyle); polyline.setVisible(isVisible); return polyline; } else if (geometryType.equals("Polygon")) { Polygon polygon = addPolygonToMap((KmlPolygon) geometry, style, inlineStyle); polygon.setVisible(isVisible); return polygon; } else if (geometryType.equals("MultiGeometry")) { return addMultiGeometryToMap(placemark, (KmlMultiGeometry) geometry, style, inlineStyle, isVisible); } return null; }
@Test public void testDelegateMethods() throws Exception { // Given Polygon polygon = mock(Polygon.class); PolygonAdapter polygonAdapter = new PolygonAdapter(polygon); // When polygonAdapter.setVisible(true); polygonAdapter.setHoles(Collections.<List<LatLng>>emptyList()); polygonAdapter.getPoints(); polygonAdapter.remove(); // Then verify(polygon).setVisible(eq(true)); verify(polygon).setHoles(anyList()); verify(polygon).getPoints(); verify(polygon).remove(); }