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


Java PolygonOptions.fillColor方法代碼示例

本文整理匯總了Java中com.google.android.gms.maps.model.PolygonOptions.fillColor方法的典型用法代碼示例。如果您正苦於以下問題:Java PolygonOptions.fillColor方法的具體用法?Java PolygonOptions.fillColor怎麽用?Java PolygonOptions.fillColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.android.gms.maps.model.PolygonOptions的用法示例。


在下文中一共展示了PolygonOptions.fillColor方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setupDeelgebied

import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
public void setupDeelgebied(Deelgebied deelgebied) {
    if(!deelgebied.getCoordinates().isEmpty()) {
        PolygonOptions options = new PolygonOptions().addAll(deelgebied.getCoordinates());
        if(JappPreferences.getAreasColorEnabled()) {
            int alphaPercent = JappPreferences.getAreasColorAlpha();
            float alpha = ((float)(100 - alphaPercent))/100 * 255;
            options.fillColor(deelgebied.alphaled(Math.round(alpha)));
        } else {
            options.fillColor(Color.TRANSPARENT);
        }

        options.strokeColor(deelgebied.getColor());
        if(JappPreferences.getAreasEdgesEnabled()) {
            options.strokeWidth(JappPreferences.getAreasEdgesWidth());
        } else {
            options.strokeWidth(0);
        }
        options.visible(true);

        areas.put(deelgebied.getName(), jotiMap.addPolygon(options));
    }
}
 
開發者ID:RSDT,項目名稱:Japp16,代碼行數:23,代碼來源:JappMapFragment.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: setInlinePolygonStyle

import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
/**
 * Sets the inline polygon style by copying over the styles that have been set
 *
 * @param polygonOptions polygon options object to add inline styles to
 * @param inlineStyle    inline styles to apply
 */
private void setInlinePolygonStyle(PolygonOptions polygonOptions, KmlStyle inlineStyle) {
    PolygonOptions inlinePolygonOptions = inlineStyle.getPolygonOptions();
    if (inlineStyle.hasFill() && inlineStyle.isStyleSet("fillColor")) {
        polygonOptions.fillColor(inlinePolygonOptions.getFillColor());
    }
    if (inlineStyle.hasOutline()) {
        if (inlineStyle.isStyleSet("outlineColor")) {
            polygonOptions.strokeColor(inlinePolygonOptions.getStrokeColor());
        }
        if (inlineStyle.isStyleSet("width")) {
            polygonOptions.strokeWidth(inlinePolygonOptions.getStrokeWidth());
        }
    }
    if (inlineStyle.isPolyRandomColorMode()) {
        polygonOptions.fillColor(KmlStyle.computeRandomColor(inlinePolygonOptions.getFillColor()));
    }
}
 
開發者ID:josegury,項目名稱:AndroidMarkerClusteringMaps,代碼行數:24,代碼來源:KmlRenderer.java

示例4: redrawPolygons

import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
private void redrawPolygons(final GoogleMap map) {
  map.clear();

  for (final ParkingLot parkingLot : mResponse) {
    final PolygonOptions polygon = ParkingLots.getShape(parkingLot.getLotName());

    final float taken = parkingLot.getPercentFilled();
    if (taken < 0.75f) {
      polygon.fillColor(Colors.mask(0x80, Colors.GREEN_500));
    } else if (taken < 0.90f) {
      polygon.fillColor(Colors.mask(0x80, Colors.YELLOW_500));
    } else {
      polygon.fillColor(Colors.mask(0x80, Colors.RED_500));
    }

    polygon.strokeColor(parkingLot == mSelected
                            ? Colors.mask(0xFF, mPrimaryColor)
                            : Colors.mask(0xFF, Color.BLACK)
    );

    map.addPolygon(polygon);
  }
}
 
開發者ID:cdeange,項目名稱:uwaterloo-api,代碼行數:24,代碼來源:ParkingFragment.java

示例5: addPolygonToMapAsMarkers

