本文整理汇总了Java中org.osmdroid.util.GeoPoint.getLatitude方法的典型用法代码示例。如果您正苦于以下问题:Java GeoPoint.getLatitude方法的具体用法?Java GeoPoint.getLatitude怎么用?Java GeoPoint.getLatitude使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.osmdroid.util.GeoPoint
的用法示例。
在下文中一共展示了GeoPoint.getLatitude方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBoundingBox
import org.osmdroid.util.GeoPoint; //导入方法依赖的package包/类
/**
* This function finds a BoundingBox that fits both the start and end location points.
*
* @param start GeoPoint for start location
* @param end GeoPoint for end location
* @return BoundingBox that holds both location points
*/
private BoundingBox getBoundingBox(GeoPoint start, GeoPoint end) {
double north;
double south;
double east;
double west;
if(start.getLatitude() > end.getLatitude()) {
north = start.getLatitude();
south = end.getLatitude();
} else {
north = end.getLatitude();
south = start.getLatitude();
}
if(start.getLongitude() > end.getLongitude()) {
east = start.getLongitude();
west = end.getLongitude();
} else {
east = end.getLongitude();
west = start.getLongitude();
}
return new BoundingBox(north, east, south, west);
}
示例2: getBoundingBox
import org.osmdroid.util.GeoPoint; //导入方法依赖的package包/类
/**
* This function finds a BoundingBox that fits both the start and end location points.
*
* @param start GeoPoint for start location
* @param end GeoPoint for end location
* @return BoundingBox that holds both location points
*/
public BoundingBox getBoundingBox(GeoPoint start, GeoPoint end) {
double north;
double south;
double east;
double west;
if(start.getLatitude() > end.getLatitude()) {
north = start.getLatitude();
south = end.getLatitude();
} else {
north = end.getLatitude();
south = start.getLatitude();
}
if(start.getLongitude() > end.getLongitude()) {
east = start.getLongitude();
west = end.getLongitude();
} else {
east = end.getLongitude();
west = start.getLongitude();
}
return new BoundingBox(north, east, south, west);
}
示例3: setBoundingBox
import org.osmdroid.util.GeoPoint; //导入方法依赖的package包/类
private void setBoundingBox() {
double minLat = Integer.MAX_VALUE;
double maxLat = Integer.MIN_VALUE;
double minLong = Integer.MAX_VALUE;
double maxLong = Integer.MIN_VALUE;
for (OverlayItem item : placeMarkers) {
GeoPoint point = new GeoPoint(item.getPoint().getLatitude(), item.getPoint().getLongitude());
if (point.getLatitude() < minLat)
minLat = point.getLatitude();
if (point.getLatitude() > maxLat)
maxLat = point.getLatitude();
if (point.getLongitude() < minLong)
minLong = point.getLongitude();
if (point.getLongitude() > maxLong)
maxLong = point.getLongitude();
}
BoundingBox boundingBox = new BoundingBox(maxLat, maxLong, minLat, minLong);
map.zoomToBoundingBox(boundingBox, true);
}
示例4: Vector2
import org.osmdroid.util.GeoPoint; //导入方法依赖的package包/类
public Vector2(GeoPoint begin, GeoPoint end) {
X = end.getLatitude() - begin.getLatitude();
Y = end.getLongitude() - begin.getLongitude();
}