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


Java NaviLatLng类代码示例

本文整理汇总了Java中com.amap.api.navi.model.NaviLatLng的典型用法代码示例。如果您正苦于以下问题:Java NaviLatLng类的具体用法?Java NaviLatLng怎么用?Java NaviLatLng使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NaviLatLng类属于com.amap.api.navi.model包,在下文中一共展示了NaviLatLng类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onLocationChanged

import com.amap.api.navi.model.NaviLatLng; //导入依赖的package包/类
/**
 * 定位地点
 * @param amapLocation
 */
@Override
public void onLocationChanged(AMapLocation amapLocation) {
    if (mListener != null&&amapLocation != null) {
        EventBus.getDefault().post(amapLocation);
        if (amapLocation != null
                &&amapLocation.getErrorCode() == 0) {
            if(startList.size()==0)
                startList.add(new NaviLatLng(amapLocation.getLatitude(),amapLocation.getLongitude()));
            if(!calculateSuccess){
                mListener.onLocationChanged(amapLocation);// 显示系统小蓝点
            }

        } else {
            String errText = "定位失败," + amapLocation.getErrorCode()+ ": " + amapLocation.getErrorInfo();
            Log.e("AmapErr",errText);
        }
    }
}
 
开发者ID:Vicent9920,项目名称:MyMap,代码行数:23,代码来源:NavigationActivity.java

示例2: initPoint

import com.amap.api.navi.model.NaviLatLng; //导入依赖的package包/类
private void initPoint() {
    Intent intent = getIntent();
    double[] start = intent.getDoubleArrayExtra("start");
    double[] end = intent.getDoubleArrayExtra("end");
    sList.add(new NaviLatLng(start[0], start[1]));
    eList.add(new NaviLatLng(end[0], end[1]));
    this.isEmulator = intent.getIntExtra("type", 1) == 0;
    if (this.isEmulator) {
        navigation.setEmulatorNaviSpeed(75);
    }
}
 
开发者ID:luocongqiu,项目名称:cordova-plugin-navigation,代码行数:12,代码来源:NavigationActivity.java

示例3: onMessageEvent

import com.amap.api.navi.model.NaviLatLng; //导入依赖的package包/类
/**
 * 获取终点信息
 * @param tip
 */
@Subscribe(threadMode = ThreadMode.MAIN)
public void onMessageEvent(Tip tip) {
    tvEnd.setText("到     "+tip.getDistrict());
    LatLonPoint endLp = tip.getPoint();
    endList.clear();
    endList.add(new NaviLatLng(endLp.getLatitude(),endLp.getLongitude()));
}
 
开发者ID:Vicent9920,项目名称:MyMap,代码行数:12,代码来源:NavigationActivity.java

示例4: onCreate

import com.amap.api.navi.model.NaviLatLng; //导入依赖的package包/类
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    AMapNavi.getInstance(this).setAMapNaviListener(this);
    Intent intent = getIntent();
    mNaviStart = new NaviLatLng(Float.parseFloat(intent.getStringExtra("NaviStartLat")),
            Float.parseFloat(intent.getStringExtra("NaviStartLng")));
    mNaviEnd = new NaviLatLng(Float.parseFloat(intent.getStringExtra("NaviEndLat")),
            Float.parseFloat(intent.getStringExtra("NaviEndLng")));
    LinearLayout l = new LinearLayout(this);
    ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT);
    l.setLayoutParams(layoutParams);

    if (intent.getStringExtra("NavType").equals("0")) {
        mIsEmulatorNavi = false;
    } else {
        mIsEmulatorNavi = true;
    }

    mAmapAMapNaviView = new AMapNaviView(this);

    LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT);
    l.addView(mAmapAMapNaviView, lp);

    setContentView(l);
    init(savedInstanceState);
}
 
开发者ID:starwander,项目名称:cordova-plugin-amap-navi,代码行数:29,代码来源:AMapActivity.java

示例5: keepCallback

import com.amap.api.navi.model.NaviLatLng; //导入依赖的package包/类
public void keepCallback(NaviLatLng point) {
    JSONObject json = new JSONObject();
    try {
        json.put("status", 1);
        json.put("lat", point.getLatitude());
        json.put("lng", point.getLongitude());
    } catch (JSONException ex) {
        Log.e("AMapNavigation.keepCallback", ex.getMessage());
    }
    PluginResult pluginResult = new PluginResult(PluginResult.Status.OK, json);
    pluginResult.setKeepCallback(true);
    callbackContext.sendPluginResult(pluginResult);
}
 
开发者ID:starwander,项目名称:cordova-plugin-amap-navi,代码行数:14,代码来源:AMapNavigation.java


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