The Android program calls googlemap on the local machine, transmits the start and end positions, and generates a Roadmap
Copy codeThe Code is as follows: if (wodeweizhiPoint! = Null ){
If (wodeweizhiPoint. getLatitudeE6 ()! = 0 ){
Float chufajingdu = (float) (wodeweizhiPoint. getLongitudeE6 ()/1E6 );
Float chufaweidu = (float) (wodeweizhiPoint. getLatitudeE6 ()/1E6 );
Float daodajingdu = (float) (AppConstant. PointZuoBiao. liangxiangDaoHangPoint. getLongitudeE6 ()/1E6 );
Float daodaweidu = (float) (AppConstant. PointZuoBiao. liangxiangDaoHangPoint. getLatitudeE6 ()/1E6 );
// Mark a vertex
// Intent I = new
// Intent (Intent. ACTION_VIEW, Uri. parse ("http://ditu.google.cn/maps? Hl = zh & mrt = loc & q = 31.249351, 121.45905 "));
// The route from where to where
Intent I = new Intent (Intent. ACTION_VIEW, Uri. parse ("http://ditu.google.cn/maps? F = d & source = s_d & saddr ="
+ Chufaweidu
+ ","
+ Chufajingdu
+ "& Daddr ="
+ Daodaweidu
+ ","
+ Daodajingdu + "& hl = zh "));
// If the googlemap client is forcibly opened, add the following two statements:
I. addFlags (Intent. FLAG_ACTIVITY_NEW_TASK & Intent. FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS );
I. setClassName ("com. google. android. apps. maps", "com. google. android. maps. MapsActivity ");
StartActivity (I );
}
} Else {
AlertUtils. ToastAlert (mContext, "navigation is unavailable because you cannot obtain your location ");
}