标注更新
Showing
7 changed files
with
63 additions
and
26 deletions
| ... | @@ -24,15 +24,14 @@ | ... | @@ -24,15 +24,14 @@ |
| 24 | android:theme="@style/AppTheme.NoActionBar"> <!-- 禁止屏幕旋转 --> | 24 | android:theme="@style/AppTheme.NoActionBar"> <!-- 禁止屏幕旋转 --> |
| 25 | </activity> | 25 | </activity> |
| 26 | <activity android:name=".GoogleMapActivity"> | 26 | <activity android:name=".GoogleMapActivity"> |
| 27 | |||
| 28 | </activity> | ||
| 29 | <activity android:name=".BaiduMapActivity"> | ||
| 27 | <intent-filter> | 30 | <intent-filter> |
| 28 | <action android:name="android.intent.action.MAIN" /> | 31 | <action android:name="android.intent.action.MAIN" /> |
| 29 | |||
| 30 | <category android:name="android.intent.category.LAUNCHER" /> | 32 | <category android:name="android.intent.category.LAUNCHER" /> |
| 31 | </intent-filter> | 33 | </intent-filter> |
| 32 | </activity> | 34 | </activity> |
| 33 | <activity android:name=".BaiduMapActivity"> | ||
| 34 | |||
| 35 | </activity> | ||
| 36 | </application> | 35 | </application> |
| 37 | 36 | ||
| 38 | </manifest> | 37 | </manifest> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -2,6 +2,7 @@ package com.pashanhoo.landsurvey; | ... | @@ -2,6 +2,7 @@ package com.pashanhoo.landsurvey; |
| 2 | 2 | ||
| 3 | import android.support.v7.app.AppCompatActivity; | 3 | import android.support.v7.app.AppCompatActivity; |
| 4 | import android.os.Bundle; | 4 | import android.os.Bundle; |
| 5 | import android.util.Log; | ||
| 5 | import android.widget.Toast; | 6 | import android.widget.Toast; |
| 6 | 7 | ||
| 7 | import com.esri.android.map.LocationDisplayManager; | 8 | import com.esri.android.map.LocationDisplayManager; |
| ... | @@ -42,12 +43,17 @@ public class BaiduMapActivity extends AppCompatActivity { | ... | @@ -42,12 +43,17 @@ public class BaiduMapActivity extends AppCompatActivity { |
| 42 | public void onStatusChanged(Object o, STATUS status) { | 43 | public void onStatusChanged(Object o, STATUS status) { |
| 43 | if(status == STATUS.INITIALIZED){ | 44 | if(status == STATUS.INITIALIZED){ |
| 44 | Point curPt = JZLocationConverter.wgs84ToGcj02(AppInfo.initPoint); | 45 | Point curPt = JZLocationConverter.wgs84ToGcj02(AppInfo.initPoint); |
| 46 | Log.i("baidu", curPt.getX() + ":" + curPt.getY()); | ||
| 45 | Point pt = GISHelper.lonLat2Mercator(curPt); | 47 | Point pt = GISHelper.lonLat2Mercator(curPt); |
| 46 | mapView.zoomToResolution(pt, BaiduMapsTiledServiceLayer.getRes()[10]); | 48 | Log.i("baidu2", pt.getX()+":"+pt.getY()); |
| 49 | // mapView.zoomToResolution(pt, BaiduMapsTiledServiceLayer.getRes()[10]); | ||
| 47 | 50 | ||
| 48 | Toast.makeText(BaiduMapActivity.this, | 51 | Toast.makeText(BaiduMapActivity.this, |
| 49 | mapView.getCenter().getX() + ":" + mapView.getCenter().getY(), | 52 | mapView.getCenter().getX() + ":" + mapView.getCenter().getY(), |
| 50 | Toast.LENGTH_LONG).show(); | 53 | Toast.LENGTH_LONG).show(); |
| 54 | |||
| 55 | mapView.zoomTo(pt, (float) 50.10); | ||
| 56 | // mapView.centerAndZoom(curPt.getY(), curPt.getX(), 6); | ||
| 51 | } | 57 | } |
| 52 | } | 58 | } |
| 53 | }); | 59 | }); | ... | ... |
| ... | @@ -33,7 +33,8 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer { | ... | @@ -33,7 +33,8 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer { |
| 33 | private static final double xmax = 20037508.3427892; | 33 | private static final double xmax = 20037508.3427892; |
| 34 | private static final double ymax = 20037508.3427892; | 34 | private static final double ymax = 20037508.3427892; |
| 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 BaiduMapsTiledServiceLayer extends TiledServiceLayer { | ... | @@ -54,7 +55,8 @@ public class BaiduMapsTiledServiceLayer 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, |
| ... | @@ -130,16 +132,15 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer { | ... | @@ -130,16 +132,15 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer { |
| 130 | @SuppressLint("DefaultLocale") | 132 | @SuppressLint("DefaultLocale") |
| 131 | protected byte[] getTile(int level, int col, int row) throws Exception { | 133 | protected byte[] getTile(int level, int col, int row) throws Exception { |
| 132 | byte[] result = null; | 134 | byte[] result = null; |
| 133 | Log.i("baidu", level + "/"+col+"/"+row); | ||
| 134 | String url = ""; | 135 | String url = ""; |
| 135 | String s = "Galil"; | 136 | String s = "Galil"; |
| 136 | 137 | ||
| 137 | int zoom = level - 1; | 138 | // int zoom = level - 1; |
| 138 | int offsetX = (int)Math.pow(2, level - 1); | 139 | int offsetX = (int)Math.pow(2, level - 1); |
| 139 | int offsetY = offsetX - 1; | 140 | // int offsetY = offsetX - 1; |
| 140 | int numX = col - (int)Math.pow(2, level - 1); | 141 | int numX = col - offsetX; |
| 141 | int numY = (-row) + offsetY; | 142 | int numY = offsetX - row - 1 ; |
| 142 | zoom = level + 1; | 143 | int zoom = level + 1; |
| 143 | int num = (col + row) % 8 + 1; | 144 | int num = (col + row) % 8 + 1; |
| 144 | num = 2; | 145 | num = 2; |
| 145 | 146 | ||
| ... | @@ -153,13 +154,11 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer { | ... | @@ -153,13 +154,11 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer { |
| 153 | break; | 154 | break; |
| 154 | case BAIDU_IMAGE: | 155 | case BAIDU_IMAGE: |
| 155 | url = "http://shangetu" + ((col + row) % 8 + 1) + ".map.bdimg.com/it/u=" | 156 | url = "http://shangetu" + ((col + row) % 8 + 1) + ".map.bdimg.com/it/u=" |
| 156 | + "x=" + numX + ";y=" + numY+ ";z=" + zoom | 157 | + "x=" + numX + ";y=" + numY+ ";z=" + zoom + ";v=009;type=sate&fm=46"; |
| 157 | + ";v=009;type=sate&fm=46"; | ||
| 158 | break; | 158 | break; |
| 159 | case BAIDU_TRAFFIC: | 159 | case BAIDU_TRAFFIC: |
| 160 | url = "http://its.map.baidu.com:8002/traffic/TrafficTileService?" | 160 | url = "http://its.map.baidu.com:8002/traffic/TrafficTileService?" |
| 161 | + "level=" + zoom + "&x=" + numX + "&y=" + numY | 161 | + "level=" + zoom + "&x=" + numX + "&y=" + numY + "&time=" + System.currentTimeMillis(); |
| 162 | + "&time=" + System.currentTimeMillis(); | ||
| 163 | break; | 162 | break; |
| 164 | } | 163 | } |
| 165 | Log.i("baidu", url); | 164 | Log.i("baidu", url); | ... | ... |
| ... | @@ -4,17 +4,32 @@ import com.pashanhoo.landsurvey.layers.BaseTiledMapServiceType; | ... | @@ -4,17 +4,32 @@ import com.pashanhoo.landsurvey.layers.BaseTiledMapServiceType; |
| 4 | 4 | ||
| 5 | public enum GeoQMapLayerTypes implements BaseTiledMapServiceType { | 5 | public enum GeoQMapLayerTypes implements BaseTiledMapServiceType { |
| 6 | 6 | ||
| 7 | /** * Google vector map service by city map*/ | 7 | /** |
| 8 | * * ChinaOnlineCommunity | ||
| 9 | * */ | ||
| 8 | ChinaOnlineCommunity, | 10 | ChinaOnlineCommunity, |
| 9 | /** * Google image map service by satellite map */ | 11 | /** |
| 12 | * ChinaOnlineCommunity_Mobile | ||
| 13 | */ | ||
| 10 | ChinaOnlineCommunity_Mobile, | 14 | ChinaOnlineCommunity_Mobile, |
| 11 | /** * Google topographic map service ======= topographic map */ | 15 | /** |
| 16 | * ChinaOnlineCommunityENG | ||
| 17 | */ | ||
| 12 | ChinaOnlineCommunityENG, | 18 | ChinaOnlineCommunityENG, |
| 13 | 19 | ||
| 20 | /** | ||
| 21 | * ChinaOnlineStreetGray | ||
| 22 | */ | ||
| 14 | ChinaOnlineStreetGray, | 23 | ChinaOnlineStreetGray, |
| 15 | 24 | ||
| 25 | /** | ||
| 26 | * ChinaOnlineStreetPurplishBlue | ||
| 27 | */ | ||
| 16 | ChinaOnlineStreetPurplishBlue, | 28 | ChinaOnlineStreetPurplishBlue, |
| 17 | 29 | ||
| 30 | /** | ||
| 31 | * ChinaOnlineStreetWarm | ||
| 32 | */ | ||
| 18 | ChinaOnlineStreetWarm; | 33 | ChinaOnlineStreetWarm; |
| 19 | 34 | ||
| 20 | @Override | 35 | @Override | ... | ... |
| ... | @@ -8,15 +8,26 @@ import com.pashanhoo.landsurvey.layers.BaseTiledMapServiceType; | ... | @@ -8,15 +8,26 @@ import com.pashanhoo.landsurvey.layers.BaseTiledMapServiceType; |
| 8 | 8 | ||
| 9 | public enum GoogleMapLayerTypes implements BaseTiledMapServiceType { | 9 | public enum GoogleMapLayerTypes implements BaseTiledMapServiceType { |
| 10 | 10 | ||
| 11 | /** * Google vector map service by city map*/ | 11 | /** |
| 12 | * * Google vector map service by city map | ||
| 13 | * */ | ||
| 12 | VECTOR_GOOGLE_MAP, | 14 | VECTOR_GOOGLE_MAP, |
| 13 | /** * Google image map service by satellite map */ | 15 | /** |
| 16 | * * Google image map service by satellite map | ||
| 17 | * */ | ||
| 14 | IMAGE_GOOGLE_MAP, | 18 | IMAGE_GOOGLE_MAP, |
| 15 | /** * Google topographic map service ======= topographic map */ | 19 | /** |
| 20 | * * Google topographic map service ======= topographic map | ||
| 21 | * */ | ||
| 16 | TERRAIN_GOOGLE_MAP, | 22 | TERRAIN_GOOGLE_MAP, |
| 17 | /** * Google road POI map service = = = = net road map */ | 23 | /** |
| 24 | * * Google road POI map service = = = = net road map | ||
| 25 | * */ | ||
| 18 | IMAGE_ANNO_GOOGLE_MAP, | 26 | IMAGE_ANNO_GOOGLE_MAP, |
| 19 | 27 | ||
| 28 | /** | ||
| 29 | * OSM | ||
| 30 | */ | ||
| 20 | OSM_Map; | 31 | OSM_Map; |
| 21 | 32 | ||
| 22 | @Override | 33 | @Override | ... | ... |
| ... | @@ -8,6 +8,9 @@ public enum TencentMapLayerTypes implements BaseTiledMapServiceType { | ... | @@ -8,6 +8,9 @@ public enum TencentMapLayerTypes implements BaseTiledMapServiceType { |
| 8 | */ | 8 | */ |
| 9 | TENCENT_MAP_VECTOR, | 9 | TENCENT_MAP_VECTOR, |
| 10 | 10 | ||
| 11 | /** | ||
| 12 | * 腾讯矢量夜间图层(含路网,含注记) | ||
| 13 | */ | ||
| 11 | TENCENT_MAP_VECTOR_NIGHT, | 14 | TENCENT_MAP_VECTOR_NIGHT, |
| 12 | /** | 15 | /** |
| 13 | * 腾讯影像图层(不含路网,不含注记) | 16 | * 腾讯影像图层(不含路网,不含注记) | ... | ... |
| ... | @@ -24,9 +24,13 @@ public enum TianDiTuLayerTypes implements BaseTiledMapServiceType { | ... | @@ -24,9 +24,13 @@ public enum TianDiTuLayerTypes implements BaseTiledMapServiceType { |
| 24 | * 影像注记 | 24 | * 影像注记 |
| 25 | * */ | 25 | * */ |
| 26 | CIA_C, | 26 | CIA_C, |
| 27 | 27 | /** | |
| 28 | * 地形数据 | ||
| 29 | */ | ||
| 28 | TER_C, | 30 | TER_C, |
| 29 | 31 | /** | |
| 32 | * 地形注记 | ||
| 33 | */ | ||
| 30 | CTA_C; | 34 | CTA_C; |
| 31 | 35 | ||
| 32 | public void setName() | 36 | public void setName() | ... | ... |
-
Please register or sign in to post a comment