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


Java LatLonPoint.getLongitude方法代码示例

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


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

示例1: onItemClick

import com.amap.api.services.core.LatLonPoint; //导入方法依赖的package包/类
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    LatLonPoint ll = list.get(position).getLatLonPoint();
    double a = ll.getLatitude();
    double b = ll.getLongitude();
    aMap.moveCamera(CameraUpdateFactory.changeLatLng(new LatLng(a, b)));

}
 
开发者ID:jiangzehui,项目名称:xmpp,代码行数:9,代码来源:LocationActivity.java

示例2: calAngle

import com.amap.api.services.core.LatLonPoint; //导入方法依赖的package包/类
/**
 * 将短距离的经纬度视为平面坐标
 * 计算两点之间的角度 Y坐标为上(北)方向 X坐标向右
 *
 * @param coo      中心点坐标
 * @param position 要计算的点的坐标
 * @return
 */
private float calAngle(LatLonPoint coo, LatLonPoint position) {
    final double y0 = coo.getLatitude();
    final double x0 = coo.getLongitude();
    final double evX = position.getLongitude();
    final double evY = position.getLatitude();
    final double L = Math.sqrt((evX - x0) * (evX - x0) + (evY - y0) * (evY - y0));
    double Lsin = Math.abs(evX - x0);
    float asin0 = radiansToDegrees((float) Math.asin(Lsin / L));
    asin0 = evY < y0 ? 180 - asin0 : asin0;
    asin0 = evX < x0 ? 360 - asin0 : asin0;
    return asin0;

}
 
开发者ID:macouen,项目名称:CameraPOI,代码行数:22,代码来源:CameraActivity.java

示例3: onRegecodeCallback

import com.amap.api.services.core.LatLonPoint; //导入方法依赖的package包/类
@Override
    public void onRegecodeCallback(List<PoiItem> poiItems) {


//        for(int i = 0; i< poiItems.size(); i++){
//            LatLonPoint point = poiItems.get(i).getLatLonPoint();
//            String address = poiItems.get(i).getSnippet();
//            String title = poiItems.get(i).getTitle();
//
//        }
        this.poiItems = poiItems;

        //刷新底部栏ui
        if (poiItems != null && poiItems.size() > 0) {
            PoiItem item = poiItems.get(0);
            String address = item.getSnippet();
            LatLonPoint point = item.getLatLonPoint();
            LatLng xlatLng = null;
            if (!TextUtils.isEmpty(address)) {
                address_locate.setText(address);
            }
            if (point != null) {
                xlatLng = new LatLng(point.getLatitude(), point.getLongitude());
            }

            //显示没网时匿掉的view
            showTextViews(true);

            //判断是否在范围内
            List<LatLng> list = new ArrayList<>();
            list.add(mStartPosition);
            judgeCode = LocateLogic.getIns(GdmapTestLocateActivity.this).isWithinGroup(mSettedPosition, list, distance);

            if (judgeCode == Const.WITHIN_AREA) {
                if(!TextUtils.isEmpty(judgement)){
                    within_area.setText("("+judgement+")");
                }else {
                    within_area.setText(getString(R.string.within_area));
                }

            } else {
                if(!TextUtils.isEmpty(nonjudgement)){
                    within_area.setText("("+nonjudgement+")");
                }else {
                    within_area.setText(getString(R.string.without_area));
                }
                within_area.setTextColor(getResources().getColor(R.color.map_cc0000));
            }


//            if(LocateLogic.getIns(GdmapTestLocateActivity.this).isWithin(xlatLng,mSettedPosition , distance)){
//                within_area.setText(getString(R.string.within_area));
//            }else {
//                within_area.setText(getString(R.string.without_area));
//                within_area.setTextColor(getResources().getColor(R.color.map_cc0000));
//            }
        }

    }
 
开发者ID:larrySmile02,项目名称:MultipleViewMap,代码行数:60,代码来源:GdmapTestLocateActivity.java

示例4: convertToLatLng

import com.amap.api.services.core.LatLonPoint; //导入方法依赖的package包/类
public static LatLng convertToLatLng(LatLonPoint latLonPoint){
    return new LatLng(latLonPoint.getLatitude(),latLonPoint.getLongitude());
}
 
开发者ID:yimiaoxiehou,项目名称:ZhuHaiBusApplication,代码行数:4,代码来源:AMapUtil.java

示例5: convertToLatLng

import com.amap.api.services.core.LatLonPoint; //导入方法依赖的package包/类
/**
 * 把LatLonPoint对象转化为LatLon对象
 */
public static LatLng convertToLatLng(LatLonPoint latLonPoint) {
	return new LatLng(latLonPoint.getLatitude(), latLonPoint.getLongitude());
}
 
开发者ID:Tsroad,项目名称:Road,代码行数:7,代码来源:AMapUtil.java

示例6: onBusRouteSearched

