be21d1b2 by chiangbt

修正了lod中的一个问题

1 parent ba979c7f
1 package com.pashanhoo.landsurvey; 1 package com.pashanhoo.landsurvey;
2 2
3 import android.graphics.Color; 3 import android.graphics.Color;
4 import android.support.v7.app.AppCompatActivity;
5 import android.os.Bundle; 4 import android.os.Bundle;
6 import android.util.Log; 5 import android.support.v7.app.AppCompatActivity;
7 import android.widget.Toast;
8 6
9 import com.esri.android.map.GraphicsLayer; 7 import com.esri.android.map.GraphicsLayer;
10 import com.esri.android.map.LocationDisplayManager; 8 import com.esri.android.map.LocationDisplayManager;
...@@ -54,7 +52,7 @@ public class BaiduMapActivity extends AppCompatActivity { ...@@ -54,7 +52,7 @@ public class BaiduMapActivity extends AppCompatActivity {
54 if (status == STATUS.INITIALIZED) { 52 if (status == STATUS.INITIALIZED) {
55 Point curPt = JZLocationConverter.wgs84ToBd09(new Point(121.540614, 29.872488)); 53 Point curPt = JZLocationConverter.wgs84ToBd09(new Point(121.540614, 29.872488));
56 Point pt = GISHelper.lonLat2Mercator(curPt); 54 Point pt = GISHelper.lonLat2Mercator(curPt);
57 mapView.zoomToResolution(new Point(pt.getX() + offsetX, pt.getY() + offsetY), GoogleMapsTiledServiceLayer.getRes()[10]); 55 mapView.zoomToResolution(new Point(pt.getX() + offsetX, pt.getY() + offsetY), GoogleMapsTiledServiceLayer.getRes(10));
58 56
59 SimpleMarkerSymbol sms = new SimpleMarkerSymbol(Color.RED, 15, SimpleMarkerSymbol.STYLE.CIRCLE); 57 SimpleMarkerSymbol sms = new SimpleMarkerSymbol(Color.RED, 15, SimpleMarkerSymbol.STYLE.CIRCLE);
60 Graphic graphic = new Graphic(new Point(pt.getX() + offsetX, pt.getY() + offsetY), sms); 58 Graphic graphic = new Graphic(new Point(pt.getX() + offsetX, pt.getY() + offsetY), sms);
......
...@@ -85,8 +85,8 @@ public class GoogleMapActivity extends AppCompatActivity { ...@@ -85,8 +85,8 @@ public class GoogleMapActivity extends AppCompatActivity {
85 mapView.addLayer(gaodeMapsTiledServiceLayer); 85 mapView.addLayer(gaodeMapsTiledServiceLayer);
86 //--------------------------------------------------------------------------------------------------------------------- 86 //---------------------------------------------------------------------------------------------------------------------
87 87
88 TencentMapsTiledServiceLayer tencentMapsTiledServiceLayer = new TencentMapsTiledServiceLayer(TencentMapLayerTypes.TENCENT_MAP_VECTOR); 88 // TencentMapsTiledServiceLayer tencentMapsTiledServiceLayer = new TencentMapsTiledServiceLayer(TencentMapLayerTypes.TENCENT_MAP_VECTOR);
89 mapView.addLayer(tencentMapsTiledServiceLayer); 89 // mapView.addLayer(tencentMapsTiledServiceLayer);
90 90
91 //--------------------------------------------------------------------------------------------------------------------- 91 //---------------------------------------------------------------------------------------------------------------------
92 // GeoQMapsTiledServiceLayer geoQMapsTiledServiceLayer = new GeoQMapsTiledServiceLayer(GeoQMapLayerTypes.ChinaOnlineCommunity_Mobile); 92 // GeoQMapsTiledServiceLayer geoQMapsTiledServiceLayer = new GeoQMapsTiledServiceLayer(GeoQMapLayerTypes.ChinaOnlineCommunity_Mobile);
...@@ -102,7 +102,7 @@ public class GoogleMapActivity extends AppCompatActivity { ...@@ -102,7 +102,7 @@ public class GoogleMapActivity extends AppCompatActivity {
102 102
103 Point curPt = JZLocationConverter.wgs84ToGcj02(AppInfo.initPoint); 103 Point curPt = JZLocationConverter.wgs84ToGcj02(AppInfo.initPoint);
104 Point pt = GISHelper.lonLat2Mercator(curPt); 104 Point pt = GISHelper.lonLat2Mercator(curPt);
105 mapView.zoomToResolution(pt, GoogleMapsTiledServiceLayer.getRes()[17]); 105 mapView.zoomToResolution(pt, GoogleMapsTiledServiceLayer.getRes(17));
106 106
107 locationDisplayManager = mapView.getLocationDisplayManager(); 107 locationDisplayManager = mapView.getLocationDisplayManager();
108 locationDisplayManager.setShowLocation(true); 108 locationDisplayManager.setShowLocation(true);
...@@ -114,7 +114,7 @@ public class GoogleMapActivity extends AppCompatActivity { ...@@ -114,7 +114,7 @@ public class GoogleMapActivity extends AppCompatActivity {
114 Point pt = new Point(location.getLongitude(), location.getLatitude()); 114 Point pt = new Point(location.getLongitude(), location.getLatitude());
115 Point gcjPt = JZLocationConverter.wgs84ToGcj02(pt); 115 Point gcjPt = JZLocationConverter.wgs84ToGcj02(pt);
116 mapView.zoomToResolution(GISHelper.lonLat2Mercator(gcjPt), 116 mapView.zoomToResolution(GISHelper.lonLat2Mercator(gcjPt),
117 GoogleMapsTiledServiceLayer.getRes()[18]); 117 GoogleMapsTiledServiceLayer.getRes(18));
118 } 118 }
119 119
120 @Override 120 @Override
...@@ -140,7 +140,7 @@ public class GoogleMapActivity extends AppCompatActivity { ...@@ -140,7 +140,7 @@ public class GoogleMapActivity extends AppCompatActivity {
140 } else { 140 } else {
141 locationDisplayManager.start(); 141 locationDisplayManager.start();
142 mapView.zoomToResolution(GISHelper.lonLat2Mercator(locationDisplayManager.getPoint()), 142 mapView.zoomToResolution(GISHelper.lonLat2Mercator(locationDisplayManager.getPoint()),
143 GoogleMapsTiledServiceLayer.getRes()[18]); 143 GoogleMapsTiledServiceLayer.getRes(18));
144 144
145 Point cupt = GISHelper.mercator2lonLat(mapView.getCenter()); 145 Point cupt = GISHelper.mercator2lonLat(mapView.getCenter());
146 Toast.makeText(GoogleMapActivity.this, 146 Toast.makeText(GoogleMapActivity.this,
...@@ -158,7 +158,7 @@ public class GoogleMapActivity extends AppCompatActivity { ...@@ -158,7 +158,7 @@ public class GoogleMapActivity extends AppCompatActivity {
158 158
159 POISuggestion colorSuggestion = (POISuggestion) searchSuggestion; 159 POISuggestion colorSuggestion = (POISuggestion) searchSuggestion;
160 Point poipt = new Point(colorSuggestion.getLng(), colorSuggestion.getLat()); 160 Point poipt = new Point(colorSuggestion.getLng(), colorSuggestion.getLat());
161 mapView.zoomToResolution(GISHelper.lonLat2Mercator(poipt), gaodeMapsTiledServiceLayer.getRes()[19]); 161 mapView.zoomToResolution(GISHelper.lonLat2Mercator(poipt), gaodeMapsTiledServiceLayer.getRes(18));
162 162
163 graphicsLayer.addGraphic(new Graphic(GISHelper.lonLat2Mercator(poipt), 163 graphicsLayer.addGraphic(new Graphic(GISHelper.lonLat2Mercator(poipt),
164 new PictureMarkerSymbol(getResources().getDrawable(R.mipmap.locator)).setOffsetY(16))); 164 new PictureMarkerSymbol(getResources().getDrawable(R.mipmap.locator)).setOffsetY(16)));
......
...@@ -128,7 +128,7 @@ public class MainActivity extends AppCompatActivity { ...@@ -128,7 +128,7 @@ public class MainActivity extends AppCompatActivity {
128 locationDisplayManager.stop(); 128 locationDisplayManager.stop();
129 } else { 129 } else {
130 locationDisplayManager.start(); 130 locationDisplayManager.start();
131 mapView.zoomToResolution(locationDisplayManager.getPoint(), t_vec.getRes()[18]); 131 mapView.zoomToResolution(locationDisplayManager.getPoint(), t_vec.getRes(18));
132 mapinfoView.setText("当前地图级别为:" + String.valueOf(t_vec.getCurrentLevel())); 132 mapinfoView.setText("当前地图级别为:" + String.valueOf(t_vec.getCurrentLevel()));
133 } 133 }
134 } 134 }
...@@ -173,8 +173,8 @@ public class MainActivity extends AppCompatActivity { ...@@ -173,8 +173,8 @@ public class MainActivity extends AppCompatActivity {
173 graphicsLayer = new GraphicsLayer(); 173 graphicsLayer = new GraphicsLayer();
174 mapView.addLayer(graphicsLayer); 174 mapView.addLayer(graphicsLayer);
175 // 设置地图的最小和最大分辨率 175 // 设置地图的最小和最大分辨率
176 mapView.setMaxResolution(t_vec.getRes()[2]); 176 mapView.setMaxResolution(t_vec.getRes(2));
177 mapView.setMinResolution(t_vec.getRes()[19]); 177 mapView.setMinResolution(t_vec.getRes(19));
178 // 监听地图状态变化事件 178 // 监听地图状态变化事件
179 mapView.setOnStatusChangedListener(new OnStatusChangedListener() { 179 mapView.setOnStatusChangedListener(new OnStatusChangedListener() {
180 private static final long serialVersionUID = 1L; 180 private static final long serialVersionUID = 1L;
...@@ -213,7 +213,7 @@ public class MainActivity extends AppCompatActivity { ...@@ -213,7 +213,7 @@ public class MainActivity extends AppCompatActivity {
213 locationDisplayManager.setLocationListener(new LocationListener() { 213 locationDisplayManager.setLocationListener(new LocationListener() {
214 @Override 214 @Override
215 public void onLocationChanged(Location location) { 215 public void onLocationChanged(Location location) {
216 mapView.zoomToResolution(new Point(location.getLongitude(), location.getLatitude()), t_vec.getRes()[18]); 216 mapView.zoomToResolution(new Point(location.getLongitude(), location.getLatitude()), t_vec.getRes(18));
217 mapinfoView.setText("当前地图级别为:" + t_vec.getCurrentLevel()); 217 mapinfoView.setText("当前地图级别为:" + t_vec.getCurrentLevel());
218 } 218 }
219 219
...@@ -238,7 +238,7 @@ public class MainActivity extends AppCompatActivity { ...@@ -238,7 +238,7 @@ public class MainActivity extends AppCompatActivity {
238 238
239 POISuggestion colorSuggestion = (POISuggestion) searchSuggestion; 239 POISuggestion colorSuggestion = (POISuggestion) searchSuggestion;
240 Point poipt = new Point(colorSuggestion.getLng(), colorSuggestion.getLat()); 240 Point poipt = new Point(colorSuggestion.getLng(), colorSuggestion.getLat());
241 mapView.zoomToResolution(poipt, t_vec.getRes()[19]); 241 mapView.zoomToResolution(poipt, t_vec.getRes(19));
242 graphicsLayer.addGraphic(new Graphic(poipt, 242 graphicsLayer.addGraphic(new Graphic(poipt,
243 new PictureMarkerSymbol(getResources().getDrawable(R.mipmap.locator)).setOffsetY(16))); 243 new PictureMarkerSymbol(getResources().getDrawable(R.mipmap.locator)).setOffsetY(16)));
244 mapinfoView.setText("当前地图级别为:" + t_vec.getCurrentLevel()); 244 mapinfoView.setText("当前地图级别为:" + t_vec.getCurrentLevel());
......
...@@ -12,8 +12,6 @@ import com.esri.core.geometry.Point; ...@@ -12,8 +12,6 @@ import com.esri.core.geometry.Point;
12 import com.esri.core.geometry.SpatialReference; 12 import com.esri.core.geometry.SpatialReference;
13 import com.esri.core.internal.io.handler.ResponseListener; 13 import com.esri.core.internal.io.handler.ResponseListener;
14 import com.esri.core.internal.io.handler.a; 14 import com.esri.core.internal.io.handler.a;
15 import com.esri.core.io.UserCredentials;
16 import com.pashanhoo.landsurvey.layers.tencent.TencentMapLayerTypes;
17 import com.pashanhoo.landsurvey.utils.AppInfo; 15 import com.pashanhoo.landsurvey.utils.AppInfo;
18 import com.pashanhoo.landsurvey.utils.GADBHelper; 16 import com.pashanhoo.landsurvey.utils.GADBHelper;
19 17
...@@ -29,7 +27,8 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer { ...@@ -29,7 +27,8 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer {
29 private static final double xmax = 22041257.773878; 27 private static final double xmax = 22041257.773878;
30 private static final double ymax = 20851350.0432886; 28 private static final double ymax = 20851350.0432886;
31 29
32 private static final double[] res = {156543.03392800014, 30 private static final double[] res = {
31 156543.03392800014,
33 78271.516963999937, 32 78271.516963999937,
34 39135.758482000092, 33 39135.758482000092,
35 19567.879240999919, 34 19567.879240999919,
...@@ -50,7 +49,8 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer { ...@@ -50,7 +49,8 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer {
50 0.59716428355981721, 49 0.59716428355981721,
51 0.29858214164761665}; 50 0.29858214164761665};
52 51
53 private static final double[] scale = {591657527.591555, 52 private static final double[] scale = {
53 591657527.591555,
54 295828763.79577702, 54 295828763.79577702,
55 147914381.89788899, 55 147914381.89788899,
56 73957190.948944002, 56 73957190.948944002,
...@@ -101,8 +101,8 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer { ...@@ -101,8 +101,8 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer {
101 } 101 }
102 } 102 }
103 103
104 public static double[] getRes() { 104 public static double getRes(int level) {
105 return res; 105 return res[level];
106 } 106 }
107 107
108 protected void initLayer() { 108 protected void initLayer() {
...@@ -135,23 +135,19 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer { ...@@ -135,23 +135,19 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer {
135 switch (baiduMapLayerTypes) { 135 switch (baiduMapLayerTypes) {
136 case BAIDU_VECTOR: 136 case BAIDU_VECTOR:
137 url = "http://online" + ((col + row) % 8 + 1) + ".map.bdimg.com/onlinelabel/?qt=tile" 137 url = "http://online" + ((col + row) % 8 + 1) + ".map.bdimg.com/onlinelabel/?qt=tile"
138 + "&x=" + (col - offsetV) + "&y=" + (offsetV - row - 1) + "&z=" + (level + 1) 138 + "&x=" + (col - offsetV) + "&y=" + (offsetV - row - 1) + "&z=" + (level + 1) + "&styles=pl";
139 + "&styles=pl";
140 break; 139 break;
141 case BAIDU_IMAGE: 140 case BAIDU_IMAGE:
142 url = "http://shangetu" + ((col + row) % 8 + 1) + ".map.bdimg.com/it/u=" 141 url = "http://shangetu" + ((col + row) % 8 + 1) + ".map.bdimg.com/it/u="
143 + "x=" + (col - offsetV) + ";y=" + (offsetV - row - 1) + ";z=" + (level + 1) 142 + "x=" + (col - offsetV) + ";y=" + (offsetV - row - 1) + ";z=" + (level + 1) + ";v=009;type=sate&fm=46";
144 + ";v=009;type=sate&fm=46";
145 break; 143 break;
146 case BAIDU_ROAD: 144 case BAIDU_ROAD:
147 url = "http://online" + ((col + row) % 8 + 1) + ".map.bdimg.com/onlinelabel/?qt=tile" 145 url = "http://online" + ((col + row) % 8 + 1) + ".map.bdimg.com/onlinelabel/?qt=tile"
148 + "&x=" + (col - offsetV) + "&y=" + (offsetV - row - 1) + "&z=" + (level + 1) 146 + "&x=" + (col - offsetV) + "&y=" + (offsetV - row - 1) + "&z=" + (level + 1) + "&styles=sl";
149 + "&styles=sl";
150 break; 147 break;
151 case BAIDU_TRAFFIC: 148 case BAIDU_TRAFFIC:
152 url = "http://its.map.baidu.com:8002/traffic/TrafficTileService?" 149 url = "http://its.map.baidu.com:8002/traffic/TrafficTileService?"
153 + "level=" + (level + 1) + "&x=" + (col - offsetV) + "&y=" + (offsetV - row - 1) 150 + "level=" + (level + 1) + "&x=" + (col - offsetV) + "&y=" + (offsetV - row - 1) + "&time=" + System.currentTimeMillis();
154 + "&time=" + System.currentTimeMillis();
155 break; 151 break;
156 } 152 }
157 try { 153 try {
...@@ -188,9 +184,6 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer { ...@@ -188,9 +184,6 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer {
188 } 184 }
189 } 185 }
190 186
191 public void reinitializeLayer(UserCredentials usercredentials) {
192 }
193
194 public void reinitializeLayer(String appID) { 187 public void reinitializeLayer(String appID) {
195 super.reinitializeLayer(null); 188 super.reinitializeLayer(null);
196 } 189 }
...@@ -198,7 +191,8 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer { ...@@ -198,7 +191,8 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer {
198 private byte[] getOfflineCacheDB(int level, int col, int row) throws Exception { 191 private byte[] getOfflineCacheDB(int level, int col, int row) throws Exception {
199 192
200 byte[] result = null; 193 byte[] result = null;
201 String sql = "select * from " + this.baiduMapLayerTypes.getName() + " where TILELEVEL = " + level + " and TILECOL = " + col + " and TILEROW = " + row; 194 String sql = "select * from " + this.baiduMapLayerTypes.getName() + " where TILELEVEL = " +
195 level + " and TILECOL = " + col + " and TILEROW = " + row;
202 Cursor mCursor = AppInfo.mapcachedb.rawQuery(sql, null); 196 Cursor mCursor = AppInfo.mapcachedb.rawQuery(sql, null);
203 boolean hasData = false; 197 boolean hasData = false;
204 198
......
...@@ -31,12 +31,8 @@ public class GaodeMapsTiledServiceLayer extends TiledServiceLayer { ...@@ -31,12 +31,8 @@ public class GaodeMapsTiledServiceLayer extends TiledServiceLayer {
31 private static final double xmax = 22041257.773878; 31 private static final double xmax = 22041257.773878;
32 private static final double ymax = 20851350.0432886; 32 private static final double ymax = 20851350.0432886;
33 33
34 private static final double XMin = 110.35992000000005; 34 private static final double[] res = {
35 private static final double YMin = 31.382360000000062; 35 156543.03392800014,
36 private static final double XMax = 116.65036000000009;
37 private static final double YMax = 36.36647000000005;
38
39 private static final double[] res = {156543.03392800014,
40 78271.516963999937, 36 78271.516963999937,
41 39135.758482000092, 37 39135.758482000092,
42 19567.879240999919, 38 19567.879240999919,
...@@ -57,7 +53,8 @@ public class GaodeMapsTiledServiceLayer extends TiledServiceLayer { ...@@ -57,7 +53,8 @@ public class GaodeMapsTiledServiceLayer extends TiledServiceLayer {
57 0.59716428355981721, 53 0.59716428355981721,
58 0.29858214164761665}; 54 0.29858214164761665};
59 55
60 private static final double[] scale = {591657527.591555, 56 private static final double[] scale = {
57 591657527.591555,
61 295828763.79577702, 58 295828763.79577702,
62 147914381.89788899, 59 147914381.89788899,
63 73957190.948944002, 60 73957190.948944002,
...@@ -108,8 +105,8 @@ public class GaodeMapsTiledServiceLayer extends TiledServiceLayer { ...@@ -108,8 +105,8 @@ public class GaodeMapsTiledServiceLayer extends TiledServiceLayer {
108 } 105 }
109 } 106 }
110 107
111 public static double[] getRes() { 108 public static double getRes(int level) {
112 return res; 109 return res[level];
113 } 110 }
114 111
115 protected void initLayer() { 112 protected void initLayer() {
...@@ -203,7 +200,8 @@ public class GaodeMapsTiledServiceLayer extends TiledServiceLayer { ...@@ -203,7 +200,8 @@ public class GaodeMapsTiledServiceLayer extends TiledServiceLayer {
203 private byte[] getOfflineCacheDB(int level, int col, int row) throws Exception { 200 private byte[] getOfflineCacheDB(int level, int col, int row) throws Exception {
204 201
205 byte[] result = null; 202 byte[] result = null;
206 String sql = "select * from " + this.gaodeMapLayerTypes.getName() + " where TILELEVEL = " + level + " and TILECOL = " + col + " and TILEROW = " + row; 203 String sql = "select * from " + this.gaodeMapLayerTypes.getName() + " where TILELEVEL = " +
204 level + " and TILECOL = " + col + " and TILEROW = " + row;
207 Cursor mCursor = AppInfo.mapcachedb.rawQuery(sql, null); 205 Cursor mCursor = AppInfo.mapcachedb.rawQuery(sql, null);
208 boolean hasData = false; 206 boolean hasData = false;
209 207
......
...@@ -33,7 +33,8 @@ public class GeoQMapsTiledServiceLayer extends TiledServiceLayer { ...@@ -33,7 +33,8 @@ public class GeoQMapsTiledServiceLayer extends TiledServiceLayer {
33 private static final double XMax = 116.65036000000009; 33 private static final double XMax = 116.65036000000009;
34 private static final double YMax = 36.36647000000005; 34 private static final double YMax = 36.36647000000005;
35 35
36 private static final double[] res = {156543.03392800014, 36 private static final double[] res = {
37 156543.03392800014,
37 78271.516963999937, 38 78271.516963999937,
38 39135.758482000092, 39 39135.758482000092,
39 19567.879240999919, 40 19567.879240999919,
...@@ -54,7 +55,8 @@ public class GeoQMapsTiledServiceLayer extends TiledServiceLayer { ...@@ -54,7 +55,8 @@ public class GeoQMapsTiledServiceLayer extends TiledServiceLayer {
54 0.59716428355981721, 55 0.59716428355981721,
55 0.29858214164761665}; 56 0.29858214164761665};
56 57
57 private static final double[] scale = {591657527.591555, 58 private static final double[] scale = {
59 591657527.591555,
58 295828763.79577702, 60 295828763.79577702,
59 147914381.89788899, 61 147914381.89788899,
60 73957190.948944002, 62 73957190.948944002,
...@@ -105,8 +107,8 @@ public class GeoQMapsTiledServiceLayer extends TiledServiceLayer { ...@@ -105,8 +107,8 @@ public class GeoQMapsTiledServiceLayer extends TiledServiceLayer {
105 } 107 }
106 } 108 }
107 109
108 public static double[] getRes() { 110 public static double getRes(int level) {
109 return res; 111 return res[level];
110 } 112 }
111 113
112 protected void initLayer() { 114 protected void initLayer() {
......
...@@ -33,7 +33,8 @@ public class GoogleMapsTiledServiceLayer extends TiledServiceLayer { ...@@ -33,7 +33,8 @@ public class GoogleMapsTiledServiceLayer extends TiledServiceLayer {
33 private static final double XMax = 116.65036000000009; 33 private static final double XMax = 116.65036000000009;
34 private static final double YMax = 36.36647000000005; 34 private static final double YMax = 36.36647000000005;
35 35
36 private static final double[] res = {156543.03392800014, 36 private static final double[] res = {
37 156543.03392800014,
37 78271.516963999937, 38 78271.516963999937,
38 39135.758482000092, 39 39135.758482000092,
39 19567.879240999919, 40 19567.879240999919,
...@@ -54,7 +55,8 @@ public class GoogleMapsTiledServiceLayer extends TiledServiceLayer { ...@@ -54,7 +55,8 @@ public class GoogleMapsTiledServiceLayer extends TiledServiceLayer {
54 0.59716428355981721, 55 0.59716428355981721,
55 0.29858214164761665}; 56 0.29858214164761665};
56 57
57 private static final double[] scale = {591657527.591555, 58 private static final double[] scale = {
59 591657527.591555,
58 295828763.79577702, 60 295828763.79577702,
59 147914381.89788899, 61 147914381.89788899,
60 73957190.948944002, 62 73957190.948944002,
...@@ -105,8 +107,8 @@ public class GoogleMapsTiledServiceLayer extends TiledServiceLayer { ...@@ -105,8 +107,8 @@ public class GoogleMapsTiledServiceLayer extends TiledServiceLayer {
105 } 107 }
106 } 108 }
107 109
108 public static double[] getRes() { 110 public static double getRes(int level) {
109 return res; 111 return res[level];
110 } 112 }
111 113
112 protected void initLayer() { 114 protected void initLayer() {
......
...@@ -106,8 +106,8 @@ public class TencentMapsTiledServiceLayer extends TiledServiceLayer { ...@@ -106,8 +106,8 @@ public class TencentMapsTiledServiceLayer extends TiledServiceLayer {
106 } 106 }
107 } 107 }
108 108
109 public static double[] getRes() { 109 public static double getRes(int level) {
110 return res; 110 return res[level];
111 } 111 }
112 112
113 protected void initLayer() { 113 protected void initLayer() {
......
...@@ -118,8 +118,8 @@ public class TianDiTuTiledMapServiceLayer extends TiledServiceLayer { ...@@ -118,8 +118,8 @@ public class TianDiTuTiledMapServiceLayer extends TiledServiceLayer {
118 } 118 }
119 } 119 }
120 120
121 public static double[] getRes() { 121 public static double getRes(int level) {
122 return res; 122 return res[level];
123 } 123 }
124 124
125 public TianDiTuLayerTypes getMapType() { 125 public TianDiTuLayerTypes getMapType() {
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
16 android:layout_width="300dp" 16 android:layout_width="300dp"
17 android:layout_height="match_parent" 17 android:layout_height="match_parent"
18 android:layout_marginTop="10dp" 18 android:layout_marginTop="10dp"
19 android:layout_marginRight="16dp"
19 android:layout_marginLeft="16dp" 20 android:layout_marginLeft="16dp"
20 android:layout_marginBottom="16dp" 21 android:layout_marginBottom="16dp"
21 android:visibility="visible" 22 android:visibility="visible"
...@@ -29,15 +30,16 @@ ...@@ -29,15 +30,16 @@
29 android:layout_width="match_parent" 30 android:layout_width="match_parent"
30 android:layout_height="match_parent" 31 android:layout_height="match_parent"
31 android:orientation="vertical" 32 android:orientation="vertical"
32 android:layout_marginTop="76dp" 33 android:layout_marginTop="10dp"
33 android:layout_marginLeft="16dp" 34 android:layout_marginLeft="16dp"
35 android:layout_marginRight="16dp"
34 android:layout_marginBottom="16dp" 36 android:layout_marginBottom="16dp"
35 android:layout_gravity="top|start"> 37 android:layout_gravity="top|start">
36 <android.support.design.widget.FloatingActionButton 38 <android.support.design.widget.FloatingActionButton
37 android:id="@+id/gps" 39 android:id="@+id/gps"
38 android:layout_width="wrap_content" 40 android:layout_width="wrap_content"
39 android:layout_height="wrap_content" 41 android:layout_height="wrap_content"
40 android:layout_gravity="top|start" 42 android:layout_gravity="bottom|end"
41 android:layout_marginTop="0dp" 43 android:layout_marginTop="0dp"
42 android:layout_marginLeft="0dp" 44 android:layout_marginLeft="0dp"
43 app:srcCompat="@mipmap/ic_my_location_white_48dp" /> 45 app:srcCompat="@mipmap/ic_my_location_white_48dp" />
......