Java 类com.baidu.mapapi.map.offline.MKOfflineMap 实例源码

项目:Tower-develop    文件:BaiduMapOfflineMapPreference.java   
@Override
public void onGetOfflineMapState(int type, int state) {
    switch (type) {
        case MKOfflineMap.TYPE_DOWNLOAD_UPDATE: {
            MKOLUpdateElement update = mOffline.getUpdateInfo(state);
            // display download progress
            if (update != null) {
                mStateView.setText(String.format("%s : %d%%", update.cityName, update.ratio));
                updateView();
            }
        }
        break;
        case MKOfflineMap.TYPE_NEW_OFFLINE:
            // Prompt offline map update is available
            Log.d("Baidu offline map", String.format("add offlinemap num:%d", state));
            break;
        case MKOfflineMap.TYPE_VER_UPDATE:
            // Not used yet
            break;
        default:
            break;
    }
}
项目:BaiduMap-TrafficAssistant    文件:DownloadActivity.java   
@Override
public void onGetOfflineMapState(int type, int state) {
    switch (type) {
    case MKOfflineMap.TYPE_DOWNLOAD_UPDATE: {
        MKOLUpdateElement update = mOffline.getUpdateInfo(state);
        // 处理下载进度更新提示
        if (update != null) {
            stateView.setText(String.format("%s : %d%%", update.cityName,
                    update.ratio));
            updateView();

            progressBar.setProgress(update.ratio);
        }
    }
        break;
    }

}
项目:FrontOne    文件:OfflineMapActivity.java   
@Override
public void onGetOfflineMapState(int type, int state) {
    // TODO Auto-generated method stub
    switch (type) {
    case MKOfflineMap.TYPE_DOWNLOAD_UPDATE: {
        MKOLUpdateElement update = mOffline.getUpdateInfo(state);
        // 处理下载进度更新提示
        if (update != null) {
            mRatioTextView.setText(String.format("%d%%", update.ratio));
            if(update.ratio==100){
                mImageButtonDownLoad.setVisibility(View.GONE);
                mRatioTextView.setVisibility(View.GONE);
            }
            updateView();
        }
    }
    }

}
项目:BikeHelper    文件:OfflineMapManager.java   
public static void initialize() {
    mListener = new MKOfflineMapListener() {

        @Override
        public void onGetOfflineMapState(int i, int j) {
            EventBus.notify(EventTypes.OFFLINE_MAP_UPDATE);
        }

    };
    mMKOfflineMap = new MKOfflineMap();
    mMKOfflineMap.init(mListener);
    mImportedMapCount = mMKOfflineMap.importOfflineData();
    mDownloadingCityIDs = new ArrayList<Integer>();
}
项目:Tower-develop    文件:BaiduMapOfflineMapPreference.java   
@Override
public void onBindDialogView(View view){
    // Initialize Baidu Map library
    com.baidu.mapapi.SDKInitializer.initialize(this.getContext().getApplicationContext());
    mBindDialogView = view;
    mOffline = new MKOfflineMap();
    mOffline.init(this);

    initView(view);
    super.onBindDialogView(view);
}
项目:BaiduOfflineDownloadDemo    文件:BaiduOfflineMapActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_offline_map);

    // 初始化离线地图管理
    mOffline = new MKOfflineMap();
    mOffline.init(this);

    initViews();

    viewpager.setCurrentItem(1);
}
项目:BaiduOfflineDownloadDemo    文件:OfflineMapManagerAdapter.java   
public OfflineMapManagerAdapter(Context context, MKOfflineMap mOffline, OnOfflineItemStatusChangeListener listener) {
    super(context);
    // TODO Auto-generated constructor stub
    this.context = context;
    this.mOffline = mOffline;
    this.listener = listener;
}
项目:BaiduOfflineDownloadDemo    文件:OfflineMapAdapter.java   
public OfflineMapAdapter(Context context, MKOfflineMap mOffline, OnOfflineItemStatusChangeListener listener) {
    super(context);
    // TODO Auto-generated constructor stub
    this.context = context;
    this.mOffline = mOffline;
    this.listener = listener;
}
项目:BaiduMap-TrafficAssistant    文件:DownloadActivity.java   
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    this.context = this;
    SDKInitializer.initialize(getApplicationContext());
    setContentView(R.layout.activity_download);
    mOffline = new MKOfflineMap();
    mOffline.init(this);
    initView();
    initAdapter();
    province.setAdapter(arrayAdapterProvince);

}
项目:BikeHelper    文件:OfflineMapManager.java   
public static void initialize() {
    mListener = new MKOfflineMapListener() {

        @Override
        public void onGetOfflineMapState(int i, int j) {
            EventBus.notify(EventTypes.OFFLINE_MAP_UPDATE);
        }

    };
    mMKOfflineMap = new MKOfflineMap();
    mMKOfflineMap.init(mListener);
    mImportedMapCount = mMKOfflineMap.importOfflineData();
    mDownloadingCityIDs = new ArrayList<Integer>();
}
项目:FrontOne    文件:OfflineMapActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_offline_map);

    try {
        mOffline = new MKOfflineMap();
        mOffline.init(this);
        init();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
项目:BaiduOfflineDownloadDemo    文件:OfflineExpandableListAdapter.java   
public OfflineExpandableListAdapter(Context context, MKOfflineMap mOffline, OnOfflineItemStatusChangeListener listener){
    this.context = context;
    this.mOffline = mOffline;
    this.listener = listener;
    inflater = LayoutInflater.from(context);
}