本文整理匯總了Java中com.google.android.gms.maps.model.PolygonOptions.strokeWidth方法的典型用法代碼示例。如果您正苦於以下問題:Java PolygonOptions.strokeWidth方法的具體用法?Java PolygonOptions.strokeWidth怎麽用?Java PolygonOptions.strokeWidth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.android.gms.maps.model.PolygonOptions
的用法示例。
在下文中一共展示了PolygonOptions.strokeWidth方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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: 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);
}
示例6: 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;
}
示例7: 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);
}
示例8: 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;
}
示例9: 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;
}
示例10: 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);
}
}
示例11: 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);
}
示例12: drawField
import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
/**
* 戦場1つを描畫する
*/
private void drawField(Field field) {
// マーカー定義
MarkerOptions markerOptions = new MarkerOptions();
markerOptions.title(field.getName()); // 名前を設定
markerOptions.snippet(field.getMemo()); // 説明を設定
markerOptions.position(calcCenter(field.getVertexes())); // マーカーの座標を設定(區畫の中心を自動算出)
markerOptions.icon(BitmapDescriptorFactory.defaultMarker(field.getColorHue())); // 色を設定
// マップにマーカーを追加
mGoogleMap.addMarker(markerOptions);
// 區畫を描畫
final LatLng[] vertexes = field.getVertexes();
if (vertexes != null && vertexes.length > 3) {
// ポリゴン定義
PolygonOptions polygonOptions = new PolygonOptions();
// RGBそれぞれの色を作成
final int[] colorRgb = field.getColorRgb();
int colorRed = colorRgb[0];
int colorGreen = colorRgb[1];
int colorBlue = colorRgb[2];
// 區畫の輪郭について設定
polygonOptions.strokeColor(Color.argb(0x255, colorRed, colorGreen, colorBlue));
polygonOptions.strokeWidth(5);
// 區畫の塗りつぶしについて設定
polygonOptions.fillColor(Color.argb(0x40, colorRed, colorGreen, colorBlue));
// 各頂點の座標を設定
polygonOptions.add(vertexes); // LatLngでもLatLng[]でもOK
// マップにポリゴンを追加
mGoogleMap.addPolygon(polygonOptions);
}
}
示例13: createPolygon
import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
/**
* Create polygon
* @param args
* @param callbackContext
* @throws JSONException
*/
@SuppressWarnings("unused")
private void createPolygon(final JSONArray args, final CallbackContext callbackContext) throws JSONException {
final PolygonOptions polygonOptions = new PolygonOptions();
int color;
LatLngBounds.Builder builder = new LatLngBounds.Builder();
JSONObject opts = args.getJSONObject(1);
if (opts.has("points")) {
JSONArray points = opts.getJSONArray("points");
List<LatLng> path = PluginUtil.JSONArray2LatLngList(points);
int i = 0;
for (i = 0; i < path.size(); i++) {
polygonOptions.add(path.get(i));
builder.include(path.get(i));
}
}
if (opts.has("strokeColor")) {
color = PluginUtil.parsePluginColor(opts.getJSONArray("strokeColor"));
polygonOptions.strokeColor(color);
}
if (opts.has("fillColor")) {
color = PluginUtil.parsePluginColor(opts.getJSONArray("fillColor"));
polygonOptions.fillColor(color);
}
if (opts.has("strokeWidth")) {
polygonOptions.strokeWidth(opts.getInt("strokeWidth") * this.density);
}
if (opts.has("visible")) {
polygonOptions.visible(opts.getBoolean("visible"));
}
if (opts.has("geodesic")) {
polygonOptions.geodesic(opts.getBoolean("geodesic"));
}
if (opts.has("zIndex")) {
polygonOptions.zIndex(opts.getInt("zIndex"));
}
Polygon polygon = map.addPolygon(polygonOptions);
String id = "polygon_"+ polygon.getId();
this.objects.put(id, polygon);
String boundsId = "polygon_bounds_" + polygon.getId();
this.objects.put(boundsId, builder.build());
JSONObject result = new JSONObject();
result.put("hashCode", polygon.hashCode());
result.put("id", id);
callbackContext.success(result);
}