当前位置: 首页>>代码示例>>Java>>正文


Java CircleOptions.radius方法代码示例

本文整理汇总了Java中com.google.android.gms.maps.model.CircleOptions.radius方法的典型用法代码示例。如果您正苦于以下问题:Java CircleOptions.radius方法的具体用法?Java CircleOptions.radius怎么用?Java CircleOptions.radius使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.gms.maps.model.CircleOptions的用法示例。


在下文中一共展示了CircleOptions.radius方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: refreshAccuraryIndicator

import com.google.android.gms.maps.model.CircleOptions; //导入方法依赖的package包/类
private void refreshAccuraryIndicator(Location location) {
    if (mShowAccuracy) {
        // Accuracy circle marker
        if (mAccuracyCircle != null) {
            mAccuracyCircle.setCenter(new LatLng(location.getLatitude(), location.getLongitude()));
            mAccuracyCircle.setRadius(location.getAccuracy());
        } else if (mMap != null) {
            CircleOptions circleOptions = new CircleOptions().center(new LatLng(location.getLatitude(), location.getLongitude()));
            circleOptions.fillColor(getResources().getColor(R.color.accuracy_circle_fill_color));
            circleOptions.strokeColor(android.R.color.black);
            circleOptions.strokeWidth(1);
            circleOptions.radius(location.getAccuracy());
            circleOptions.zIndex(2f);
            mAccuracyCircle = mMap.addCircle(circleOptions);
        }
    } else {
        if (mAccuracyCircle != null) {
            mAccuracyCircle.remove();
            mAccuracyCircle = null;
        }
    }
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-android,代码行数:23,代码来源:EntryMapView.java

示例2: 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);
}
 
开发者ID:AdrianBZG,项目名称:PhoneChat,代码行数:46,代码来源:PluginCircle.java

示例3: 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);
}
 
开发者ID:tutsplus,项目名称:Android-GoogleMaps-Part1,代码行数:11,代码来源:MapFragment.java

示例4: 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);
}
 
开发者ID:oSoc14,项目名称:mv_geomarketing_android,代码行数:9,代码来源:MyGoogleMapHelper.java

示例5: 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);
}
 }
 
开发者ID:Arasthel,项目名称:AlmeriBus,代码行数:14,代码来源:CustomMapFragment.java


注:本文中的com.google.android.gms.maps.model.CircleOptions.radius方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。