AppInfo.java 1.28 KB
package com.pashanhoo.landsurvey.utils;

import android.database.sqlite.SQLiteDatabase;
import android.os.Environment;
import android.util.Log;

import com.esri.core.geometry.Point;
import com.pashanhoo.landsurvey.layers.tencent.TencentMapsTiledServiceLayer;
import com.pashanhoo.landsurvey.layers.tianditu.TianDiTuTiledMapServiceLayer;

import java.io.File;
import java.util.ArrayList;

/**
 * Created by jiangbotao on 2018/3/23.
 */

public class AppInfo {

    public static String dbcachepath;

    public static SQLiteDatabase mapcachedb;

    // 天安门广场
    public static Point initPoint = new Point(118.778644, 32.05212);

    public static double initRes = TianDiTuTiledMapServiceLayer.getRes(17);
    public static double initRes3857 = TencentMapsTiledServiceLayer.getRes(17);

    public static void Settings(){
        // 新建地图缓存数据库,不要试图新建多级目录,切记切记,如keymapinfo/cache
        dbcachepath = Environment.getExternalStorageDirectory()+"/keymapinfo";
        // 创建目录
        final File mFolder = new File(dbcachepath);
        if(!mFolder.exists()) {
            mFolder.mkdirs();
        }
        Log.i("keymapinfo", AppInfo.dbcachepath);
        mapcachedb = SQLiteDatabase.openOrCreateDatabase(dbcachepath + "/mapcache.db", null);
    }
}