import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
/**
 * Add a Polygon to the map as markers
 *
 * @param shapeMarkers
 * @param map
 * @param polygonOptions
 * @param polygonMarkerOptions
 * @param polygonMarkerHoleOptions
 * @param globalPolygonOptions
 * @return
 */
public PolygonMarkers addPolygonToMapAsMarkers(
        GoogleMapShapeMarkers shapeMarkers, GoogleMap map,
        PolygonOptions polygonOptions, MarkerOptions polygonMarkerOptions,
        MarkerOptions polygonMarkerHoleOptions,
        PolygonOptions globalPolygonOptions) {

    PolygonMarkers polygonMarkers = new PolygonMarkers(this);

    if (globalPolygonOptions != null) {
        polygonOptions.fillColor(globalPolygonOptions.getFillColor());
        polygonOptions.strokeColor(globalPolygonOptions.getStrokeColor());
        polygonOptions.geodesic(globalPolygonOptions.isGeodesic());
    }

    com.google.android.gms.maps.model.Polygon polygon = addPolygonToMap(
            map, polygonOptions);
    polygonMarkers.setPolygon(polygon);

    List<Marker> markers = addPointsToMapAsMarkers(map,
            polygon.getPoints(), polygonMarkerOptions, true);
    polygonMarkers.setMarkers(markers);

    for (List<LatLng> holes : polygon.getHoles()) {
        List<Marker> holeMarkers = addPointsToMapAsMarkers(map, holes,
                polygonMarkerHoleOptions, true);
        PolygonHoleMarkers polygonHoleMarkers = new PolygonHoleMarkers(
                polygonMarkers);
        polygonHoleMarkers.setMarkers(holeMarkers);
        shapeMarkers.add(polygonHoleMarkers);
        polygonMarkers.addHole(polygonHoleMarkers);
    }

    return polygonMarkers;
}
 
開發者ID:ngageoint,項目名稱:geopackage-android-map,代碼行數:46,代碼來源:GoogleMapShapeConverter.java

示例6: addCameraFootprint

