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


Java Circle.getRadius方法代碼示例

本文整理匯總了Java中com.google.android.gms.maps.model.Circle.getRadius方法的典型用法代碼示例。如果您正苦於以下問題:Java Circle.getRadius方法的具體用法?Java Circle.getRadius怎麽用?Java Circle.getRadius使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.android.gms.maps.model.Circle的用法示例。


在下文中一共展示了Circle.getRadius方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isCircleContains

import com.google.android.gms.maps.model.Circle; //導入方法依賴的package包/類
/**
 * Check if a circle contains a point
 * @param circle
 * @param point
 */
private boolean isCircleContains(Circle circle, LatLng point) {
  double r = circle.getRadius();
  LatLng center = circle.getCenter();
  double cX = center.latitude;
  double cY = center.longitude;
  double pX = point.latitude;
  double pY = point.longitude;

  float[] results = new float[1];

  Location.distanceBetween(cX, cY, pX, pY, results);

  if(results[0] < r) {
    return true;
  } else {
    return false;
  }
}
 
開發者ID:AdrianBZG,項目名稱:PhoneChat,代碼行數:24,代碼來源:GoogleMaps.java

示例2: isCircleContains

import com.google.android.gms.maps.model.Circle; //導入方法依賴的package包/類
/**
 * Check if a circle contains a point
 * @param circle
 * @param point
 */
private boolean isCircleContains(Circle circle, LatLng point) {
  double r = circle.getRadius();
  LatLng center = circle.getCenter();
  double cX = center.latitude;
  double cY = center.longitude;
  double pX = point.latitude;
  double pY = point.longitude;
  
  float[] results = new float[1];
  
  Location.distanceBetween(cX, cY, pX, pY, results);
  
  if(results[0] < r) {
    return true;
  } else {
    return false;
  }
}
 
開發者ID:neo4art,項目名稱:neo4art,代碼行數:24,代碼來源:GoogleMaps.java

示例3: getZoomLevel

import com.google.android.gms.maps.model.Circle; //導入方法依賴的package包/類
/**
 * Manipulates the map once available.
 * This callback is triggered when the map is ready to be used.
 * This is where we can add markers or lines, add listeners or move the camera. In this case,
 * we just add a marker near Sydney, Australia.
 * If Google Play services is not installed on the device, the user will be prompted to install
 * it inside the SupportMapFragment. This method will only be triggered once the user has
 * installed Google Play services and returned to the app.
 */

public int getZoomLevel(Circle circle) {
    int zoomlevel = 11;
    if (circle != null) {
        double radius = circle.getRadius() + circle.getRadius() / 2;
        double scale = radius / 500;
        zoomlevel = (int) (16 - Math.log(scale) / Math.log(2));
    }
    return zoomlevel;
}
 
開發者ID:jamesgeorge007,項目名稱:TrackIn-Android-Application,代碼行數:20,代碼來源:GPSActivity.java

示例4: getZoomLevel

import com.google.android.gms.maps.model.Circle; //導入方法依賴的package包/類
public int getZoomLevel(Circle circle)
{
    int zoomlevel=11;
    if(circle!=null)
    {
        double radius=circle.getRadius() + circle.getRadius()/2;
        double scale=radius/500;
        zoomlevel=(int) (16-Math.log(scale)/Math.log(2));
    }
    return zoomlevel;
}
 
開發者ID:jamesgeorge007,項目名稱:TrackIn-Android-Application,代碼行數:12,代碼來源:cordmap.java

示例5: getZoomLevel

import com.google.android.gms.maps.model.Circle; //導入方法依賴的package包/類
/**
 * Manipulates the map once available.
 * This callback is triggered when the map is ready to be used.
 * This is where we can add markers or lines, add listeners or move the camera. In this case,
 * we just add a marker near Sydney, Australia.
 * If Google Play services is not installed on the device, the user will be prompted to install
 * it inside the SupportMapFragment. This method will only be triggered once the user has
 * installed Google Play services and returned to the app.
 */
public int getZoomLevel(Circle circle)
{
    int zoomlevel=11;
    if(circle!=null)
    {
        double radius=circle.getRadius() + circle.getRadius()/2;
        double scale=radius/500;
        zoomlevel=(int) (16-Math.log(scale)/Math.log(2));
    }
    return zoomlevel;
}
 
開發者ID:jamesgeorge007,項目名稱:TrackIn-Android-Application,代碼行數:21,代碼來源:addmap.java

示例6: getZoomLevel

import com.google.android.gms.maps.model.Circle; //導入方法依賴的package包/類
public int getZoomLevel(Circle circle)
{
    int zoomLevel = 11;
    if (circle != null)
    {
        double radius = circle.getRadius();
        double scale = radius / 500;
        zoomLevel = (int) Math.floor((16 - Math.log(scale) / Math.log(2)));
    }
    return zoomLevel ;
}
 
開發者ID:SumeetMoray,項目名稱:Nearby-Shops-Distributor-Android-app,代碼行數:12,代碼來源:PickLocationActivity.java

示例7: getZoomLevel

import com.google.android.gms.maps.model.Circle; //導入方法依賴的package包/類
/**
 * Calculates the optimal zoom to apply to the maps' camera when drawing a geofence using circle
 * @param circle you want to zoom to
 * @return the best zoom level
 */
public static int getZoomLevel(Circle circle) {
    int zoomLevel = 11;
    if (circle != null) {
        double radius = circle.getRadius() + circle.getRadius() / 2;
        double scale = radius / 500;
        zoomLevel = (int) (15 - Math.log(scale) / Math.log(2));
    }
    return zoomLevel;
}
 
開發者ID:Accengage,項目名稱:accengage-android-sdk-samples,代碼行數:15,代碼來源:Utils.java


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