update 3.28
Showing
9 changed files
with
38 additions
and
7 deletions
This file is too large to display.
| ... | @@ -11,7 +11,6 @@ | ... | @@ -11,7 +11,6 @@ |
| 11 | android:allowBackup="true" | 11 | android:allowBackup="true" |
| 12 | android:icon="@mipmap/logo" | 12 | android:icon="@mipmap/logo" |
| 13 | android:label="@string/app_name" | 13 | android:label="@string/app_name" |
| 14 | android:roundIcon="@mipmap/ic_launcher_round" | ||
| 15 | android:supportsRtl="true" | 14 | android:supportsRtl="true" |
| 16 | android:theme="@style/AppTheme"> | 15 | android:theme="@style/AppTheme"> |
| 17 | <activity | 16 | <activity | ... | ... |
| ... | @@ -31,8 +31,7 @@ public class BootActivity extends OnboarderActivity { | ... | @@ -31,8 +31,7 @@ public class BootActivity extends OnboarderActivity { |
| 31 | Manifest.permission.ACCESS_COARSE_LOCATION, | 31 | Manifest.permission.ACCESS_COARSE_LOCATION, |
| 32 | Manifest.permission.ACCESS_FINE_LOCATION, | 32 | Manifest.permission.ACCESS_FINE_LOCATION, |
| 33 | Manifest.permission.WRITE_EXTERNAL_STORAGE, | 33 | Manifest.permission.WRITE_EXTERNAL_STORAGE, |
| 34 | Manifest.permission.READ_EXTERNAL_STORAGE, | 34 | Manifest.permission.READ_EXTERNAL_STORAGE |
| 35 | Manifest.permission.READ_PHONE_STATE | ||
| 36 | }; | 35 | }; |
| 37 | 36 | ||
| 38 | private static final int PERMISSON_REQUESTCODE = 0; | 37 | private static final int PERMISSON_REQUESTCODE = 0; |
| ... | @@ -42,13 +41,16 @@ public class BootActivity extends OnboarderActivity { | ... | @@ -42,13 +41,16 @@ public class BootActivity extends OnboarderActivity { |
| 42 | private boolean isNeedCheck = true; | 41 | private boolean isNeedCheck = true; |
| 43 | 42 | ||
| 44 | @Override | 43 | @Override |
| 45 | protected void onCreate(Bundle savedInstanceState) { | 44 | protected void onResume() { |
| 46 | super.onCreate(savedInstanceState); | 45 | super.onResume(); |
| 47 | |||
| 48 | // 系统权限检查 | 46 | // 系统权限检查 |
| 49 | if(isNeedCheck){ | 47 | if(isNeedCheck){ |
| 50 | checkPermissions(needPermissions); | 48 | checkPermissions(needPermissions); |
| 51 | } | 49 | } |
| 50 | } | ||
| 51 | @Override | ||
| 52 | protected void onCreate(Bundle savedInstanceState) { | ||
| 53 | super.onCreate(savedInstanceState); | ||
| 52 | 54 | ||
| 53 | // 引导页设置 | 55 | // 引导页设置 |
| 54 | OnboarderPage onboarderPage1 = new OnboarderPage("Keymap", "服务于智慧城市信息化的产品", R.drawable.planet1); | 56 | OnboarderPage onboarderPage1 = new OnboarderPage("Keymap", "服务于智慧城市信息化的产品", R.drawable.planet1); | ... | ... |
| 1 | package com.pashanhoo.landsurvey; | 1 | package com.pashanhoo.landsurvey; |
| 2 | 2 | ||
| 3 | import android.annotation.SuppressLint; | ||
| 3 | import android.location.Location; | 4 | import android.location.Location; |
| 4 | import android.location.LocationListener; | 5 | import android.location.LocationListener; |
| 5 | import android.os.Bundle; | 6 | import android.os.Bundle; |
| ... | @@ -85,6 +86,7 @@ public class MainActivity extends AppCompatActivity { | ... | @@ -85,6 +86,7 @@ public class MainActivity extends AppCompatActivity { |
| 85 | if (locationDisplayManager != null) { | 86 | if (locationDisplayManager != null) { |
| 86 | locationDisplayManager.stop(); | 87 | locationDisplayManager.stop(); |
| 87 | } | 88 | } |
| 89 | // 保证地图级别小于20 | ||
| 88 | if (curLevel < 20) { | 90 | if (curLevel < 20) { |
| 89 | mapView.zoomin(true); | 91 | mapView.zoomin(true); |
| 90 | } | 92 | } |
| ... | @@ -98,6 +100,7 @@ public class MainActivity extends AppCompatActivity { | ... | @@ -98,6 +100,7 @@ public class MainActivity extends AppCompatActivity { |
| 98 | if (locationDisplayManager != null) { | 100 | if (locationDisplayManager != null) { |
| 99 | locationDisplayManager.stop(); | 101 | locationDisplayManager.stop(); |
| 100 | } | 102 | } |
| 103 | // 保证地图级别大于0 | ||
| 101 | if (curLevel > 0) { | 104 | if (curLevel > 0) { |
| 102 | mapView.zoomout(true); | 105 | mapView.zoomout(true); |
| 103 | } | 106 | } |
| ... | @@ -110,6 +113,7 @@ public class MainActivity extends AppCompatActivity { | ... | @@ -110,6 +113,7 @@ public class MainActivity extends AppCompatActivity { |
| 110 | public void onClick(View view) { | 113 | public void onClick(View view) { |
| 111 | locationDisplayManager.stop(); | 114 | locationDisplayManager.stop(); |
| 112 | graphicsLayer.removeAll(); | 115 | graphicsLayer.removeAll(); |
| 116 | // 恢复初始设置地图范围 | ||
| 113 | mapView.zoomToResolution(AppInfo.initPoint, AppInfo.initRes); | 117 | mapView.zoomToResolution(AppInfo.initPoint, AppInfo.initRes); |
| 114 | curLevel = TDTTileinfo.getCurrentLevel(AppInfo.initRes); | 118 | curLevel = TDTTileinfo.getCurrentLevel(AppInfo.initRes); |
| 115 | mapinfoView.setText("当前地图级别为:" + String.valueOf(curLevel)); | 119 | mapinfoView.setText("当前地图级别为:" + String.valueOf(curLevel)); |
| ... | @@ -120,6 +124,7 @@ public class MainActivity extends AppCompatActivity { | ... | @@ -120,6 +124,7 @@ public class MainActivity extends AppCompatActivity { |
| 120 | gps.setOnClickListener(new View.OnClickListener() { | 124 | gps.setOnClickListener(new View.OnClickListener() { |
| 121 | @Override | 125 | @Override |
| 122 | public void onClick(View view) { | 126 | public void onClick(View view) { |
| 127 | // 设置GPS功能 | ||
| 123 | if (locationDisplayManager.isStarted()) { | 128 | if (locationDisplayManager.isStarted()) { |
| 124 | locationDisplayManager.stop(); | 129 | locationDisplayManager.stop(); |
| 125 | } else { | 130 | } else { |
| ... | @@ -128,6 +133,21 @@ public class MainActivity extends AppCompatActivity { | ... | @@ -128,6 +133,21 @@ public class MainActivity extends AppCompatActivity { |
| 128 | } | 133 | } |
| 129 | } | 134 | } |
| 130 | }); | 135 | }); |
| 136 | final FloatingActionButton search = (FloatingActionButton) findViewById(R.id.search); | ||
| 137 | search.setOnClickListener(new View.OnClickListener() { | ||
| 138 | @Override | ||
| 139 | public void onClick(View view) { | ||
| 140 | if (floatingSearchView.getVisibility() == View.INVISIBLE) { | ||
| 141 | floatingSearchView.setVisibility(View.VISIBLE); | ||
| 142 | search.setImageResource(R.mipmap.ic_find_replace_white_48dp); | ||
| 143 | } else { | ||
| 144 | search.setImageResource(R.mipmap.ic_search_white_48dp); | ||
| 145 | graphicsLayer.removeAll(); | ||
| 146 | floatingSearchView.clearSuggestions(); | ||
| 147 | floatingSearchView.setVisibility(View.INVISIBLE); | ||
| 148 | } | ||
| 149 | } | ||
| 150 | }); | ||
| 131 | //地图初始化------------------------------------------------------------------- | 151 | //地图初始化------------------------------------------------------------------- |
| 132 | ArcGISRuntime.setClientId("1eFHW78avlnRUPHm"); | 152 | ArcGISRuntime.setClientId("1eFHW78avlnRUPHm"); |
| 133 | mapView = (MapView) findViewById(R.id.map); | 153 | mapView = (MapView) findViewById(R.id.map); |
| ... | @@ -195,7 +215,8 @@ public class MainActivity extends AppCompatActivity { | ... | @@ -195,7 +215,8 @@ public class MainActivity extends AppCompatActivity { |
| 195 | locationDisplayManager.setLocationListener(new LocationListener() { | 215 | locationDisplayManager.setLocationListener(new LocationListener() { |
| 196 | @Override | 216 | @Override |
| 197 | public void onLocationChanged(Location location) { | 217 | public void onLocationChanged(Location location) { |
| 198 | mapView.zoomToResolution(new Point(location.getLongitude(), location.getLatitude()), mapView.getResolution()); | 218 | mapView.zoomToResolution(new Point(location.getLongitude(), location.getLatitude()), TDTTileinfo.getRes4490()[18]); |
| 219 | mapinfoView.setText("当前地图级别为:18"); | ||
| 199 | } | 220 | } |
| 200 | 221 | ||
| 201 | @Override | 222 | @Override | ... | ... |
| ... | @@ -30,6 +30,7 @@ | ... | @@ -30,6 +30,7 @@ |
| 30 | android:layout_marginTop="70dp" | 30 | android:layout_marginTop="70dp" |
| 31 | android:layout_marginLeft="16dp" | 31 | android:layout_marginLeft="16dp" |
| 32 | android:layout_marginBottom="16dp" | 32 | android:layout_marginBottom="16dp" |
| 33 | android:visibility="invisible" | ||
| 33 | app:floatingSearch_searchHint="地名地址检索..." | 34 | app:floatingSearch_searchHint="地名地址检索..." |
| 34 | app:floatingSearch_suggestionsListAnimDuration="250" | 35 | app:floatingSearch_suggestionsListAnimDuration="250" |
| 35 | app:floatingSearch_showSearchKey="true" | 36 | app:floatingSearch_showSearchKey="true" |
| ... | @@ -61,6 +62,14 @@ | ... | @@ -61,6 +62,14 @@ |
| 61 | android:layout_marginRight="0dp" | 62 | android:layout_marginRight="0dp" |
| 62 | app:srcCompat="@mipmap/ic_zoom_out_white_48dp" /> | 63 | app:srcCompat="@mipmap/ic_zoom_out_white_48dp" /> |
| 63 | <android.support.design.widget.FloatingActionButton | 64 | <android.support.design.widget.FloatingActionButton |
| 65 | android:id="@+id/search" | ||
| 66 | android:layout_width="wrap_content" | ||
| 67 | android:layout_height="wrap_content" | ||
| 68 | android:layout_gravity="top|end" | ||
| 69 | android:layout_marginTop="16dp" | ||
| 70 | android:layout_marginRight="0dp" | ||
| 71 | app:srcCompat="@mipmap/ic_search_white_48dp" /> | ||
| 72 | <android.support.design.widget.FloatingActionButton | ||
| 64 | android:id="@+id/gps" | 73 | android:id="@+id/gps" |
| 65 | android:layout_width="wrap_content" | 74 | android:layout_width="wrap_content" |
| 66 | android:layout_height="wrap_content" | 75 | android:layout_height="wrap_content" | ... | ... |
622 Bytes
445 Bytes
467 Bytes
465 Bytes
-
Please register or sign in to post a comment