import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
@Override
public void addCameraFootprint(FootPrint footprintToBeDraw) {
    PolygonOptions pathOptions = new PolygonOptions();
    pathOptions.strokeColor(FOOTPRINT_DEFAULT_COLOR).strokeWidth(FOOTPRINT_DEFAULT_WIDTH);
    pathOptions.fillColor(FOOTPRINT_FILL_COLOR);

    for (LatLong vertex : footprintToBeDraw.getVertexInGlobalFrame()) {
        pathOptions.add(MapUtils.coordToLatLng(vertex));
    }
    getMap().addPolygon(pathOptions);

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

示例7: 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

示例8: setPolygonOptions

import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
/**
 * Set the polygon options
 *
 * @param style          shape style
 * @param polygonOptions polygon options
 * @param visible        visible flag
 */
private void setPolygonOptions(ObservationShapeStyle style, PolygonOptions polygonOptions, boolean visible) {
    polygonOptions.strokeWidth(style.getStrokeWidth());
    polygonOptions.strokeColor(style.getStrokeColor());
    polygonOptions.fillColor(style.getFillColor());
    polygonOptions.visible(visible);
    polygonOptions.geodesic(MapShapeObservation.GEODESIC);
}
 
開發者ID:ngageoint,項目名稱:mage-android,代碼行數:15,代碼來源:MapObservationManager.java

示例9: getEditPolygonOptions

import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
/**
 * Get the edit polygon options
 *
 * @param style observation shape style
 * @return edit polygon options
 */
private PolygonOptions getEditPolygonOptions(ObservationShapeStyle style) {
    PolygonOptions polygonOptions = new PolygonOptions();
    polygonOptions.strokeWidth(style.getStrokeWidth());
    polygonOptions.strokeColor(style.getStrokeColor());
    polygonOptions.fillColor(style.getFillColor());
    polygonOptions.geodesic(MapShapeObservation.GEODESIC);
    return polygonOptions;
}
 
開發者ID:ngageoint,項目名稱:mage-android,代碼行數:15,代碼來源:LocationEditActivity.java

示例10: drawPolygon

import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
private void drawPolygon( LatLng startingLocation ) {
    LatLng point2 = new LatLng( startingLocation.latitude + .001, startingLocation.longitude );
    LatLng point3 = new LatLng( startingLocation.latitude, startingLocation.longitude + .001 );

    PolygonOptions options = new PolygonOptions();
    options.add(startingLocation, point2, point3);

    options.fillColor( getResources().getColor( R.color.fill_color ) );
    options.strokeColor( getResources().getColor( R.color.stroke_color ) );
    options.strokeWidth( 10 );

    getMap().addPolygon(options);
}
 
開發者ID:tutsplus,項目名稱:Android-GoogleMaps-Part1,代碼行數:14,代碼來源:MapFragment.java

示例11: setPolygonOptions

import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
/**
 * Set the Polygon Option attributes
 *
 * @param editable
 * @param polygonOptions
 */
private void setPolygonOptions(boolean editable,
                               PolygonOptions polygonOptions) {
    if (editable) {
        polygonOptions.strokeColor(ContextCompat.getColor(getActivity(), R.color.polygon_edit_color));
        polygonOptions.fillColor(ContextCompat.getColor(getActivity(), R.color.polygon_edit_fill_color));
    } else {
        polygonOptions.strokeColor(ContextCompat.getColor(getActivity(), R.color.polygon_color));
        polygonOptions.fillColor(ContextCompat.getColor(getActivity(), R.color.polygon_fill_color));
    }
}
 
開發者ID:ngageoint,項目名稱:geopackage-mapcache-android,代碼行數:17,代碼來源:GeoPackageMapFragment.java

示例12: getDrawPolygonOptions

import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
/**
 * Get draw polygon options
 *
 * @return
 */
private PolygonOptions getDrawPolygonOptions() {
    PolygonOptions polygonOptions = new PolygonOptions();
    polygonOptions.strokeColor(ContextCompat.getColor(getActivity(), R.color.polygon_draw_color));
    polygonOptions.fillColor(ContextCompat.getColor(getActivity(), R.color.polygon_draw_fill_color));
    return polygonOptions;
}
 
開發者ID:ngageoint,項目名稱:geopackage-mapcache-android,代碼行數:12,代碼來源:GeoPackageMapFragment.java

示例13: getHoleDrawPolygonOptions

import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
/**
 * Get hold draw polygon options
 *
 * @return
 */
private PolygonOptions getHoleDrawPolygonOptions() {
    PolygonOptions polygonOptions = new PolygonOptions();
    polygonOptions.strokeColor(ContextCompat.getColor(getActivity(), R.color.polygon_hole_draw_color));
    polygonOptions.fillColor(ContextCompat.getColor(getActivity(), R.color.polygon_hole_draw_fill_color));
    return polygonOptions;
}
 
開發者ID:ngageoint,項目名稱:geopackage-mapcache-android,代碼行數:12,代碼來源:GeoPackageMapFragment.java

示例14: 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

示例15: toPolygonOptions

import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
/**
 * Gets a new PolygonOptions object containing styles for the GeoJsonPolygon
 *
 * @return new PolygonOptions object
 */
public PolygonOptions toPolygonOptions() {
    PolygonOptions polygonOptions = new PolygonOptions();
    polygonOptions.fillColor(mPolygonOptions.getFillColor());
    polygonOptions.geodesic(mPolygonOptions.isGeodesic());
    polygonOptions.strokeColor(mPolygonOptions.getStrokeColor());
    polygonOptions.strokeWidth(mPolygonOptions.getStrokeWidth());
    polygonOptions.visible(mPolygonOptions.isVisible());
    polygonOptions.zIndex(mPolygonOptions.getZIndex());
    return polygonOptions;
}
 
開發者ID:josegury,項目名稱:AndroidMarkerClusteringMaps,代碼行數:16,代碼來源:GeoJsonPolygonStyle.java


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