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


Java PolygonOptions.visible方法代碼示例

本文整理匯總了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));
    }
}
 
開發者ID:RSDT,項目名稱:Japp16,代碼行數:23,代碼來源:JappMapFragment.java

示例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);
}
 
開發者ID:ngageoint,項目名稱:mage-android,代碼行數:15,代碼來源:MapObservationManager.java

示例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;
}
 
開發者ID:josegury,項目名稱:AndroidMarkerClusteringMaps,代碼行數:16,代碼來源:GeoJsonPolygonStyle.java

示例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");
}
 
開發者ID:ngageoint,項目名稱:disconnected-content-explorer-android,代碼行數:10,代碼來源:OfflineMap.java

示例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);
}
 
開發者ID:neo4art,項目名稱:neo4art,代碼行數:56,代碼來源:PluginPolygon.java


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