本文整理匯總了Java中com.google.android.gms.maps.model.PolygonOptions.visible方法的典型用法代碼示例。如果您正苦於以下問題:Java PolygonOptions.visible方法的具體用法?Java PolygonOptions.visible怎麽用?Java PolygonOptions.visible使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.android.gms.maps.model.PolygonOptions
的用法示例。
在下文中一共展示了PolygonOptions.visible方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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);
}
示例3: 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;
}
示例4: polygonsReady
import com.google.android.gms.maps.model.PolygonOptions; //導入方法依賴的package包/類
private void polygonsReady() {
Log.d(TAG, "adding " + polygonOptions.size() + " polygons to map");
polygons = new ArrayList<Polygon>(polygonOptions.size());
for (PolygonOptions polygon : polygonOptions) {
polygon.visible(isVisible());
polygons.add(map.addPolygon(polygon));
}
Log.d(TAG, "polygons added to map");
}
示例5: 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);
}