68b3626a by chiangbt

标注更新

1 parent 44ea6c1a
......@@ -24,15 +24,14 @@
android:theme="@style/AppTheme.NoActionBar"> <!-- 禁止屏幕旋转 -->
</activity>
<activity android:name=".GoogleMapActivity">
</activity>
<activity android:name=".BaiduMapActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".BaiduMapActivity">
</activity>
</application>
</manifest>
\ No newline at end of file
......
......@@ -2,6 +2,7 @@ package com.pashanhoo.landsurvey;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
import com.esri.android.map.LocationDisplayManager;
......@@ -42,12 +43,17 @@ public class BaiduMapActivity extends AppCompatActivity {
public void onStatusChanged(Object o, STATUS status) {
if(status == STATUS.INITIALIZED){
Point curPt = JZLocationConverter.wgs84ToGcj02(AppInfo.initPoint);
Log.i("baidu", curPt.getX() + ":" + curPt.getY());
Point pt = GISHelper.lonLat2Mercator(curPt);
mapView.zoomToResolution(pt, BaiduMapsTiledServiceLayer.getRes()[10]);
Log.i("baidu2", pt.getX()+":"+pt.getY());
// mapView.zoomToResolution(pt, BaiduMapsTiledServiceLayer.getRes()[10]);
Toast.makeText(BaiduMapActivity.this,
mapView.getCenter().getX() + ":" + mapView.getCenter().getY(),
Toast.LENGTH_LONG).show();
mapView.zoomTo(pt, (float) 50.10);
// mapView.centerAndZoom(curPt.getY(), curPt.getX(), 6);
}
}
});
......
......@@ -33,7 +33,8 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer {
private static final double xmax = 20037508.3427892;
private static final double ymax = 20037508.3427892;
private static final double[] res = {156543.03392800014,
private static final double[] res = {
156543.03392800014,
78271.516963999937,
39135.758482000092,
19567.879240999919,
......@@ -54,7 +55,8 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer {
0.59716428355981721,
0.29858214164761665};
private static final double[] scale = {591657527.591555,
private static final double[] scale = {
591657527.591555,
295828763.79577702,
147914381.89788899,
73957190.948944002,
......@@ -130,16 +132,15 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer {
@SuppressLint("DefaultLocale")
protected byte[] getTile(int level, int col, int row) throws Exception {
byte[] result = null;
Log.i("baidu", level + "/"+col+"/"+row);
String url = "";
String s = "Galil";
int zoom = level - 1;
// int zoom = level - 1;
int offsetX = (int)Math.pow(2, level - 1);
int offsetY = offsetX - 1;
int numX = col - (int)Math.pow(2, level - 1);
int numY = (-row) + offsetY;
zoom = level + 1;
// int offsetY = offsetX - 1;
int numX = col - offsetX;
int numY = offsetX - row - 1 ;
int zoom = level + 1;
int num = (col + row) % 8 + 1;
num = 2;
......@@ -153,13 +154,11 @@ public class BaiduMapsTiledServiceLayer extends TiledServiceLayer {
break;
case BAIDU_IMAGE:
url = "http://shangetu" + ((col + row) % 8 + 1) + ".map.bdimg.com/it/u="
+ "x=" + numX + ";y=" + numY+ ";z=" + zoom
+ ";v=009;type=sate&fm=46";
+ "x=" + numX + ";y=" + numY+ ";z=" + zoom + ";v=009;type=sate&fm=46";
break;
case BAIDU_TRAFFIC:
url = "http://its.map.baidu.com:8002/traffic/TrafficTileService?"
+ "level=" + zoom + "&x=" + numX + "&y=" + numY
+ "&time=" + System.currentTimeMillis();
+ "level=" + zoom + "&x=" + numX + "&y=" + numY + "&time=" + System.currentTimeMillis();
break;
}
Log.i("baidu", url);
......
......@@ -4,17 +4,32 @@ import com.pashanhoo.landsurvey.layers.BaseTiledMapServiceType;
public enum GeoQMapLayerTypes implements BaseTiledMapServiceType {
/** * Google vector map service by city map*/
/**
* * ChinaOnlineCommunity
* */
ChinaOnlineCommunity,
/** * Google image map service by satellite map */
/**
* ChinaOnlineCommunity_Mobile
*/
ChinaOnlineCommunity_Mobile,
/** * Google topographic map service ======= topographic map */
/**
* ChinaOnlineCommunityENG
*/
ChinaOnlineCommunityENG,
/**
* ChinaOnlineStreetGray
*/
ChinaOnlineStreetGray,
/**
* ChinaOnlineStreetPurplishBlue
*/
ChinaOnlineStreetPurplishBlue,
/**
* ChinaOnlineStreetWarm
*/
ChinaOnlineStreetWarm;
@Override
......
......@@ -8,15 +8,26 @@ import com.pashanhoo.landsurvey.layers.BaseTiledMapServiceType;
public enum GoogleMapLayerTypes implements BaseTiledMapServiceType {
/** * Google vector map service by city map*/
/**
* * Google vector map service by city map
* */
VECTOR_GOOGLE_MAP,
/** * Google image map service by satellite map */
/**
* * Google image map service by satellite map
* */
IMAGE_GOOGLE_MAP,
/** * Google topographic map service ======= topographic map */
/**
* * Google topographic map service ======= topographic map
* */
TERRAIN_GOOGLE_MAP,
/** * Google road POI map service = = = = net road map */
/**
* * Google road POI map service = = = = net road map
* */
IMAGE_ANNO_GOOGLE_MAP,
/**
* OSM
*/
OSM_Map;
@Override
......
......@@ -8,6 +8,9 @@ public enum TencentMapLayerTypes implements BaseTiledMapServiceType {
*/
TENCENT_MAP_VECTOR,
/**
* 腾讯矢量夜间图层(含路网,含注记)
*/
TENCENT_MAP_VECTOR_NIGHT,
/**
* 腾讯影像图层(不含路网,不含注记)
......
......@@ -24,9 +24,13 @@ public enum TianDiTuLayerTypes implements BaseTiledMapServiceType {
* 影像注记
* */
CIA_C,
/**
* 地形数据
*/
TER_C,
/**
* 地形注记
*/
CTA_C;
public void setName()
......