本文整理汇总了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));
}
}
示例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: 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()));
}
}
示例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);
}
}
示例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;
}
示例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);
}
示例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);
}
}
示例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);
}
示例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;
}
示例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);
}
示例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));
}
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例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;
}