本文整理汇总了Java中com.amap.api.services.core.LatLonPoint.getLatitude方法的典型用法代码示例。如果您正苦于以下问题:Java LatLonPoint.getLatitude方法的具体用法?Java LatLonPoint.getLatitude怎么用?Java LatLonPoint.getLatitude使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.amap.api.services.core.LatLonPoint
的用法示例。
在下文中一共展示了LatLonPoint.getLatitude方法的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)));
}
示例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;
}
示例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));
// }
}
}
示例4: convertToLatLng
import com.amap.api.services.core.LatLonPoint; //导入方法依赖的package包/类
public static LatLng convertToLatLng(LatLonPoint latLonPoint){
return new LatLng(latLonPoint.getLatitude(),latLonPoint.getLongitude());
}
示例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());
}
示例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("其他错误");
}
}
示例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("其他错误");
}
}
示例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("其他错误");
}
}