更新说明信息
Showing
6 changed files
with
37 additions
and
39 deletions
... | @@ -22,13 +22,13 @@ | ... | @@ -22,13 +22,13 @@ |
22 | android:label="@string/app_name" | 22 | android:label="@string/app_name" |
23 | android:screenOrientation="landscape" | 23 | android:screenOrientation="landscape" |
24 | android:theme="@style/AppTheme.NoActionBar"> <!-- 禁止屏幕旋转 --> | 24 | android:theme="@style/AppTheme.NoActionBar"> <!-- 禁止屏幕旋转 --> |
25 | </activity> | ||
26 | <activity android:name=".GoogleMapActivity"> | ||
25 | <intent-filter> | 27 | <intent-filter> |
26 | <action android:name="android.intent.action.MAIN" /> | 28 | <action android:name="android.intent.action.MAIN" /> |
27 | |||
28 | <category android:name="android.intent.category.LAUNCHER" /> | 29 | <category android:name="android.intent.category.LAUNCHER" /> |
29 | </intent-filter> | 30 | </intent-filter> |
30 | </activity> | 31 | </activity> |
31 | <activity android:name=".GoogleMapActivity"></activity> | ||
32 | <activity android:name=".BaiduMapActivity"></activity> | 32 | <activity android:name=".BaiduMapActivity"></activity> |
33 | </application> | 33 | </application> |
34 | 34 | ... | ... |
... | @@ -64,29 +64,34 @@ public class GoogleMapActivity extends AppCompatActivity { | ... | @@ -64,29 +64,34 @@ public class GoogleMapActivity extends AppCompatActivity { |
64 | mapView.setEsriLogoVisible(false); | 64 | mapView.setEsriLogoVisible(false); |
65 | mapView.enableWrapAround(false); | 65 | mapView.enableWrapAround(false); |
66 | 66 | ||
67 | // GoogleMapsTiledServiceLayer GOOGLE_VECTOR_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.VECTOR_GOOGLE_MAP); | 67 | /** |
68 | // GoogleMapsTiledServiceLayer GOOGLE_TER_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.TERRAIN_GOOGLE_MAP); | 68 | GoogleMapsTiledServiceLayer GOOGLE_VECTOR_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.VECTOR_GOOGLE_MAP); |
69 | // GoogleMapsTiledServiceLayer GOOGLE_IMAGE_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.IMAGE_GOOGLE_MAP); | 69 | GoogleMapsTiledServiceLayer GOOGLE_TER_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.TERRAIN_GOOGLE_MAP); |
70 | // mapView.addLayer(GOOGLE_IMAGE_Layer); | 70 | GoogleMapsTiledServiceLayer GOOGLE_IMAGE_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.IMAGE_GOOGLE_MAP); |
71 | // GoogleMapsTiledServiceLayer GOOGLE_ANNO_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.IMAGE_ANNO_GOOGLE_MAP); | 71 | mapView.addLayer(GOOGLE_IMAGE_Layer); |
72 | // mapView.addLayer(GOOGLE_ANNO_Layer); | 72 | GoogleMapsTiledServiceLayer GOOGLE_ANNO_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.IMAGE_ANNO_GOOGLE_MAP); |
73 | // GoogleMapsTiledServiceLayer OSM_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.OSM_Map); | 73 | mapView.addLayer(GOOGLE_ANNO_Layer); |
74 | // mapView.addLayer(GOOGLE_VECTOR_Layer); | 74 | GoogleMapsTiledServiceLayer OSM_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.OSM_Map); |
75 | 75 | mapView.addLayer(GOOGLE_VECTOR_Layer); | |
76 | //--------------------------------------------------------------------------------------------------------------------- | 76 | */ |
77 | |||
78 | /** | ||
77 | // 高德矢量图层(含路网,含注记) | 79 | // 高德矢量图层(含路网,含注记) |
78 | final GaodeMapsTiledServiceLayer gaodeMapsTiledServiceLayer = new GaodeMapsTiledServiceLayer(GaodeMapLayerTypes.AMAP_VECTOR); | 80 | final GaodeMapsTiledServiceLayer gaodeMapsTiledServiceLayer = new GaodeMapsTiledServiceLayer(GaodeMapLayerTypes.AMAP_VECTOR); |
79 | // 高德影像图层(不含路网,不含注记) | 81 | // 高德影像图层(不含路网,不含注记) |
80 | // GaodeMapsTiledServiceLayer gaodeMapsTiledServiceLayer = new GaodeMapsTiledServiceLayer(GaodeMapLayerTypes.AMAP_IMAGE); | 82 | GaodeMapsTiledServiceLayer gaodeMapsTiledServiceLayer = new GaodeMapsTiledServiceLayer(GaodeMapLayerTypes.AMAP_IMAGE); |
81 | // 高德路网图层(含路网,含注记) | 83 | // 高德路网图层(含路网,含注记) |
82 | // GaodeMapsTiledServiceLayer gaodeMapsTiledServiceLayer = new GaodeMapsTiledServiceLayer(GaodeMapLayerTypes.AMAP_ROAD); | 84 | GaodeMapsTiledServiceLayer gaodeMapsTiledServiceLayer = new GaodeMapsTiledServiceLayer(GaodeMapLayerTypes.AMAP_ROAD); |
83 | // 高德实时交通图层 | 85 | // 高德实时交通图层 |
84 | // GaodeMapsTiledServiceLayer gaodeMapsTiledServiceLayer = new GaodeMapsTiledServiceLayer(GaodeMapLayerTypes.AMAP_TRAFFIC); | 86 | GaodeMapsTiledServiceLayer gaodeMapsTiledServiceLayer = new GaodeMapsTiledServiceLayer(GaodeMapLayerTypes.AMAP_TRAFFIC); |
85 | mapView.addLayer(gaodeMapsTiledServiceLayer); | 87 | mapView.addLayer(gaodeMapsTiledServiceLayer); |
86 | //--------------------------------------------------------------------------------------------------------------------- | 88 | */ |
89 | |||
87 | 90 | ||
88 | // TencentMapsTiledServiceLayer tencentMapsTiledServiceLayer = new TencentMapsTiledServiceLayer(TencentMapLayerTypes.TENCENT_MAP_VECTOR); | 91 | TencentMapsTiledServiceLayer tencentMapsTiledServiceLayer = new TencentMapsTiledServiceLayer(TencentMapLayerTypes.TENCENT_MAP_TERRAIN); |
89 | // mapView.addLayer(tencentMapsTiledServiceLayer); | 92 | TencentMapsTiledServiceLayer tencentMapsTiledServiceLayer2 = new TencentMapsTiledServiceLayer(TencentMapLayerTypes.TENCENT_MAP_ROAD); |
93 | mapView.addLayer(tencentMapsTiledServiceLayer); | ||
94 | mapView.addLayer(tencentMapsTiledServiceLayer2); | ||
90 | 95 | ||
91 | //--------------------------------------------------------------------------------------------------------------------- | 96 | //--------------------------------------------------------------------------------------------------------------------- |
92 | // GeoQMapsTiledServiceLayer geoQMapsTiledServiceLayer = new GeoQMapsTiledServiceLayer(GeoQMapLayerTypes.ChinaOnlineCommunity_Mobile); | 97 | // GeoQMapsTiledServiceLayer geoQMapsTiledServiceLayer = new GeoQMapsTiledServiceLayer(GeoQMapLayerTypes.ChinaOnlineCommunity_Mobile); |
... | @@ -96,13 +101,13 @@ public class GoogleMapActivity extends AppCompatActivity { | ... | @@ -96,13 +101,13 @@ public class GoogleMapActivity extends AppCompatActivity { |
96 | graphicsLayer = new GraphicsLayer(); | 101 | graphicsLayer = new GraphicsLayer(); |
97 | mapView.addLayer(graphicsLayer); | 102 | mapView.addLayer(graphicsLayer); |
98 | 103 | ||
99 | mapView.setMaxResolution(156543.03392800014); | 104 | mapView.setMaxResolution(TencentMapsTiledServiceLayer.getRes(2)); |
100 | mapView.setMinResolution(0.29858214164761665); | 105 | mapView.setMinResolution(TencentMapsTiledServiceLayer.getRes(18)); |
101 | 106 | ||
102 | 107 | ||
103 | Point curPt = JZLocationConverter.wgs84ToGcj02(AppInfo.initPoint); | 108 | Point curPt = JZLocationConverter.wgs84ToGcj02(AppInfo.initPoint); |
104 | Point pt = GISHelper.lonLat2Mercator(curPt); | 109 | Point pt = GISHelper.lonLat2Mercator(curPt); |
105 | mapView.zoomToResolution(pt, GoogleMapsTiledServiceLayer.getRes(17)); | 110 | mapView.zoomToResolution(pt, TencentMapsTiledServiceLayer.getRes(14)); |
106 | 111 | ||
107 | locationDisplayManager = mapView.getLocationDisplayManager(); | 112 | locationDisplayManager = mapView.getLocationDisplayManager(); |
108 | locationDisplayManager.setShowLocation(true); | 113 | locationDisplayManager.setShowLocation(true); |
... | @@ -158,7 +163,7 @@ public class GoogleMapActivity extends AppCompatActivity { | ... | @@ -158,7 +163,7 @@ public class GoogleMapActivity extends AppCompatActivity { |
158 | 163 | ||
159 | POISuggestion colorSuggestion = (POISuggestion) searchSuggestion; | 164 | POISuggestion colorSuggestion = (POISuggestion) searchSuggestion; |
160 | Point poipt = new Point(colorSuggestion.getLng(), colorSuggestion.getLat()); | 165 | Point poipt = new Point(colorSuggestion.getLng(), colorSuggestion.getLat()); |
161 | mapView.zoomToResolution(GISHelper.lonLat2Mercator(poipt), gaodeMapsTiledServiceLayer.getRes(18)); | 166 | mapView.zoomToResolution(GISHelper.lonLat2Mercator(poipt), TencentMapsTiledServiceLayer.getRes(18)); |
162 | 167 | ||
163 | graphicsLayer.addGraphic(new Graphic(GISHelper.lonLat2Mercator(poipt), | 168 | graphicsLayer.addGraphic(new Graphic(GISHelper.lonLat2Mercator(poipt), |
164 | new PictureMarkerSymbol(getResources().getDrawable(R.mipmap.locator)).setOffsetY(16))); | 169 | new PictureMarkerSymbol(getResources().getDrawable(R.mipmap.locator)).setOffsetY(16))); | ... | ... |
... | @@ -20,7 +20,7 @@ public enum TencentMapLayerTypes implements BaseTiledMapServiceType { | ... | @@ -20,7 +20,7 @@ public enum TencentMapLayerTypes implements BaseTiledMapServiceType { |
20 | */ | 20 | */ |
21 | TENCENT_MAP_ROAD, | 21 | TENCENT_MAP_ROAD, |
22 | /** | 22 | /** |
23 | * 腾讯实时 | 23 | * 腾讯地形层 |
24 | */ | 24 | */ |
25 | TENCENT_MAP_TERRAIN; | 25 | TENCENT_MAP_TERRAIN; |
26 | 26 | ... | ... |
... | @@ -28,11 +28,6 @@ public class TencentMapsTiledServiceLayer extends TiledServiceLayer { | ... | @@ -28,11 +28,6 @@ public class TencentMapsTiledServiceLayer extends TiledServiceLayer { |
28 | private static final double xmax = 22041257.773878; | 28 | private static final double xmax = 22041257.773878; |
29 | private static final double ymax = 20851350.0432886; | 29 | private static final double ymax = 20851350.0432886; |
30 | 30 | ||
31 | private static final double XMin = 110.35992000000005; | ||
32 | private static final double YMin = 31.382360000000062; | ||
33 | private static final double XMax = 116.65036000000009; | ||
34 | private static final double YMax = 36.36647000000005; | ||
35 | |||
36 | private static final double[] res = { | 31 | private static final double[] res = { |
37 | 156543.03392800014, | 32 | 156543.03392800014, |
38 | 78271.516963999937, | 33 | 78271.516963999937, |
... | @@ -75,7 +70,8 @@ public class TencentMapsTiledServiceLayer extends TiledServiceLayer { | ... | @@ -75,7 +70,8 @@ public class TencentMapsTiledServiceLayer extends TiledServiceLayer { |
75 | 9027.9774109999998, | 70 | 9027.9774109999998, |
76 | 4513.9887049999998, | 71 | 4513.9887049999998, |
77 | 2256.994353, | 72 | 2256.994353, |
78 | 1128.497176}; | 73 | 1128.497176 |
74 | }; | ||
79 | 75 | ||
80 | private static String URL = "http://maps.iwxlh.com"; | 76 | private static String URL = "http://maps.iwxlh.com"; |
81 | private static Point origin = new Point(-20037508.342787, 20037508.342787); | 77 | private static Point origin = new Point(-20037508.342787, 20037508.342787); |
... | @@ -138,8 +134,7 @@ public class TencentMapsTiledServiceLayer extends TiledServiceLayer { | ... | @@ -138,8 +134,7 @@ public class TencentMapsTiledServiceLayer extends TiledServiceLayer { |
138 | switch (tencentMapLayerTypes) { | 134 | switch (tencentMapLayerTypes) { |
139 | case TENCENT_MAP_VECTOR: | 135 | case TENCENT_MAP_VECTOR: |
140 | url = "http://rt" + (col % 4) + ".map.gtimg.com/tile?" | 136 | url = "http://rt" + (col % 4) + ".map.gtimg.com/tile?" |
141 | + "z=" + level + "&x=" + col + "&y=" + row | 137 | + "z=" + level + "&x=" + col + "&y=" + row + "&type=vector&styleid=0"; |
142 | + "&type=vector&styleid=0"; | ||
143 | break; | 138 | break; |
144 | case TENCENT_MAP_IMAGE: | 139 | case TENCENT_MAP_IMAGE: |
145 | url = "http://p" + (col % 4) + ".map.gtimg.com/sateTiles/" + level + "/" + (int) Math.floor(col / 16) + "/" + (int) Math.floor(row / 16) | 140 | url = "http://p" + (col % 4) + ".map.gtimg.com/sateTiles/" + level + "/" + (int) Math.floor(col / 16) + "/" + (int) Math.floor(row / 16) |
... | @@ -147,8 +142,7 @@ public class TencentMapsTiledServiceLayer extends TiledServiceLayer { | ... | @@ -147,8 +142,7 @@ public class TencentMapsTiledServiceLayer extends TiledServiceLayer { |
147 | break; | 142 | break; |
148 | case TENCENT_MAP_ROAD: | 143 | case TENCENT_MAP_ROAD: |
149 | url = "http://rt" + (col % 4) + ".map.gtimg.com/tile?" | 144 | url = "http://rt" + (col % 4) + ".map.gtimg.com/tile?" |
150 | + "z=" + level + "&x=" + col + "&y=" + row | 145 | + "z=" + level + "&x=" + col + "&y=" + row + "&type=vector&styleid=3"; |
151 | + "&type=vector&styleid=3"; | ||
152 | break; | 146 | break; |
153 | case TENCENT_MAP_TERRAIN: | 147 | case TENCENT_MAP_TERRAIN: |
154 | url = "http://p" + (col % 4) + ".map.gtimg.com/demTiles/" + level + "/" + (int) Math.floor(col / 16) + "/" + (int) Math.floor(row / 16) | 148 | url = "http://p" + (col % 4) + ".map.gtimg.com/demTiles/" + level + "/" + (int) Math.floor(col / 16) + "/" + (int) Math.floor(row / 16) |
... | @@ -156,8 +150,7 @@ public class TencentMapsTiledServiceLayer extends TiledServiceLayer { | ... | @@ -156,8 +150,7 @@ public class TencentMapsTiledServiceLayer extends TiledServiceLayer { |
156 | break; | 150 | break; |
157 | case TENCENT_MAP_VECTOR_NIGHT: | 151 | case TENCENT_MAP_VECTOR_NIGHT: |
158 | url = "http://rt" + (col % 4) + ".map.gtimg.com/tile?" | 152 | url = "http://rt" + (col % 4) + ".map.gtimg.com/tile?" |
159 | + "z=" + level + "&x=" + col + "&y=" + row | 153 | + "z=" + level + "&x=" + col + "&y=" + row + "&type=vector&styleid=4"; |
160 | + "&type=vector&styleid=4"; | ||
161 | break; | 154 | break; |
162 | } | 155 | } |
163 | try { | 156 | try { | ... | ... |
... | @@ -5,10 +5,11 @@ import android.os.Environment; | ... | @@ -5,10 +5,11 @@ import android.os.Environment; |
5 | import android.util.Log; | 5 | import android.util.Log; |
6 | 6 | ||
7 | import com.esri.core.geometry.Point; | 7 | import com.esri.core.geometry.Point; |
8 | import com.pashanhoo.landsurvey.layers.tianditu.TianDiTuLocalTiledMapServiceLayer; | 8 | import com.pashanhoo.landsurvey.layers.tencent.TencentMapsTiledServiceLayer; |
9 | import com.pashanhoo.landsurvey.layers.tianditu.TianDiTuTiledMapServiceLayer; | 9 | import com.pashanhoo.landsurvey.layers.tianditu.TianDiTuTiledMapServiceLayer; |
10 | 10 | ||
11 | import java.io.File; | 11 | import java.io.File; |
12 | import java.util.ArrayList; | ||
12 | 13 | ||
13 | /** | 14 | /** |
14 | * Created by jiangbotao on 2018/3/23. | 15 | * Created by jiangbotao on 2018/3/23. |
... | @@ -24,8 +25,7 @@ public class AppInfo { | ... | @@ -24,8 +25,7 @@ public class AppInfo { |
24 | public static Point initPoint = new Point(118.778644, 32.05212); | 25 | public static Point initPoint = new Point(118.778644, 32.05212); |
25 | 26 | ||
26 | public static double initRes = TianDiTuTiledMapServiceLayer.getRes(17); | 27 | public static double initRes = TianDiTuTiledMapServiceLayer.getRes(17); |
27 | // public static double initRes = TDTTileinfo.getRes4326()[6]; | 28 | public static double initRes3857 = TencentMapsTiledServiceLayer.getRes(17); |
28 | |||
29 | 29 | ||
30 | public static void Settings(){ | 30 | public static void Settings(){ |
31 | // 新建地图缓存数据库,不要试图新建多级目录,切记切记,如keymapinfo/cache | 31 | // 新建地图缓存数据库,不要试图新建多级目录,切记切记,如keymapinfo/cache | ... | ... |
... | @@ -49,7 +49,7 @@ | ... | @@ -49,7 +49,7 @@ |
49 | android:layout_width="wrap_content" | 49 | android:layout_width="wrap_content" |
50 | android:layout_height="wrap_content" | 50 | android:layout_height="wrap_content" |
51 | android:src="@drawable/epsg_target" | 51 | android:src="@drawable/epsg_target" |
52 | android:tint="@color/colorAccent" | 52 | android:tint="@color/colorRed" |
53 | app:layout_constraintStart_toStartOf="parent" | 53 | app:layout_constraintStart_toStartOf="parent" |
54 | app:layout_constraintEnd_toEndOf="parent" | 54 | app:layout_constraintEnd_toEndOf="parent" |
55 | app:layout_constraintBottom_toBottomOf="parent" | 55 | app:layout_constraintBottom_toBottomOf="parent" | ... | ... |
-
Please register or sign in to post a comment