金坛河长通 v1.1.6版本的 MD5 值为:20e883288031684b3415ea19cd21af4d
以下内容为反编译后的 TianDiTuMethodsClass.java 源代码,内容仅作参考
package com.zkzy.hzz.utils;
import com.esri.arcgisruntime.arcgisservices.LevelOfDetail;
import com.esri.arcgisruntime.arcgisservices.TileInfo;
import com.esri.arcgisruntime.geometry.Envelope;
import com.esri.arcgisruntime.geometry.Point;
import com.esri.arcgisruntime.geometry.SpatialReference;
import com.esri.arcgisruntime.layers.WebTiledLayer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class TianDiTuMethodsClass {
private static final int DPI = 96;
private static final String LAYER_NAME_IMAGE = "img";
private static final String LAYER_NAME_IMAGE_ANNOTATION_CHINESE = "cia";
private static final String LAYER_NAME_IMAGE_ANNOTATION_ENGLISH = "eia";
private static final String LAYER_NAME_TERRAIN = "ter";
private static final String LAYER_NAME_TERRAIN_ANNOTATION_CHINESE = "cta";
private static final String LAYER_NAME_VECTOR = "vec";
private static final String LAYER_NAME_VECTOR_ANNOTATION_CHINESE = "cva";
private static final String LAYER_NAME_VECTOR_ANNOTATION_ENGLISH = "eva";
private static final String URL_IMAGE_2000 = "http://{subDomain}.tianditu.gov.cn/DataServer?T=img_c&x={col}&y={row}&l={level}&tk=a70390e9d4f24852c2fe72f7fe73e34b";
private static final String URL_IMAGE_ANNOTATION_CHINESE_2000 = "http://{subDomain}.tianditu.gov.cn/DataServer?T=cia_c&x={col}&y={row}&l={level}&tk=a70390e9d4f24852c2fe72f7fe73e34b";
private static final String URL_IMAGE_ANNOTATION_CHINESE_MERCATOR = "http://{subDomain}.tianditu.gov.cn/DataServer?T=cia_w&x={col}&y={row}&l={level}&tk=a70390e9d4f24852c2fe72f7fe73e34b";
private static final String URL_IMAGE_ANNOTATION_ENGLISH_2000 = "http://{subDomain}.tianditu.gov.cn/DataServer?T=eia_c&x={col}&y={row}&l={level}&tk=a70390e9d4f24852c2fe72f7fe73e34b";
private static final String URL_IMAGE_ANNOTATION_ENGLISH_MERCATOR = "http://{subDomain}.tianditu.gov.cn/DataServer?T=eia_w&x={col}&y={row}&l={level}&tk=a70390e9d4f24852c2fe72f7fe73e34b";
private static final String URL_IMAGE_MERCATOR = "http://{subDomain}.tianditu.gov.cn/DataServer?T=img_w&x={col}&y={row}&l={level}&tk=a70390e9d4f24852c2fe72f7fe73e34b";
private static final String URL_TERRAIN_2000 = "http://{subDomain}.tianditu.gov.cn/DataServer?T=ter_c&x={col}&y={row}&l={level}&tk=a70390e9d4f24852c2fe72f7fe73e34b";
private static final String URL_TERRAIN_ANNOTATION_CHINESE_2000 = "http://{subDomain}.tianditu.gov.cn/DataServer?T=cta_c&x={col}&y={row}&l={level}&tk=a70390e9d4f24852c2fe72f7fe73e34b";
private static final String URL_TERRAIN_ANNOTATION_CHINESE_MERCATOR = "http://{subDomain}.tianditu.gov.cn/DataServer?T=cta_w&x={col}&y={row}&l={level}&tk=a70390e9d4f24852c2fe72f7fe73e34b";
private static final String URL_TERRAIN_MERCATOR = "http://{subDomain}.tianditu.gov.cn/DataServer?T=ter_w&x={col}&y={row}&l={level}&tk=a70390e9d4f24852c2fe72f7fe73e34b";
private static final String URL_VECTOR_2000 = "http://{subDomain}.tianditu.gov.cn/DataServer?T=vec_c&x={col}&y={row}&l={level}&tk=a70390e9d4f24852c2fe72f7fe73e34b";
private static final String URL_VECTOR_ANNOTATION_CHINESE_2000 = "http://{subDomain}.tianditu.gov.cn/DataServer?T=cva_c&x={col}&y={row}&l={level}&tk=a70390e9d4f24852c2fe72f7fe73e34b";
private static final String URL_VECTOR_ANNOTATION_CHINESE_MERCATOR = "http://{subDomain}.tianditu.gov.cn/DataServer?T=cva_w&x={col}&y={row}&l={level}&tk=a70390e9d4f24852c2fe72f7fe73e34b";
private static final String URL_VECTOR_ANNOTATION_ENGLISH_2000 = "http://{subDomain}.tianditu.gov.cn/DataServer?T=eva_c&x={col}&y={row}&l={level}&tk=a70390e9d4f24852c2fe72f7fe73e34b";
private static final String URL_VECTOR_ANNOTATION_ENGLISH_MERCATOR = "http://{subDomain}.tianditu.gov.cn/DataServer?T=eva_w&x={col}&y={row}&l={level}&tk=a70390e9d4f24852c2fe72f7fe73e34b";
private static final String URL_VECTOR_MERCATOR = "http://{subDomain}.tianditu.gov.cn/DataServer?T=vec_w&x={col}&y={row}&l={level}&tk=a70390e9d4f24852c2fe72f7fe73e34b";
private static final double X_MAX_2000 = 180.0d;
private static final double X_MAX_MERCATOR = 2.00375083427892E7d;
private static final double X_MIN_2000 = -180.0d;
private static final double X_MIN_MERCATOR = -2.00375083427892E7d;
private static final double Y_MAX_MERCATOR = 2.00375083427892E7d;
private static final double Y_MIN_MERCATOR = -2.00375083427892E7d;
private static final String key = "&tk=a70390e9d4f24852c2fe72f7fe73e34b";
private static final int maxZoomLevel = 18;
private static final int minZoomLevel = 1;
private static final int tileHeight = 256;
private static final int tileWidth = 256;
private static final List<String> SubDomain = Arrays.asList("t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7");
private static final SpatialReference SRID_2000 = SpatialReference.create(4490);
private static final SpatialReference SRID_MERCATOR = SpatialReference.create(102100);
private static final double Y_MAX_2000 = 90.0d;
private static final Point ORIGIN_2000 = new Point(-180.0d, Y_MAX_2000, SRID_2000);
private static final Point ORIGIN_MERCATOR = new Point(-2.00375083427892E7d, 2.00375083427892E7d, SRID_MERCATOR);
private static final double Y_MIN_2000 = -90.0d;
private static final Envelope ENVELOPE_2000 = new Envelope(-180.0d, Y_MIN_2000, 180.0d, Y_MAX_2000, SRID_2000);
private static final Envelope ENVELOPE_MERCATOR = new Envelope(-2.00375083427892E7d, -2.00375083427892E7d, 2.00375083427892E7d, 2.00375083427892E7d, SRID_MERCATOR);
private static final double[] SCALES = {2.958293554545656E8d, 1.479146777272828E8d, 7.39573388636414E7d, 3.69786694318207E7d, 1.848933471591035E7d, 9244667.357955175d, 4622333.678977588d, 2311166.839488794d, 1155583.419744397d, 577791.7098721985d, 288895.85493609926d, 144447.92746804963d, 72223.96373402482d, 36111.98186701241d, 18055.990933506204d, 9027.995466753102d, 4513.997733376551d, 2256.998866688275d, 1128.4994333441375d};
private static final double[] RESOLUTIONS_MERCATOR = {78271.51696402048d, 39135.75848201024d, 19567.87924100512d, 9783.93962050256d, 4891.96981025128d, 2445.98490512564d, 1222.99245256282d, 611.49622628141d, 305.748113140705d, 152.8740565703525d, 76.43702828517625d, 38.21851414258813d, 19.109257071294063d, 9.554628535647032d, 4.777314267823516d, 2.388657133911758d, 1.194328566955879d, 0.5971642834779395d, 0.29858214173897d};
private static final double[] RESOLUTIONS_2000 = {0.7031249999891485d, 0.35156249999999994d, 0.17578124999999997d, 0.08789062500000014d, 0.04394531250000007d, 0.021972656250000007d, 0.01098632812500002d, 0.00549316406250001d, 0.0027465820312500017d, 0.0013732910156250009d, 6.86645507812499E-4d, 3.433227539062495E-4d, 1.7166137695312503E-4d, 8.583068847656251E-5d, 4.2915344238281406E-5d, 2.1457672119140645E-5d, 1.0728836059570307E-5d, 5.364418029785169E-6d};
public enum LayerType {
TIANDITU_VECTOR_MERCATOR,
TIANDITU_VECTOR_ANNOTATION_CHINESE_MERCATOR,
TIANDITU_VECTOR_ANNOTATION_ENGLISH_MERCATOR,
TIANDITU_IMAGE_MERCATOR,
TIANDITU_IMAGE_ANNOTATION_CHINESE_MERCATOR,
TIANDITU_IMAGE_ANNOTATION_ENGLISH_MERCATOR,
TIANDITU_TERRAIN_MERCATOR,
TIANDITU_TERRAIN_ANNOTATION_CHINESE_MERCATOR,
TIANDITU_VECTOR_2000,
TIANDITU_VECTOR_ANNOTATION_CHINESE_2000,
TIANDITU_VECTOR_ANNOTATION_ENGLISH_2000,
TIANDITU_IMAGE_2000,
TIANDITU_IMAGE_ANNOTATION_CHINESE_2000,
TIANDITU_IMAGE_ANNOTATION_ENGLISH_2000,
TIANDITU_TERRAIN_2000,
TIANDITU_TERRAIN_ANNOTATION_CHINESE_2000
}
public static WebTiledLayer CreateTianDiTuTiledLayer(LayerType layerType) {
Envelope mainEnvelope;
Point mainOrigin;
WebTiledLayer webTiledLayer = null;
String mainUrl = "";
String mainName = "";
boolean mainIs2000 = false;
try {
switch (layerType) {
case TIANDITU_VECTOR_2000:
mainUrl = URL_VECTOR_2000;
mainName = LAYER_NAME_VECTOR;
mainIs2000 = true;
break;
case TIANDITU_VECTOR_MERCATOR:
mainUrl = URL_VECTOR_MERCATOR;
mainName = LAYER_NAME_VECTOR;
break;
case TIANDITU_IMAGE_2000:
mainUrl = URL_IMAGE_2000;
mainName = LAYER_NAME_IMAGE;
mainIs2000 = true;
break;
case TIANDITU_IMAGE_ANNOTATION_CHINESE_2000:
mainUrl = URL_IMAGE_ANNOTATION_CHINESE_2000;
mainName = LAYER_NAME_IMAGE_ANNOTATION_CHINESE;
mainIs2000 = true;
break;
case TIANDITU_IMAGE_ANNOTATION_ENGLISH_2000:
mainUrl = URL_IMAGE_ANNOTATION_ENGLISH_2000;
mainName = LAYER_NAME_IMAGE_ANNOTATION_ENGLISH;
mainIs2000 = true;
break;
case TIANDITU_IMAGE_ANNOTATION_CHINESE_MERCATOR:
mainUrl = URL_IMAGE_ANNOTATION_CHINESE_MERCATOR;
mainName = LAYER_NAME_IMAGE_ANNOTATION_CHINESE;
break;
case TIANDITU_IMAGE_ANNOTATION_ENGLISH_MERCATOR:
mainUrl = URL_IMAGE_ANNOTATION_ENGLISH_MERCATOR;
mainName = LAYER_NAME_IMAGE_ANNOTATION_ENGLISH;
break;
case TIANDITU_IMAGE_MERCATOR:
mainUrl = URL_IMAGE_MERCATOR;
mainName = LAYER_NAME_IMAGE;
break;
case TIANDITU_VECTOR_ANNOTATION_CHINESE_2000:
mainUrl = URL_VECTOR_ANNOTATION_CHINESE_2000;
mainName = LAYER_NAME_VECTOR_ANNOTATION_CHINESE;
mainIs2000 = true;
break;
case TIANDITU_VECTOR_ANNOTATION_ENGLISH_2000:
mainUrl = URL_VECTOR_ANNOTATION_ENGLISH_2000;
mainName = "eva";
mainIs2000 = true;
break;
case TIANDITU_VECTOR_ANNOTATION_CHINESE_MERCATOR:
mainUrl = URL_VECTOR_ANNOTATION_CHINESE_MERCATOR;
mainName = LAYER_NAME_VECTOR_ANNOTATION_CHINESE;
break;
case TIANDITU_VECTOR_ANNOTATION_ENGLISH_MERCATOR:
mainUrl = URL_VECTOR_ANNOTATION_ENGLISH_MERCATOR;
mainName = "eva";
break;
case TIANDITU_TERRAIN_2000:
mainUrl = URL_TERRAIN_2000;
mainName = LAYER_NAME_TERRAIN;
mainIs2000 = true;
break;
case TIANDITU_TERRAIN_ANNOTATION_CHINESE_2000:
mainUrl = URL_TERRAIN_ANNOTATION_CHINESE_2000;
mainName = LAYER_NAME_TERRAIN_ANNOTATION_CHINESE;
mainIs2000 = true;
break;
case TIANDITU_TERRAIN_MERCATOR:
mainUrl = URL_TERRAIN_MERCATOR;
mainName = LAYER_NAME_TERRAIN;
break;
case TIANDITU_TERRAIN_ANNOTATION_CHINESE_MERCATOR:
mainUrl = URL_TERRAIN_ANNOTATION_CHINESE_MERCATOR;
mainName = LAYER_NAME_TERRAIN_ANNOTATION_CHINESE;
break;
}
List<LevelOfDetail> mainLevelOfDetail = new ArrayList<>();
if (mainIs2000) {
for (int i = 1; i <= 18; i++) {
LevelOfDetail item = new LevelOfDetail(i, RESOLUTIONS_2000[i - 1], SCALES[i - 1]);
mainLevelOfDetail.add(item);
}
mainEnvelope = ENVELOPE_2000;
mainOrigin = ORIGIN_2000;
} else {
for (int i2 = 1; i2 <= 18; i2++) {
LevelOfDetail item2 = new LevelOfDetail(i2, RESOLUTIONS_MERCATOR[i2 - 1], SCALES[i2 - 1]);
mainLevelOfDetail.add(item2);
}
mainEnvelope = ENVELOPE_MERCATOR;
mainOrigin = ORIGIN_MERCATOR;
}
TileInfo mainTileInfo = new TileInfo(96, TileInfo.ImageFormat.PNG24, mainLevelOfDetail, mainOrigin, mainOrigin.getSpatialReference(), 256, 256);
try {
WebTiledLayer webTiledLayer2 = new WebTiledLayer(mainUrl, SubDomain, mainTileInfo, mainEnvelope);
try {
webTiledLayer2.setName(mainName);
webTiledLayer2.loadAsync();
return webTiledLayer2;
} catch (Exception e) {
e = e;
webTiledLayer = webTiledLayer2;
e.getCause();
return webTiledLayer;
}
} catch (Exception e2) {
e = e2;
}
} catch (Exception e3) {
e = e3;
}
}
}