本文整理匯總了Java中com.google.android.gms.maps.model.Polygon.getId方法的典型用法代碼示例。如果您正苦於以下問題:Java Polygon.getId方法的具體用法?Java Polygon.getId怎麽用?Java Polygon.getId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.android.gms.maps.model.Polygon
的用法示例。
在下文中一共展示了Polygon.getId方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: remove
import com.google.android.gms.maps.model.Polygon; //導入方法依賴的package包/類
/**
* Remove the polygon
* @param args
* @param callbackContext
* @throws JSONException
*/
@SuppressWarnings("unused")
private void remove(final JSONArray args, final CallbackContext callbackContext) throws JSONException {
String id = args.getString(1);
Polygon polygon = this.getPolygon(id);
if (polygon == null) {
this.sendNoResult(callbackContext);
return;
}
this.objects.remove(id);
id = "polygon_bounds_" + polygon.getId();
this.objects.remove(id);
polygon.remove();
this.sendNoResult(callbackContext);
}
示例2: remove
import com.google.android.gms.maps.model.Polygon; //導入方法依賴的package包/類
/**
* Remove the polygon
* @param args
* @param callbackContext
* @throws JSONException
*/
@SuppressWarnings("unused")
private void remove(final JSONArray args, final CallbackContext callbackContext) throws JSONException {
String id = args.getString(1);
Polygon polygon = this.getPolygon(id);
if (polygon == null) {
this.sendNoResult(callbackContext);
return;
}
this.objects.remove(id);
id = "polygon_bounds_" + polygon.getId();
this.objects.remove(id);
polygon.remove();
this.sendNoResult(callbackContext);
}
示例3: onPolygonClick
import com.google.android.gms.maps.model.Polygon; //導入方法依賴的package包/類
private void onPolygonClick(Polygon polygon, LatLng point) {
String overlayId = "polygon_" + polygon.getId();
this.onOverlayEvent("overlay_click", overlayId, point);
}
示例4: createPolygon
import com.google.android.gms.maps.model.Polygon; //導入方法依賴的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);
}