AppInfo.java
1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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);
}
}