import com.amap.api.services.core.LatLonPoint; //导入方法依赖的package包/类
@Override
public void onBusRouteSearched(BusRouteResult result, int rCode) {
	ProgressDismiss();
	if (rCode == 0) {
		if (result != null && result.getPaths() != null
				&& result.getPaths().size() > 0) {
			busRouteResult = result;
			StorageData(startstr, endstr);
			BusPath busPath = busRouteResult.getPaths().get(0);
			LatLonPoint tr_start = busRouteResult.getStartPos();
			LatLonPoint tr_end = busRouteResult.getTargetPos();

			double tr_latitude_start = tr_start.getLatitude();
			double tr_longitude_start = tr_start.getLongitude();

			double tr_latitude_end = tr_end.getLatitude();
			double tr_longitude_end = tr_end.getLongitude();
			// 发送消息
			Intent tr_Intent = new Intent();
			Bundle tr_Bundle = new Bundle();
			tr_Bundle.putParcelable(StaticData.BUS_PATH, busPath);
			tr_Bundle.putDouble(StaticData.START_LATITUDE,
					tr_latitude_start);
			tr_Bundle.putDouble(StaticData.START_LONGITUDE,
					tr_longitude_start);
			tr_Bundle.putDouble(StaticData.END_LATITUDE, tr_latitude_end);
			tr_Bundle.putDouble(StaticData.END_LONGITUDE, tr_longitude_end);

			tr_Intent.putExtras(tr_Bundle);

			setResult(StaticData.BUS_OK, tr_Intent);
			finish();

		} else {
			ToastShow("未搜索到结果");
		}
	} else if (rCode == 27) {
		ToastShow("网络错误");
	} else if (rCode == 32) {
		ToastShow("key不存在");
	} else {
		ToastShow("其他错误");
	}
}
 
开发者ID:jp1017,项目名称:SmallDogAssistant,代码行数:45,代码来源:NavigationAty.java

示例7: onDriveRouteSearched

import com.amap.api.services.core.LatLonPoint; //导入方法依赖的package包/类
@Override
public void onDriveRouteSearched(DriveRouteResult result, int rCode) {
	ProgressDismiss();
	if (rCode == 0) {
		if (result != null && result.getPaths() != null
				&& result.getPaths().size() > 0) {
			driveRouteResult = result;
			StorageData(startstr, endstr);
			DrivePath drivePath = driveRouteResult.getPaths().get(0);
			// 发送消息
			LatLonPoint tr_start = driveRouteResult.getStartPos();
			LatLonPoint tr_end = driveRouteResult.getTargetPos();

			double tr_latitude_start = tr_start.getLatitude();
			double tr_longitude_start = tr_start.getLongitude();

			double tr_latitude_end = tr_end.getLatitude();
			double tr_longitude_end = tr_end.getLongitude();
			// 发送消息
			Intent tr_Intent = new Intent();
			Bundle tr_Bundle = new Bundle();
			tr_Bundle.putParcelable(StaticData.CAR_PATH, drivePath);
			tr_Bundle.putDouble(StaticData.START_LATITUDE,
					tr_latitude_start);
			tr_Bundle.putDouble(StaticData.START_LONGITUDE,
					tr_longitude_start);
			tr_Bundle.putDouble(StaticData.END_LATITUDE, tr_latitude_end);
			tr_Bundle.putDouble(StaticData.END_LONGITUDE, tr_longitude_end);

			tr_Intent.putExtras(tr_Bundle);

			setResult(StaticData.CAR_OK, tr_Intent);
			finish();
		} else {
			ToastShow("未搜索到结果");
		}
	} else if (rCode == 27) {
		ToastShow("网络错误");
	} else if (rCode == 32) {
		ToastShow("key不存在");
	} else {
		ToastShow("其他错误");
	}
}
 
开发者ID:jp1017,项目名称:SmallDogAssistant,代码行数:45,代码来源:NavigationAty.java

示例8: onWalkRouteSearched

import com.amap.api.services.core.LatLonPoint; //导入方法依赖的package包/类
@Override
public void onWalkRouteSearched(WalkRouteResult result, int rCode) {
	ProgressDismiss();
	if (rCode == 0) {
		if (result != null && result.getPaths() != null
				&& result.getPaths().size() > 0) {
			walkRouteResult = result;
			StorageData(startstr, endstr);
			WalkPath walkPath = walkRouteResult.getPaths().get(0);
			// 发送消息
			LatLonPoint tr_start = walkRouteResult.getStartPos();
			LatLonPoint tr_end = walkRouteResult.getTargetPos();

			double tr_latitude_start = tr_start.getLatitude();
			double tr_longitude_start = tr_start.getLongitude();

			double tr_latitude_end = tr_end.getLatitude();
			double tr_longitude_end = tr_end.getLongitude();
			// 发送消息
			Intent tr_Intent = new Intent();
			Bundle tr_Bundle = new Bundle();
			tr_Bundle.putParcelable(StaticData.WALK_PATH, walkPath);
			tr_Bundle.putDouble(StaticData.START_LATITUDE,
					tr_latitude_start);
			tr_Bundle.putDouble(StaticData.START_LONGITUDE,
					tr_longitude_start);
			tr_Bundle.putDouble(StaticData.END_LATITUDE, tr_latitude_end);
			tr_Bundle.putDouble(StaticData.END_LONGITUDE, tr_longitude_end);

			tr_Intent.putExtras(tr_Bundle);

			setResult(StaticData.WALK_OK, tr_Intent);
			finish();
		} else {
			ToastShow("未搜索到结果");
		}
	} else if (rCode == 27) {
		ToastShow("网络错误");
	} else if (rCode == 32) {
		ToastShow("key不存在");
	} else {
		ToastShow("其他错误");
	}
}
 
开发者ID:jp1017,项目名称:SmallDogAssistant,代码行数:45,代码来源:NavigationAty.java


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