本文整理匯總了Java中com.google.android.gms.maps.model.CircleOptions.center方法的典型用法代碼示例。如果您正苦於以下問題:Java CircleOptions.center方法的具體用法?Java CircleOptions.center怎麽用?Java CircleOptions.center使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.android.gms.maps.model.CircleOptions
的用法示例。
在下文中一共展示了CircleOptions.center方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createCircle
import com.google.android.gms.maps.model.CircleOptions; //導入方法依賴的package包/類
/**
* Create circle
* @param args
* @param callbackContext
* @throws JSONException
*/
@SuppressWarnings("unused")
private void createCircle(final JSONArray args, final CallbackContext callbackContext) throws JSONException {
final CircleOptions circleOptions = new CircleOptions();
int color;
JSONObject opts = args.getJSONObject(1);
if (opts.has("center")) {
JSONObject center = opts.getJSONObject("center");
circleOptions.center(new LatLng(center.getDouble("lat"), center.getDouble("lng")));
}
if (opts.has("radius")) {
circleOptions.radius(opts.getDouble("radius"));
}
if (opts.has("strokeColor")) {
color = PluginUtil.parsePluginColor(opts.getJSONArray("strokeColor"));
circleOptions.strokeColor(color);
}
if (opts.has("fillColor")) {
color = PluginUtil.parsePluginColor(opts.getJSONArray("fillColor"));
circleOptions.fillColor(color);
}
if (opts.has("strokeWidth")) {
circleOptions.strokeWidth(opts.getInt("strokeWidth") * this.density);
}
if (opts.has("visible")) {
circleOptions.visible(opts.getBoolean("visible"));
}
if (opts.has("zIndex")) {
circleOptions.zIndex(opts.getInt("zIndex"));
}
Circle circle = map.addCircle(circleOptions);
String id = "circle_" + circle.getId();
this.objects.put(id, circle);
JSONObject result = new JSONObject();
result.put("hashCode", circle.hashCode());
result.put("id", id);
callbackContext.success(result);
}
示例2: drawCircle
import com.google.android.gms.maps.model.CircleOptions; //導入方法依賴的package包/類
private void drawCircle( LatLng location ) {
CircleOptions options = new CircleOptions();
options.center( location );
//Radius in meters
options.radius( 10 );
options.fillColor( getResources().getColor( R.color.fill_color ) );
options.strokeColor( getResources().getColor( R.color.stroke_color ) );
options.strokeWidth( 10 );
getMap().addCircle(options);
}
示例3: drawCircle
import com.google.android.gms.maps.model.CircleOptions; //導入方法依賴的package包/類
public void drawCircle() {
final CircleOptions circleOptions = new CircleOptions();
circleOptions.center(myDummyLocation);
circleOptions.radius(350);
circleOptions.strokeColor(R.drawable.purple);
circleOptions.fillColor(R.drawable.purple);
final Circle circle = googleMap.addCircle(circleOptions);
}
示例4: dibujarDistancia
import com.google.android.gms.maps.model.CircleOptions; //導入方法依賴的package包/類
public void dibujarDistancia() {
if(getMap() != null && getMap().isMyLocationEnabled() && getMap().getMyLocation() != null) {
CircleOptions dOptions = new CircleOptions();
dOptions.center(new LatLng(getMap().getMyLocation().getLatitude(), getMap().getMyLocation().getLongitude()));
dOptions.radius(DataStorage.filtro.getDistancia());
dOptions.strokeColor(0xFFFF0000);
dOptions.fillColor(0x22FF0000);
if(distanciaCirculo != null) {
distanciaCirculo.remove();
}
distanciaCirculo = getMap().addCircle(dOptions);
}
}