d1db004c by chiangbt

修正了lod中的一个问题

1 parent be21d1b2
......@@ -17,7 +17,10 @@
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".BootActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
......@@ -26,10 +29,7 @@
android:theme="@style/AppTheme.NoActionBar"> <!-- 禁止屏幕旋转 -->
</activity>
<activity android:name=".GoogleMapActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".BaiduMapActivity">
......
......@@ -26,12 +26,10 @@ import com.esri.android.runtime.ArcGISRuntime;
import com.esri.core.geometry.Point;
import com.esri.core.map.Graphic;
import com.esri.core.symbol.PictureMarkerSymbol;
import com.pashanhoo.landsurvey.layers.tianditu.TDTTileinfo;
import com.pashanhoo.landsurvey.layers.tianditu.TianDiTuLocalTiledMapServiceLayer;
import com.pashanhoo.landsurvey.layers.tianditu.TianDiTuTiledMapServiceLayer;
import com.pashanhoo.landsurvey.layers.tianditu.TianDiTuLayerTypes;
import com.pashanhoo.landsurvey.search.POISuggestion;
import com.pashanhoo.landsurvey.search.TiandituSearch;
import com.pashanhoo.landsurvey.utils.AppInfo;
import org.json.JSONArray;
......@@ -65,16 +63,26 @@ public class MainActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// 分别获取控件
// 分别获取控件对象
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
mapinfoView = (TextView) findViewById(R.id.mapinfo);
floatingSearchView = (FloatingSearchView) findViewById(R.id.floating_search_view);
setSupportActionBar(toolbar);
//初始化-------------------------------------------------------------------
// 初始化-------------------------------------------------------------------
AppInfo.Settings();
//按钮动作-------------------------------------------------------------------
//地图初始化-------------------------------------------------------------------
ArcGISRuntime.setClientId("1eFHW78avlnRUPHm");
mapView = (MapView) findViewById(R.id.map);
mapView.setEsriLogoVisible(false);
mapView.enableWrapAround(false);
// GPS设置
locationDisplayManager = mapView.getLocationDisplayManager();
locationDisplayManager.setShowLocation(true);
locationDisplayManager.setAutoPanMode(LocationDisplayManager.AutoPanMode.LOCATION);//设置模式
locationDisplayManager.setShowPings(true);
// 放大按钮
FloatingActionButton zoomin = (FloatingActionButton) findViewById(R.id.zoomin);
zoomin.setOnClickListener(new View.OnClickListener() {
......@@ -133,6 +141,7 @@ public class MainActivity extends AppCompatActivity {
}
}
});
final FloatingActionButton search = (FloatingActionButton) findViewById(R.id.search);
search.setOnClickListener(new View.OnClickListener() {
@Override
......@@ -148,11 +157,7 @@ public class MainActivity extends AppCompatActivity {
}
}
});
//地图初始化-------------------------------------------------------------------
ArcGISRuntime.setClientId("1eFHW78avlnRUPHm");
mapView = (MapView) findViewById(R.id.map);
mapView.setEsriLogoVisible(false);
mapView.enableWrapAround(false);
// 添加地图图层
t_vec = new TianDiTuTiledMapServiceLayer(TianDiTuLayerTypes.VEC_C);
mapView.addLayer(t_vec);
......@@ -206,10 +211,6 @@ public class MainActivity extends AppCompatActivity {
});
// GPS
locationDisplayManager = mapView.getLocationDisplayManager();
locationDisplayManager.setShowLocation(true);
locationDisplayManager.setAutoPanMode(LocationDisplayManager.AutoPanMode.LOCATION);//设置模式
locationDisplayManager.setShowPings(true);
locationDisplayManager.setLocationListener(new LocationListener() {
@Override
public void onLocationChanged(Location location) {
......
......@@ -31,7 +31,11 @@ public enum TianDiTuLayerTypes implements BaseTiledMapServiceType {
/**
* 地形注记
*/
CTA_C;
CTA_C,
/**
* 浙江省矢量图
*/
VEC_C_ZJ;
public void setName()
{
......
......@@ -199,7 +199,7 @@ public class TianDiTuTiledMapServiceLayer extends TiledServiceLayer {
default:
return null;
}
Log.i("map",url.toString());
try {
// 首先从离线数据库中读取
result = getOfflineCacheDB(level, col, row);
......
......@@ -19,7 +19,7 @@ public class AppInfo {
public static SQLiteDatabase mapcachedb;
public static Point initPoint = new Point(116.39167, 39.90333);
public static Point initPoint = new Point(121.557167, 21.87);
public static double initRes = TDTTileinfo.getRes4490()[17];
// public static double initRes = TDTTileinfo.getRes4326()[6];
......