當前位置: 首頁>>代碼示例>>Java>>正文


Java PolygonOptions.addAll方法代碼示例

本文整理匯總了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));
    }

}
 
開發者ID:mxiao6,項目名稱:Tower-develop,代碼行數:25,代碼來源:GoogleMapFragment.java

示例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);
    }
}
 
開發者ID:davidcampelo,項目名稱:PublicOpenSpaceToolApp,代碼行數:17,代碼來源:ProjectAddEditFragment.java

示例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));
    }

}
 
開發者ID:sommishra,項目名稱:DroidPlanner-Tower,代碼行數:20,代碼來源:GoogleMapFragment.java

示例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);
    }

}
 
開發者ID:davidcampelo,項目名稱:PublicOpenSpaceToolApp,代碼行數:39,代碼來源:PublicOpenSpaceAddEditFragment.java

示例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);
        }
    }
}
 
開發者ID:ngageoint,項目名稱:geopackage-mapcache-android,代碼行數:16,代碼來源:GeoPackageMapFragment.java

示例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);
}
 
開發者ID:josegury,項目名稱:AndroidMarkerClusteringMaps,代碼行數:19,代碼來源:GeoJsonRenderer.java

示例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);
}
 
開發者ID:josegury,項目名稱:AndroidMarkerClusteringMaps,代碼行數:21,代碼來源:KmlRenderer.java

示例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);
    }
}
 
開發者ID:ITsvetkoFF,項目名稱:Kv-009,代碼行數:14,代碼來源:MapClustering.java

示例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);
}
 
開發者ID:mukesh4u,項目名稱:GoogleMapsV2,代碼行數:9,代碼來源:MainActivity.java

示例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;
}
 
開發者ID:googlemaps,項目名稱:android-maps-utils,代碼行數:20,代碼來源:Renderer.java


注:本文中的com.google.android.gms.maps.model.PolygonOptions.addAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。