本文整理匯總了Java中com.google.android.gms.maps.model.PolygonOptions.strokeColor方法的典型用法代碼示例。如果您正苦於以下問題:Java PolygonOptions.strokeColor方法的具體用法?Java PolygonOptions.strokeColor怎麽用?Java PolygonOptions.strokeColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.android.gms.maps.model.PolygonOptions
的用法示例。
在下文中一共展示了PolygonOptions.strokeColor方法的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: 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);
}
}
示例7: 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);
}
示例8: 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;
}
示例9: 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);
}
示例10: 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));
}
}
示例11: 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;
}
示例12: 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;
}
示例13: 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);
}
}
}
示例14: 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;
}
示例15: createPolygonOptions
import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
/**
*Creates a new PolygonOption from given properties of an existing PolygonOption
* @param originalPolygonOption An existing PolygonOption instance
* @param isFill Whether the fill for a polygon is set
* @param isOutline Whether the outline for a polygon is set
* @return A new PolygonOption
*/
private static PolygonOptions createPolygonOptions (PolygonOptions originalPolygonOption,
boolean isFill, boolean isOutline) {
PolygonOptions polygonOptions = new PolygonOptions();
if (isFill) {
polygonOptions.fillColor(originalPolygonOption.getFillColor());
}
if (isOutline) {
polygonOptions.strokeColor(originalPolygonOption.getStrokeColor());
polygonOptions.strokeWidth(originalPolygonOption.getStrokeWidth());
}
return polygonOptions;
}