Java Code Examples for com.amap.api.services.core.LatLonPoint#getLongitude()

The following examples show how to use com.amap.api.services.core.LatLonPoint#getLongitude() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AutoScheduleAssistFragment.java    From BetterWay with Apache License 2.0 5 votes vote down vote up
/**
 * 取得获得的坐标并移动地图到该坐标
 * @param latLonPoint 获得的坐标
 */
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
public void onLatLngPointEvent(LatLonPoint latLonPoint) {
    LogUtil.e(TAG, "moveToLatLngPoint()");
    mLatLng = new LatLng(latLonPoint.getLatitude(), latLonPoint.getLongitude());
    aMap.moveCamera(CameraUpdateFactory.changeLatLng(mLatLng));
}
 
Example 2
Source File: LocationActivity.java    From xmpp with Apache License 2.0 5 votes vote down vote up
@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)));

}
 
Example 3
Source File: AMapUtil.java    From TraceByAmap with MIT License 4 votes vote down vote up
/**
 * 把LatLonPoint对象转化为LatLon对象
 */
public static LatLng convertToLatLng(LatLonPoint latLonPoint) {
	return new LatLng(latLonPoint.getLatitude(), latLonPoint.getLongitude());
}
 
Example 4
Source File: TrafficActivity.java    From TraceByAmap with MIT License 4 votes vote down vote up
@Override
public void onRoadTrafficSearched(TrafficStatusResult roadTrafficResult, int errorCode) {
    Log.e("amap", "===>>>> result code " + errorCode);
    dissmissProgressDialog();// 隐藏对话框
    aMap.clear();
    LatLngBounds.Builder builder = new LatLngBounds.Builder();
    for(TrafficStatusInfo trafficStatusInfo : roadTrafficResult.getRoads()) {
        List<LatLonPoint> list = trafficStatusInfo.getCoordinates();
        if(list != null){
            LatLonPoint latLonPoint = list.get(0);

            aMap.addText(new TextOptions().position(new LatLng(latLonPoint.getLatitude(), latLonPoint.getLongitude())).text(trafficStatusInfo.getName() + " " + trafficStatusInfo.getDirection()));

            List<LatLng> latLngs = new ArrayList<LatLng>();
            for(LatLonPoint latLonPoint2 : list)
            {
                LatLng latLng = new LatLng(latLonPoint2.getLatitude(), latLonPoint2.getLongitude());
                builder.include(latLng);
                latLngs.add(latLng);
            }
            int color = Color.GREEN;
            switch (Integer.parseInt(trafficStatusInfo.getStatus())) {
                case 0: {
                    color = Color.GRAY;
                }

                break;
                case 1: {
                    color = Color.GREEN;
                }

                break;
                case 2: {
                    color = Color.YELLOW;
                }

                break;
                case 3: {
                    color = Color.RED;
                }

                break;
            }
            aMap.addPolyline((new PolylineOptions()).addAll(latLngs).color(color));
        }
    }

    LatLngBounds bounds  = builder.build();
    aMap.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds,10));

}
 
Example 5
Source File: DrivingRoutePlanOverlay.java    From TraceByAmap with MIT License 4 votes vote down vote up
public LatLng convertToLatLng(LatLonPoint point) {
    return new LatLng(point.getLatitude(),point.getLongitude());
}
 
Example 6
Source File: AMapServicesUtil.java    From TraceByAmap with MIT License 4 votes vote down vote up
public static LatLng convertToLatLng(LatLonPoint latLonPoint) {
	return new LatLng(latLonPoint.getLatitude(), latLonPoint.getLongitude());
}
 
Example 7
Source File: TruckRouteColorfulOverLay.java    From TraceByAmap with MIT License 4 votes vote down vote up
public LatLng convertToLatLng(LatLonPoint point) {
      return new LatLng(point.getLatitude(),point.getLongitude());
}
 
Example 8
Source File: DrivingRouteOverlay.java    From TraceByAmap with MIT License 4 votes vote down vote up
public LatLng convertToLatLng(LatLonPoint point) {
      return new LatLng(point.getLatitude(),point.getLongitude());
}
 
Example 9
Source File: AMapServicesUtil.java    From BmapLite with GNU General Public License v3.0 4 votes vote down vote up
public static LatLng convertToLatLng(LatLonPoint latLonPoint) {
	return new LatLng(latLonPoint.getLatitude(), latLonPoint.getLongitude());
}
 
Example 10
Source File: AMapUtil.java    From BmapLite with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 把LatLonPoint对象转化为LatLon对象
 */
public static LatLng convertToLatLng(LatLonPoint latLonPoint) {
	return new LatLng(latLonPoint.getLatitude(), latLonPoint.getLongitude());
}
 
Example 11
Source File: DrivingRouteOverlay.java    From BmapLite with GNU General Public License v3.0 4 votes vote down vote up
public LatLng convertToLatLng(LatLonPoint point) {
    return new LatLng(point.getLatitude(), point.getLongitude());
}
 
Example 12
Source File: AMapServicesUtil.java    From BmapLite with Apache License 2.0 4 votes vote down vote up
public static LatLng convertToLatLng(LatLonPoint latLonPoint) {
	return new LatLng(latLonPoint.getLatitude(), latLonPoint.getLongitude());
}
 
Example 13
Source File: AMapUtil.java    From BmapLite with Apache License 2.0 4 votes vote down vote up
/**
 * 把LatLonPoint对象转化为LatLon对象
 */
public static LatLng convertToLatLng(LatLonPoint latLonPoint) {
	return new LatLng(latLonPoint.getLatitude(), latLonPoint.getLongitude());
}
 
Example 14
Source File: DrivingRouteOverlay.java    From BmapLite with Apache License 2.0 4 votes vote down vote up
public LatLng convertToLatLng(LatLonPoint point) {
    return new LatLng(point.getLatitude(), point.getLongitude());
}
 
Example 15
Source File: AMapUtil.java    From Maps with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 把LatLonPoint对象转化为LatLon对象
 */
public static LatLng convertToLatLng(LatLonPoint latLonPoint) {
	return new LatLng(latLonPoint.getLatitude(), latLonPoint.getLongitude());
}
 
Example 16
Source File: LatLngUtil.java    From BetterWay with Apache License 2.0 2 votes vote down vote up
/**
 * 将LatLonPoint 转化为LatLon
 * @param latLonPoint 需要转化的LatLonPoint
 * @return 转化好的LatLng
 */
public static LatLng convertPointToLatLng(LatLonPoint latLonPoint) {
    return new LatLng(latLonPoint.getLatitude(), latLonPoint.getLongitude());
}