本文整理匯總了Java中com.google.android.gms.maps.model.PolygonOptions.addAll方法的典型用法代碼示例。如果您正苦於以下問題:Java PolygonOptions.addAll方法的具體用法?Java PolygonOptions.addAll怎麽用?Java PolygonOptions.addAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.android.gms.maps.model.PolygonOptions
的用法示例。
在下文中一共展示了PolygonOptions.addAll方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updatePolygonsPaths
import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
@Override
public void updatePolygonsPaths(List<List<LatLong>> paths) {
GoogleMap map = getMap();
if (map == null) {
return;
}
for (Polygon poly : polygonsPaths) {
poly.remove();
}
for (List<LatLong> contour : paths) {
PolygonOptions pathOptions = new PolygonOptions();
pathOptions.strokeColor(POLYGONS_PATH_DEFAULT_COLOR).strokeWidth(
POLYGONS_PATH_DEFAULT_WIDTH);
final List<LatLng> pathPoints = new ArrayList<LatLng>(contour.size());
for (LatLong coord : contour) {
pathPoints.add(MapUtils.coordToLatLng(coord));
}
pathOptions.addAll(pathPoints);
polygonsPaths.add(map.addPolygon(pathOptions));
}
}
示例2: drawPolygon
import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
private void drawPolygon() {
googleMap.clear();
for (LatLng point : arrayPoints) {
googleMap.addMarker(new MarkerOptions().position(point));
}
if (arrayPoints.size() >= 3) {
PolygonOptions polygonOptions = new PolygonOptions();
polygonOptions.addAll(arrayPoints);
polygonOptions.strokeColor(Color.argb(0, 0, 0, 100));
polygonOptions.strokeWidth(7);
polygonOptions.fillColor(Color.argb(100, 0, 0, 100));
googleMap.addPolygon(polygonOptions);
}
}
示例3: updatePolygonsPaths
import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
@Override
public void updatePolygonsPaths(List<List<LatLong>> paths) {
for (Polygon poly : polygonsPaths) {
poly.remove();
}
for (List<LatLong> contour : paths) {
PolygonOptions pathOptions = new PolygonOptions();
pathOptions.strokeColor(POLYGONS_PATH_DEFAULT_COLOR).strokeWidth(
POLYGONS_PATH_DEFAULT_WIDTH);
final List<LatLng> pathPoints = new ArrayList<LatLng>(contour.size());
for (LatLong coord : contour) {
pathPoints.add(DroneHelper.CoordToLatLang(coord));
}
pathOptions.addAll(pathPoints);
polygonsPaths.add(getMap().addPolygon(pathOptions));
}
}
示例4: drawPolygon
import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
private void drawPolygon() {
googleMap.clear();
for (LatLng point : arrayPoints) {
googleMap.addMarker(new MarkerOptions().position(point));
}
if (arrayPoints.size() >= 3) {
PolygonOptions polygonOptions = new PolygonOptions();
polygonOptions.addAll(arrayPoints);
polygonOptions.strokeColor(Color.argb(0, 0, 0, 100));
polygonOptions.strokeWidth(7);
polygonOptions.fillColor(Color.argb(100, 0, 0, 100));
googleMap.addPolygon(polygonOptions);
}
// set question 3 (area) text
QuestionView questionView;
questionView = questionNumberToViewMap.get("03");
String area = "";
if (questionView != null) {
if (arrayPoints.size() >= 3) {
area = MapUtility.calculateAreaAndFormat(arrayPoints);
}
Log.e(this.getClass().getName(), "-------------------->>>> [AREA] from map to question = "+ area);
((InputDecimalQuestionView) questionView).setAnswers(area);
}
questionView = questionNumberToViewMap.get("05");
String centroid = "";
if (questionView != null) {
if (arrayPoints.size() >= 1) {
LatLng latLng = MapUtility.calculateCentroid(arrayPoints);
centroid = latLng.latitude +" "+ latLng.longitude;
}
Log.e(this.getClass().getName(), "-------------------->>>> [CENTROID] from map to question = "+ centroid);
((InputTextQuestionView) questionView).setAnswers(centroid);
}
}
示例5: loadTilesFinished
import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
/**
* When loading tiles is finished
*/
private void loadTilesFinished() {
if (active.isModified()) {
updateInBackground(false);
if (boundingBox != null) {
PolygonOptions polygonOptions = new PolygonOptions();
polygonOptions.fillColor(boundingBox.getFillColor());
polygonOptions.strokeColor(boundingBox.getStrokeColor());
polygonOptions.addAll(boundingBox.getPoints());
boundingBox = map.addPolygon(polygonOptions);
}
}
}
示例6: addPolygonToMap
import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
/**
* Adds a GeoJsonPolygon to the map as a Polygon
*
* @param polygonStyle contains relevant styling properties for the Polygon
* @param polygon contains coordinates for the Polygon
* @return Polygon object created from given GeoJsonPolygon
*/
private Polygon addPolygonToMap(GeoJsonPolygonStyle polygonStyle, GeoJsonPolygon polygon) {
PolygonOptions polygonOptions = polygonStyle.toPolygonOptions();
// First array of coordinates are the outline
polygonOptions.addAll(polygon.getCoordinates().get(POLYGON_OUTER_COORDINATE_INDEX));
// Following arrays are holes
for (int i = POLYGON_INNER_COORDINATE_INDEX; i < polygon.getCoordinates().size();
i++) {
polygonOptions.addHole(polygon.getCoordinates().get(i));
}
return mMap.addPolygon(polygonOptions);
}
示例7: addPolygonToMap
import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
/**
* Adds a KML Polygon to the map as a Polygon by combining the styling and coordinates
*
* @param polygon contains coordinates for the Polygon
* @param style contains relevant styling properties for the Polygon
* @return Polygon object
*/
private Polygon addPolygonToMap(KmlPolygon polygon, KmlStyle style, KmlStyle inlineStyle) {
PolygonOptions polygonOptions = style.getPolygonOptions();
polygonOptions.addAll(polygon.getOuterBoundaryCoordinates());
for (ArrayList<LatLng> innerBoundary : polygon.getInnerBoundaryCoordinates()) {
polygonOptions.addHole(innerBoundary);
}
if (inlineStyle != null) {
setInlinePolygonStyle(polygonOptions, inlineStyle);
} else if (style.isPolyRandomColorMode()) {
polygonOptions.fillColor(KmlStyle.computeRandomColor(polygonOptions.getFillColor()));
}
return mMap.addPolygon(polygonOptions);
}
示例8: countPolygonPoints
import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
private void countPolygonPoints() {
if (points.size() >= 3) {
PolygonOptions polygonOptions = new PolygonOptions();
polygonOptions.addAll(points);
polygonOptions.strokeColor(mContext.getResources().getColor(R.color.polygonEdges));
polygonOptions.strokeWidth(7);
polygonOptions.fillColor(mContext.getResources().getColor(R.color.polygon));
mMap.addPolygon(polygonOptions);
points.clear();
EcoMapFragment.setMarkerClickType(0);
mMap.setOnMarkerClickListener(mClusterManager);
}
}
示例9: Draw_Map
import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
public void Draw_Map() {
PolygonOptions rectOptions = new PolygonOptions();
rectOptions.addAll(latLang);
rectOptions.strokeColor(Color.BLUE);
rectOptions.fillColor(Color.CYAN);
rectOptions.strokeWidth(7);
polygon = googleMap.addPolygon(rectOptions);
}
示例10: addPolygonToMap
import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
/**
* Adds a DataPolygon to the map as a Polygon
*
* @param polygonOptions
* @param polygon contains coordinates for the Polygon
* @return Polygon object created from given DataPolygon
*/
protected Polygon addPolygonToMap(PolygonOptions polygonOptions, DataPolygon polygon) {
// First array of coordinates are the outline
polygonOptions.addAll(polygon.getOuterBoundaryCoordinates());
// Following arrays are holes
List<List<LatLng>> innerBoundaries = polygon.getInnerBoundaryCoordinates();
for (List<LatLng> innerBoundary : innerBoundaries) {
polygonOptions.addHole(innerBoundary);
}
Polygon addedPolygon = mMap.addPolygon(polygonOptions);
addedPolygon.setClickable(true);
return addedPolygon;
}