本文整理匯總了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;
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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 ;
}
示例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;
}