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


Java GeoPoint.getLatitude方法代码示例

本文整理汇总了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);
}
 
开发者ID:CMPUT301F16T01,项目名称:Carrier,代码行数:29,代码来源:DriverViewRequestActivity.java

示例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);
}
 
开发者ID:CMPUT301F16T01,项目名称:Carrier,代码行数:29,代码来源:ViewLocationsActivity.java

示例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);
}
 
开发者ID:hamzux,项目名称:cosi,代码行数:22,代码来源:PlacesFragment.java

示例4: Vector2

import org.osmdroid.util.GeoPoint; //导入方法依赖的package包/类
public Vector2(GeoPoint begin, GeoPoint end) {
    X = end.getLatitude() - begin.getLatitude();
    Y = end.getLongitude() - begin.getLongitude();
}
 
开发者ID:LenaShervarly,项目名称:TreasureHunting,代码行数:5,代码来源:Vector2.java


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