e877532b by chiangbt

高德地图调整和添加高德交通图层

1 parent be3fb5e3
......@@ -11,6 +11,8 @@ import com.esri.android.map.LocationDisplayManager;
import com.esri.android.map.MapView;
import com.esri.android.runtime.ArcGISRuntime;
import com.esri.core.geometry.Point;
import com.pashanhoo.landsurvey.layers.gaode.GaodeMapLayerTypes;
import com.pashanhoo.landsurvey.layers.gaode.GaodeMapsTiledServiceLayer;
import com.pashanhoo.landsurvey.layers.geoq.GeoQMapLayerTypes;
import com.pashanhoo.landsurvey.layers.geoq.GeoQMapsTiledServiceLayer;
import com.pashanhoo.landsurvey.layers.google.GoogleMapLayerTypes;
......@@ -42,11 +44,20 @@ public class GoogleMapActivity extends AppCompatActivity {
// mapView.addLayer(GOOGLE_IMAGE_Layer);
// GoogleMapsTiledServiceLayer GOOGLE_ANNO_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.IMAGE_ANNO_GOOGLE_MAP);
// mapView.addLayer(GOOGLE_ANNO_Layer);
GoogleMapsTiledServiceLayer OSM_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.OSM_Map);
mapView.addLayer(OSM_Layer);
// GaodeMapsTiledServiceLayer gaodeMapsTiledServiceLayer = new GaodeMapsTiledServiceLayer(GaodeMapLayerTypes.VECTOR_Gaode_MAP);
// mapView.addLayer(gaodeMapsTiledServiceLayer);
// GoogleMapsTiledServiceLayer OSM_Layer = new GoogleMapsTiledServiceLayer(GoogleMapLayerTypes.OSM_Map);
// mapView.addLayer(OSM_Layer);
//---------------------------------------------------------------------------------------------------------------------
// 高德矢量图层(含路网,含注记)
GaodeMapsTiledServiceLayer gaodeMapsTiledServiceLayer = new GaodeMapsTiledServiceLayer(GaodeMapLayerTypes.AMAP_VECTOR);
// 高德影像图层(不含路网,不含注记)
// GaodeMapsTiledServiceLayer gaodeMapsTiledServiceLayer = new GaodeMapsTiledServiceLayer(GaodeMapLayerTypes.AMAP_IMAGE);
// 高德路网图层(含路网,含注记)
// GaodeMapsTiledServiceLayer gaodeMapsTiledServiceLayer = new GaodeMapsTiledServiceLayer(GaodeMapLayerTypes.AMAP_ROAD);
// 高德实时交通图层
// GaodeMapsTiledServiceLayer gaodeMapsTiledServiceLayer = new GaodeMapsTiledServiceLayer(GaodeMapLayerTypes.AMAP_TRAFFIC);
mapView.addLayer(gaodeMapsTiledServiceLayer);
//---------------------------------------------------------------------------------------------------------------------
// GeoQMapsTiledServiceLayer geoQMapsTiledServiceLayer = new GeoQMapsTiledServiceLayer(GeoQMapLayerTypes.ChinaOnlineCommunity_Mobile);
// mapView.addLayer(geoQMapsTiledServiceLayer);
......
......@@ -3,16 +3,22 @@ package com.pashanhoo.landsurvey.layers.gaode;
import com.pashanhoo.landsurvey.layers.BaseTiledMapServiceType;
public enum GaodeMapLayerTypes implements BaseTiledMapServiceType {
/** * Google vector map service by city map*/
VECTOR_Gaode_MAP,
/** * Google image map service by satellite map */
IMAGE_Gaode_MAP,
Anno_Gaode_Map;
/** * Google topographic map service ======= topographic map */
/** * Google road POI map service = = = = net road map */
/**
* 高德矢量图层(含路网,含注记)
*/
AMAP_VECTOR,
/**
* 高德影像图层(不含路网,不含注记)
*/
AMAP_IMAGE,
/**
* 高德路网图层(含路网,含注记)
*/
AMAP_ROAD,
/**
* 高德实时交通图层
*/
AMAP_TRAFFIC;
@Override
public String getName()
......
......@@ -17,6 +17,8 @@ import com.pashanhoo.landsurvey.layers.google.GoogleMapLayerTypes;
import com.pashanhoo.landsurvey.utils.AppInfo;
import com.pashanhoo.landsurvey.utils.GADBHelper;
import java.util.Calendar;
import java.util.TimeZone;
import java.util.concurrent.RejectedExecutionException;
/**
......@@ -135,15 +137,25 @@ public class GaodeMapsTiledServiceLayer extends TiledServiceLayer {
String url = "";
String s = "Galil";
switch (gaodeMapLayerTypes) {
case VECTOR_Gaode_MAP:
url= "http://webrd01.is.autonavi.com/appmaptile?&x=" + col + "&y=" + row + "&z=" + level + "&lang=zh_cn&size=1&scale=1&style=7";
case AMAP_VECTOR:
url= "http://webrd01.is.autonavi.com/appmaptile?&x=" + col + "&y=" + row + "&z=" + level +
"&lang=zh_cn&size=1&scale=1&style=7";
break;
case IMAGE_Gaode_MAP:
case AMAP_IMAGE:
url = "http://webst02.is.autonavi.com/appmaptile?style=6&x="+col+"&y="+row+"&z="+level;
break;
case Anno_Gaode_Map:
case AMAP_ROAD:
url = "http://webst02.is.autonavi.com/appmaptile?style=8&x=" + col + "&y=" + row + "&z=" + level;
break;
case AMAP_TRAFFIC:
Calendar calendar = Calendar.getInstance();
calendar.setTimeZone(TimeZone.getTimeZone("GMT+8:00"));
int day = calendar.get(Calendar.DAY_OF_WEEK);
int hh = calendar.get(Calendar.HOUR_OF_DAY);
int mm = calendar.get(Calendar.MINUTE);
url = "http://history.traffic.amap.com/traffic?type=2" + "&day=" + day + "&hh=" + hh + "&mm=" + mm
+ "&x=" + col + "&y=" + row + "&z=" + level;
break;
}
try {
......