地图模块代码更新3.0.0
This commit is contained in:
@@ -0,0 +1,462 @@
|
||||
//package com.autonavi.nge.dm;
|
||||
//
|
||||
//import android.os.RemoteException;
|
||||
//import android.util.Log;
|
||||
//import android.util.Pair;
|
||||
//
|
||||
//import com.autonavi.nge.dataaccdss.DataAccessProvider;
|
||||
//import com.autonavi.nge.guidance.GuidanceProvider;
|
||||
//import com.autonavi.nge.guidance.GuidanceStatListener;
|
||||
//import com.autonavi.nge.guidance.LaneMask;
|
||||
//import com.autonavi.nge.guidance.NaviInfo;
|
||||
//import com.autonavi.nge.guidance.RouteBook;
|
||||
//import com.autonavi.nge.guidance.RouteImage;
|
||||
//import com.autonavi.nge.map.LonLat;
|
||||
//import com.autonavi.nge.obj.Category;
|
||||
//import com.autonavi.nge.obj.PoiBase;
|
||||
//import com.autonavi.nge.obj.UpdateRegion;
|
||||
//import com.autonavi.nge.routing.RoutingProvider;
|
||||
//import com.autonavi.nge.search.SPCategories;
|
||||
//import com.autonavi.nge.search.SPLatLonPoint;
|
||||
//import com.autonavi.nge.search.SPPoiItem;
|
||||
//import com.autonavi.nge.search.SPQuery;
|
||||
//import com.autonavi.nge.search.SPSearchResult;
|
||||
//import com.autonavi.nge.search.SearchProvider;
|
||||
//import com.autonavi.nge.trafficInfo.TMCID;
|
||||
//import com.pdager.tts.CMDPlayer;
|
||||
//import com.zhidaoauto.map.sdk.inner.CompileConfig;
|
||||
//import com.zhidaoauto.map.sdk.inner.controller.CommonController;
|
||||
//
|
||||
//import java.util.ArrayList;
|
||||
//import java.util.List;
|
||||
//
|
||||
///**
|
||||
// * @author Administrator
|
||||
// */
|
||||
//public class NavigationCore extends INavigationCore.Stub {
|
||||
//
|
||||
// private static final String TAG = "NavigationCore";
|
||||
//// private IBinder mHandler;
|
||||
// private SharedMemoryService mShM;
|
||||
// private RoutingProvider mRouteingProvider;
|
||||
// private GuidanceProvider mGuidanceProvider;
|
||||
// private SearchProvider mSearchProvider;
|
||||
// private DataAccessProvider mDataAccessProvider;
|
||||
// private CMDPlayer mCMDPlayer;
|
||||
//
|
||||
// private GuidanceStatListener mListener;
|
||||
//
|
||||
// public NavigationCore(SharedMemoryService shm) {
|
||||
// mShM = shm;
|
||||
//// mHandler = handler;
|
||||
// mRouteingProvider = new RoutingProvider();
|
||||
// mSearchProvider = new SearchProvider();
|
||||
// mGuidanceProvider = new GuidanceProvider( this);
|
||||
//// mDataAccessProvider = new DataAccessProvider(handler);
|
||||
// mCMDPlayer = new CMDPlayer(CommonController.getInstance().getContext());
|
||||
// try {
|
||||
// startServer();
|
||||
// } catch (RemoteException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//// @Override
|
||||
//// public IBinder getHandler() throws RemoteException {
|
||||
//// return mHandler;
|
||||
//// }
|
||||
//
|
||||
// @Override
|
||||
// public void Routing_SetOrigin(float lon, float lat, int sessionid)
|
||||
// throws RemoteException {
|
||||
// mRouteingProvider.setOrigin(lon, lat, sessionid);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void Routing_SetDest(float lon, float lat, int sessionid)
|
||||
// throws RemoteException {
|
||||
// mRouteingProvider.setDest(lon, lat, sessionid);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void Routing_GetRoute(int sessionid) throws RemoteException {
|
||||
// mRouteingProvider.getRoute(sessionid);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean Routing_GetStatus(int sessionid) throws RemoteException {
|
||||
// return mRouteingProvider.getStatus(sessionid);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void Routing_Reset(int sessionid) throws RemoteException {
|
||||
// mRouteingProvider.reset(sessionid);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void Routing_ClearTour(int sessionid) throws RemoteException {
|
||||
// mRouteingProvider.clearTour(sessionid);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void Guidance_UpdatePosition(float lon, float lat, float speed, float heading)
|
||||
// throws RemoteException {
|
||||
// mGuidanceProvider.updatePosition(lon, lat, speed, heading);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void Guidance_StartNavi(int type) throws RemoteException {
|
||||
// mGuidanceProvider.startNavi(type);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void Guidance_StopNavi() throws RemoteException {
|
||||
// mGuidanceProvider.stopNavi();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void Guidance_SetSimSpeed(int speed) throws RemoteException {
|
||||
// mGuidanceProvider.setSimSpeed(speed);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void Guidance_PauseSimNavi() throws RemoteException {
|
||||
// mGuidanceProvider.pauseSimNavi();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void Guidance_ResumeSimNavi() throws RemoteException {
|
||||
// mGuidanceProvider.resumeSimNavi();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public RouteBook Guidance_RouteBook(int session, int start, int end) throws RemoteException {
|
||||
//
|
||||
// try {
|
||||
// return mGuidanceProvider.getRouteBookData(session, start, end);
|
||||
// } catch (Exception e) {
|
||||
//
|
||||
// e.printStackTrace();
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public NaviInfo Guidance_NaviInfo() throws RemoteException {
|
||||
//
|
||||
// try {
|
||||
// return mGuidanceProvider.getNaviInfoData();
|
||||
// } catch (Exception e) {
|
||||
//
|
||||
// e.printStackTrace();
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public NaviInfo GetNaviInfo(byte[] datas) {
|
||||
// try {
|
||||
// return mGuidanceProvider.getNaviInfoData(datas);
|
||||
// } catch (Exception e) {
|
||||
//
|
||||
// e.printStackTrace();
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String Guidance_TTS() throws RemoteException {
|
||||
// try {
|
||||
// return mGuidanceProvider.getGuidanceTTS();s
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public LaneMask Guidance_LaneMask() throws RemoteException {
|
||||
//
|
||||
// try {
|
||||
// return mGuidanceProvider.getGuidanceNaviLane();
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public List<SPPoiItem> Search_getSearchResult(int productId, double lon, double lat, double radius, int kindfilterId, int updateregionId, String keyWord, int pageIdx, int searchType) throws RemoteException {
|
||||
//// int[] kindfilter = new int[1];
|
||||
//// if (kindfilterId > 0) {
|
||||
//// kindfilter[0] = kindfilterId;
|
||||
//// }
|
||||
//// try {
|
||||
//// return SearchProvider.getPoiItemListByType(productId, updateregionId, searchType, keyWord, pageIdx);
|
||||
//// } catch (Exception e) {
|
||||
////
|
||||
//// e.printStackTrace();
|
||||
//// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public List<PoiBase> getFTSDataByDA(int urid, String keyStr, int keytype,
|
||||
// int maxResultCount) throws RemoteException {
|
||||
//
|
||||
// try {
|
||||
// return mDataAccessProvider.getFTSDataByDA(urid, keyStr, keytype, maxResultCount);
|
||||
// } catch (Exception e) {
|
||||
//
|
||||
// e.printStackTrace();
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void play(String text,boolean forcePlay) throws RemoteException {
|
||||
// if(CompileConfig.INSTANCE.getDEBUG()){
|
||||
// Log.i(TAG, "voiceop--navop--play: "+text+",mCMDPlayer:"+mCMDPlayer);
|
||||
// }
|
||||
// mCMDPlayer.play(text, forcePlay);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void RoutingSetCostModel(int model, int sessionid)
|
||||
// throws RemoteException {
|
||||
// mRouteingProvider.setCostModel(model, sessionid);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void RoutingSetAvoidHighway(boolean isAvoidHighway, int sessionid)
|
||||
// throws RemoteException {
|
||||
// mRouteingProvider.setAvoidHighway(isAvoidHighway, sessionid);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void RoutingSetAvoidToll(boolean isAvoidToll, int sessionid)
|
||||
// throws RemoteException {
|
||||
// mRouteingProvider.setAvoidToll(isAvoidToll, sessionid);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public List<String> getInputResult(int productId, int updateregionId, String inputStr)
|
||||
// throws RemoteException {
|
||||
//// try {
|
||||
//// return mSearchProvider.getInputResult(productId, updateregionId, inputStr);
|
||||
//// } catch (UnsupportedEncodingException e) {
|
||||
//// e.printStackTrace();
|
||||
//// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public List<String> getInputResultByDA() throws RemoteException {
|
||||
// try {
|
||||
// return mDataAccessProvider.getInputResultByDA();
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return null;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public List<Category> getCatList(int urid) throws RemoteException {
|
||||
//// try {
|
||||
//// return mSearchProvider.getCatList(1, urid);
|
||||
//// } catch (Exception e) {
|
||||
////
|
||||
//// e.printStackTrace();
|
||||
//// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public List<UpdateRegion> getURListByDA(int prodid) throws RemoteException {
|
||||
// try {
|
||||
// return mDataAccessProvider.getURListByDA(prodid);
|
||||
// } catch (Exception e) {
|
||||
//
|
||||
// e.printStackTrace();
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public RouteImage Guidance_Image(int imageUr, int imageBg, int imageArrow, int type)
|
||||
// throws RemoteException {
|
||||
//
|
||||
// try {
|
||||
// return mGuidanceProvider.getRouteImage(imageUr, imageBg, imageArrow, type);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void RoutingSetUseTraffic(boolean useTraffic, int sessionid)
|
||||
// throws RemoteException {
|
||||
// mRouteingProvider.setUseTraffic(useTraffic, sessionid);
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int RoutingGetRouteNum(int sessionid) throws RemoteException {
|
||||
// return mRouteingProvider.getRouteNum(sessionid);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int RoutingGetLength(int route, int sessionid)
|
||||
// throws RemoteException {
|
||||
// return mRouteingProvider.getLength(route, sessionid);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int RoutingGetSTime(int route, int sessionid) throws RemoteException {
|
||||
// return mRouteingProvider.getSTime(route, sessionid);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int RoutingGetDTime(int route, int sessionid) throws RemoteException {
|
||||
// return mRouteingProvider.getDTime(route, sessionid);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void Traffic_Update(List<TMCID> ids, int evt) throws RemoteException {
|
||||
// mRouteingProvider.setTrafStat(ids, evt);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void Traffic_UpdateByTile(int tile, int[] ids, byte[] speeds) {
|
||||
// mRouteingProvider.setTrafSpeedByTile(tile, ids, speeds);
|
||||
// }
|
||||
//
|
||||
// //@Override void
|
||||
//
|
||||
// @Override
|
||||
// public int RoutingGetSearchedCnt(int route, int sessionid) throws RemoteException {
|
||||
// return RoutingProvider.getsearchedcnt(route, sessionid);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int[] getMemoryInfo() throws RemoteException {
|
||||
// // return mShM.getMemoryInfo();
|
||||
// return new int[]{0};
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void startServer() throws RemoteException {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void stopServer() throws RemoteException {
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void addwaypoint(float lon, float lat, int heading, int sessionid)
|
||||
// throws RemoteException {
|
||||
// mRouteingProvider.addWayPoint(lon, lat, heading, sessionid);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void clearwaypoints(int sessionid) throws RemoteException {
|
||||
// mRouteingProvider.clearWayPoints(sessionid);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getMDSVersion() throws RemoteException {
|
||||
//
|
||||
// return 1;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getDataVersion() throws RemoteException {
|
||||
//
|
||||
// return "";
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getCopyRight() throws RemoteException {
|
||||
//
|
||||
// return "";
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getCompilerVersion() throws RemoteException {
|
||||
//
|
||||
// return "";
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public double Guidance_getRoadAngle() throws RemoteException {
|
||||
//
|
||||
// return mGuidanceProvider.getRoadAngle();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onGuidanceStatusChanged(int statCode, byte[] datas) {
|
||||
// if (mListener != null) {
|
||||
// try {
|
||||
// mListener.onGuidanceStatusChanged(statCode, datas);
|
||||
// } catch (RemoteException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void setGuidanceStatListener(GuidanceStatListener listener)
|
||||
// throws RemoteException {
|
||||
// mListener = listener;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public SPCategories getAllPoiCategories(int languageCode) throws RemoteException {
|
||||
// List<Pair<Integer, String>> list = SearchProvider.getAllPoiCategories(languageCode);
|
||||
// SPCategories spCategories = new SPCategories();
|
||||
// spCategories.setCategories(list);
|
||||
// return spCategories;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public List<SPSearchResult> getPoiItemList(SPQuery query) throws RemoteException {
|
||||
// return SearchProvider.getPoiItemList(query);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public SPPoiItem getPoiItemByPoiId(int poiId) {
|
||||
// return SearchProvider.getPoiItemByPoiId(poiId);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public List<SPPoiItem> getPoiItemListByLonLat(int prodId, int urId, float lon, float lat, int pageCount, int pageIdx) {
|
||||
// return null;//SearchProvider.getPoiItemListByLonLat(prodId, urId, lon, lat, pageCount, pageIdx);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public List<SPPoiItem> queryPoiItemByCircle(float centerLon, float centerLat, float radius) {
|
||||
// Log.i(TAG, "searchop--queryPoiItemByCircle: " + centerLon + "," + centerLat);
|
||||
// return null;//SearchProvider.getPoiItemByCircle(new SPLatLonPoint(centerLon, centerLat), radius);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public List<SPPoiItem> queryPoiItemByRect(float topLeftLon, float topLeftLat, float bottomRightLon, float bottomRightLat) {
|
||||
// return null;//SearchProvider.getPoiItemByRect(new SPLatLonPoint(topLeftLon, topLeftLat), new SPLatLonPoint(bottomRightLon, bottomRightLat));
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public List<SPPoiItem> queryPoiItemByPolygon(List<LonLat> latLonPoints) {
|
||||
// if (latLonPoints == null || latLonPoints.size() < 3) {
|
||||
// return null;
|
||||
// }
|
||||
// List<SPLatLonPoint> list = new ArrayList<>();
|
||||
// for (LonLat lonLat : latLonPoints) {
|
||||
// list.add(new SPLatLonPoint((float) lonLat.getLon(), (float) lonLat.getLat()));
|
||||
// }
|
||||
// return null;//SearchProvider.getPoiItemByPolygon(list);
|
||||
// }
|
||||
//}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.autonavi.nge.dm;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.autonavi.nge.hdmap.HDMapProvider;
|
||||
import com.zhidaoauto.map.sdk.inner.CompileConfig;
|
||||
import com.zhidaoauto.map.sdk.inner.common.MapHelper;
|
||||
import com.zhidaoauto.map.sdk.inner.utils.CommonUtils;
|
||||
import com.zhidaoauto.map.sdk.inner.utils.Constant;
|
||||
|
||||
|
||||
public class SharedMemoryService {
|
||||
|
||||
private static final String TAG = "SharedMemoryService";
|
||||
|
||||
static {
|
||||
System.loadLibrary("datamgr");
|
||||
}
|
||||
|
||||
private volatile static SharedMemoryService mInstance;
|
||||
|
||||
public static SharedMemoryService getInstance(Context context) {
|
||||
if (mInstance == null) {
|
||||
synchronized (SharedMemoryService.class) {
|
||||
if (mInstance == null) {
|
||||
mInstance = new SharedMemoryService(context);
|
||||
}
|
||||
}
|
||||
}
|
||||
return mInstance;
|
||||
}
|
||||
|
||||
private SharedMemoryService(Context context) {
|
||||
init(context);
|
||||
}
|
||||
|
||||
public void exit() {
|
||||
mInstance = null;
|
||||
unload();
|
||||
}
|
||||
|
||||
private native static int initSharedMemory_Native(String dir, String tilesDir,int[] tileFilter);
|
||||
|
||||
private native static boolean testRoutingTile(int i, int j, int k);
|
||||
|
||||
public native static void unload();
|
||||
|
||||
|
||||
private void init(Context context) {
|
||||
|
||||
HDMapProvider.setDataFileSource(MapHelper.INSTANCE.getMMapParams().getDataFileSource());
|
||||
HDMapProvider.setDataRedisSource(MapHelper.INSTANCE.getMMapParams().getDataRedisFileSource());
|
||||
if (!TextUtils.isEmpty(MapHelper.INSTANCE.getMMapParams().getHdmapPath())) {
|
||||
HDMapProvider.setDataDir(MapHelper.INSTANCE.getMMapParams().getHdmapPath());
|
||||
}
|
||||
|
||||
String dir = Constant.getNDSDataPath();
|
||||
String cachePath = MapHelper.INSTANCE.getMMapParams().getCachePath();
|
||||
if (TextUtils.isEmpty(cachePath)) {
|
||||
cachePath = CommonUtils.INSTANCE.getCachePath(context);
|
||||
}
|
||||
if (CompileConfig.INSTANCE.getDEBUG()) {
|
||||
Log.i(TAG, "autoop-dir:" + dir+",SharedMemory--cachePath:"+cachePath);
|
||||
}
|
||||
initSharedMemory_Native(dir, cachePath,MapHelper.INSTANCE.getMMapParams().getQzoneFilterArray());
|
||||
}
|
||||
|
||||
|
||||
public int[] getMemoryInfo() {
|
||||
return null; //getMemoryInfo_Native();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user