修正了lod中的一个问题
Showing
5 changed files
with
28 additions
and
23 deletions
| ... | @@ -17,7 +17,10 @@ | ... | @@ -17,7 +17,10 @@ |
| 17 | android:supportsRtl="true" | 17 | android:supportsRtl="true" |
| 18 | android:theme="@style/AppTheme"> | 18 | android:theme="@style/AppTheme"> |
| 19 | <activity android:name=".BootActivity" > | 19 | <activity android:name=".BootActivity" > |
| 20 | 20 | <intent-filter> | |
| 21 | <action android:name="android.intent.action.MAIN" /> | ||
| 22 | <category android:name="android.intent.category.LAUNCHER" /> | ||
| 23 | </intent-filter> | ||
| 21 | </activity> | 24 | </activity> |
| 22 | <activity | 25 | <activity |
| 23 | android:name=".MainActivity" | 26 | android:name=".MainActivity" |
| ... | @@ -26,10 +29,7 @@ | ... | @@ -26,10 +29,7 @@ |
| 26 | android:theme="@style/AppTheme.NoActionBar"> <!-- 禁止屏幕旋转 --> | 29 | android:theme="@style/AppTheme.NoActionBar"> <!-- 禁止屏幕旋转 --> |
| 27 | </activity> | 30 | </activity> |
| 28 | <activity android:name=".GoogleMapActivity"> | 31 | <activity android:name=".GoogleMapActivity"> |
| 29 | <intent-filter> | 32 | |
| 30 | <action android:name="android.intent.action.MAIN" /> | ||
| 31 | <category android:name="android.intent.category.LAUNCHER" /> | ||
| 32 | </intent-filter> | ||
| 33 | </activity> | 33 | </activity> |
| 34 | <activity android:name=".BaiduMapActivity"> | 34 | <activity android:name=".BaiduMapActivity"> |
| 35 | 35 | ... | ... |
| ... | @@ -26,12 +26,10 @@ import com.esri.android.runtime.ArcGISRuntime; | ... | @@ -26,12 +26,10 @@ import com.esri.android.runtime.ArcGISRuntime; |
| 26 | import com.esri.core.geometry.Point; | 26 | import com.esri.core.geometry.Point; |
| 27 | import com.esri.core.map.Graphic; | 27 | import com.esri.core.map.Graphic; |
| 28 | import com.esri.core.symbol.PictureMarkerSymbol; | 28 | import com.esri.core.symbol.PictureMarkerSymbol; |
| 29 | import com.pashanhoo.landsurvey.layers.tianditu.TDTTileinfo; | ||
| 30 | import com.pashanhoo.landsurvey.layers.tianditu.TianDiTuLocalTiledMapServiceLayer; | 29 | import com.pashanhoo.landsurvey.layers.tianditu.TianDiTuLocalTiledMapServiceLayer; |
| 31 | import com.pashanhoo.landsurvey.layers.tianditu.TianDiTuTiledMapServiceLayer; | 30 | import com.pashanhoo.landsurvey.layers.tianditu.TianDiTuTiledMapServiceLayer; |
| 32 | import com.pashanhoo.landsurvey.layers.tianditu.TianDiTuLayerTypes; | 31 | import com.pashanhoo.landsurvey.layers.tianditu.TianDiTuLayerTypes; |
| 33 | import com.pashanhoo.landsurvey.search.POISuggestion; | 32 | import com.pashanhoo.landsurvey.search.POISuggestion; |
| 34 | import com.pashanhoo.landsurvey.search.TiandituSearch; | ||
| 35 | import com.pashanhoo.landsurvey.utils.AppInfo; | 33 | import com.pashanhoo.landsurvey.utils.AppInfo; |
| 36 | 34 | ||
| 37 | import org.json.JSONArray; | 35 | import org.json.JSONArray; |
| ... | @@ -65,16 +63,26 @@ public class MainActivity extends AppCompatActivity { | ... | @@ -65,16 +63,26 @@ public class MainActivity extends AppCompatActivity { |
| 65 | protected void onCreate(Bundle savedInstanceState) { | 63 | protected void onCreate(Bundle savedInstanceState) { |
| 66 | super.onCreate(savedInstanceState); | 64 | super.onCreate(savedInstanceState); |
| 67 | setContentView(R.layout.activity_main); | 65 | setContentView(R.layout.activity_main); |
| 68 | // 分别获取控件 | 66 | // 分别获取控件对象 |
| 69 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); | 67 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); |
| 68 | setSupportActionBar(toolbar); | ||
| 70 | mapinfoView = (TextView) findViewById(R.id.mapinfo); | 69 | mapinfoView = (TextView) findViewById(R.id.mapinfo); |
| 71 | floatingSearchView = (FloatingSearchView) findViewById(R.id.floating_search_view); | 70 | floatingSearchView = (FloatingSearchView) findViewById(R.id.floating_search_view); |
| 72 | setSupportActionBar(toolbar); | ||
| 73 | 71 | ||
| 74 | //初始化------------------------------------------------------------------- | 72 | // 初始化------------------------------------------------------------------- |
| 75 | AppInfo.Settings(); | 73 | AppInfo.Settings(); |
| 76 | 74 | ||
| 77 | //按钮动作------------------------------------------------------------------- | 75 | //地图初始化------------------------------------------------------------------- |
| 76 | ArcGISRuntime.setClientId("1eFHW78avlnRUPHm"); | ||
| 77 | mapView = (MapView) findViewById(R.id.map); | ||
| 78 | mapView.setEsriLogoVisible(false); | ||
| 79 | mapView.enableWrapAround(false); | ||
| 80 | // GPS设置 | ||
| 81 | locationDisplayManager = mapView.getLocationDisplayManager(); | ||
| 82 | locationDisplayManager.setShowLocation(true); | ||
| 83 | locationDisplayManager.setAutoPanMode(LocationDisplayManager.AutoPanMode.LOCATION);//设置模式 | ||
| 84 | locationDisplayManager.setShowPings(true); | ||
| 85 | |||
| 78 | // 放大按钮 | 86 | // 放大按钮 |
| 79 | FloatingActionButton zoomin = (FloatingActionButton) findViewById(R.id.zoomin); | 87 | FloatingActionButton zoomin = (FloatingActionButton) findViewById(R.id.zoomin); |
| 80 | zoomin.setOnClickListener(new View.OnClickListener() { | 88 | zoomin.setOnClickListener(new View.OnClickListener() { |
| ... | @@ -133,6 +141,7 @@ public class MainActivity extends AppCompatActivity { | ... | @@ -133,6 +141,7 @@ public class MainActivity extends AppCompatActivity { |
| 133 | } | 141 | } |
| 134 | } | 142 | } |
| 135 | }); | 143 | }); |
| 144 | |||
| 136 | final FloatingActionButton search = (FloatingActionButton) findViewById(R.id.search); | 145 | final FloatingActionButton search = (FloatingActionButton) findViewById(R.id.search); |
| 137 | search.setOnClickListener(new View.OnClickListener() { | 146 | search.setOnClickListener(new View.OnClickListener() { |
| 138 | @Override | 147 | @Override |
| ... | @@ -148,11 +157,7 @@ public class MainActivity extends AppCompatActivity { | ... | @@ -148,11 +157,7 @@ public class MainActivity extends AppCompatActivity { |
| 148 | } | 157 | } |
| 149 | } | 158 | } |
| 150 | }); | 159 | }); |
| 151 | //地图初始化------------------------------------------------------------------- | 160 | |
| 152 | ArcGISRuntime.setClientId("1eFHW78avlnRUPHm"); | ||
| 153 | mapView = (MapView) findViewById(R.id.map); | ||
| 154 | mapView.setEsriLogoVisible(false); | ||
| 155 | mapView.enableWrapAround(false); | ||
| 156 | // 添加地图图层 | 161 | // 添加地图图层 |
| 157 | t_vec = new TianDiTuTiledMapServiceLayer(TianDiTuLayerTypes.VEC_C); | 162 | t_vec = new TianDiTuTiledMapServiceLayer(TianDiTuLayerTypes.VEC_C); |
| 158 | mapView.addLayer(t_vec); | 163 | mapView.addLayer(t_vec); |
| ... | @@ -206,10 +211,6 @@ public class MainActivity extends AppCompatActivity { | ... | @@ -206,10 +211,6 @@ public class MainActivity extends AppCompatActivity { |
| 206 | }); | 211 | }); |
| 207 | 212 | ||
| 208 | // GPS | 213 | // GPS |
| 209 | locationDisplayManager = mapView.getLocationDisplayManager(); | ||
| 210 | locationDisplayManager.setShowLocation(true); | ||
| 211 | locationDisplayManager.setAutoPanMode(LocationDisplayManager.AutoPanMode.LOCATION);//设置模式 | ||
| 212 | locationDisplayManager.setShowPings(true); | ||
| 213 | locationDisplayManager.setLocationListener(new LocationListener() { | 214 | locationDisplayManager.setLocationListener(new LocationListener() { |
| 214 | @Override | 215 | @Override |
| 215 | public void onLocationChanged(Location location) { | 216 | public void onLocationChanged(Location location) { | ... | ... |
| ... | @@ -31,7 +31,11 @@ public enum TianDiTuLayerTypes implements BaseTiledMapServiceType { | ... | @@ -31,7 +31,11 @@ public enum TianDiTuLayerTypes implements BaseTiledMapServiceType { |
| 31 | /** | 31 | /** |
| 32 | * 地形注记 | 32 | * 地形注记 |
| 33 | */ | 33 | */ |
| 34 | CTA_C; | 34 | CTA_C, |
| 35 | /** | ||
| 36 | * 浙江省矢量图 | ||
| 37 | */ | ||
| 38 | VEC_C_ZJ; | ||
| 35 | 39 | ||
| 36 | public void setName() | 40 | public void setName() |
| 37 | { | 41 | { | ... | ... |
| ... | @@ -199,7 +199,7 @@ public class TianDiTuTiledMapServiceLayer extends TiledServiceLayer { | ... | @@ -199,7 +199,7 @@ public class TianDiTuTiledMapServiceLayer extends TiledServiceLayer { |
| 199 | default: | 199 | default: |
| 200 | return null; | 200 | return null; |
| 201 | } | 201 | } |
| 202 | 202 | Log.i("map",url.toString()); | |
| 203 | try { | 203 | try { |
| 204 | // 首先从离线数据库中读取 | 204 | // 首先从离线数据库中读取 |
| 205 | result = getOfflineCacheDB(level, col, row); | 205 | result = getOfflineCacheDB(level, col, row); | ... | ... |
| ... | @@ -19,7 +19,7 @@ public class AppInfo { | ... | @@ -19,7 +19,7 @@ public class AppInfo { |
| 19 | 19 | ||
| 20 | public static SQLiteDatabase mapcachedb; | 20 | public static SQLiteDatabase mapcachedb; |
| 21 | 21 | ||
| 22 | public static Point initPoint = new Point(116.39167, 39.90333); | 22 | public static Point initPoint = new Point(121.557167, 21.87); |
| 23 | 23 | ||
| 24 | public static double initRes = TDTTileinfo.getRes4490()[17]; | 24 | public static double initRes = TDTTileinfo.getRes4490()[17]; |
| 25 | // public static double initRes = TDTTileinfo.getRes4326()[6]; | 25 | // public static double initRes = TDTTileinfo.getRes4326()[6]; | ... | ... |
-
Please register or sign in to post a comment