MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / getInternetMapInfo

Method getInternetMapInfo

src/openlayers/mapping/WebMap.js:1095–1215  ·  view source on GitHub ↗

* @private * @function WebMap.prototype.getInternetMapInfo * @description 获取底图对应的图层信息,不是用请求回来的底图信息 * @param {Object} baseLayerInfo - 底图信息 * @returns {Object} 底图的具体信息

(baseLayerInfo)

Source from the content-addressed store, hash-verified

1093 * @returns {Object} 底图的具体信息
1094 */
1095 getInternetMapInfo(baseLayerInfo) {
1096 const baiduBounds = [-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892];
1097 const bounds_4326 = [-180, -90, 180, 90];
1098 const osmBounds = [-20037508.34, -20037508.34, 20037508.34, 20037508.34];
1099 const japanReliefBounds = [12555667.53929, 1281852.98656, 17525908.86651, 7484870.70596];
1100 const japanOrtBounds = [-19741117.14519, -10003921.36848, 19981677.71404, 19660983.56089];
1101
1102 baseLayerInfo.units = 'm';
1103 switch (baseLayerInfo.layerType) {
1104 case 'BAIDU':
1105 baseLayerInfo.iServerUrl = 'https://map.baidu.com/';
1106 baseLayerInfo.epsgCode = 'EPSG:3857';
1107 baseLayerInfo.minZoom = 1;
1108 baseLayerInfo.maxZoom = 19;
1109 baseLayerInfo.level = 1;
1110 baseLayerInfo.extent = baiduBounds;
1111 // thumbnail: this.getImagePath('bmap.png') 暂时不用到缩略图
1112 break;
1113 case 'CLOUD':
1114 baseLayerInfo.url = 'http://t2.dituhui.com/FileService/image?map=quanguo&type=web&x={x}&y={y}&z={z}';
1115 baseLayerInfo.epsgCode = 'EPSG:3857';
1116 baseLayerInfo.minZoom = 1;
1117 baseLayerInfo.maxZoom = 18;
1118 baseLayerInfo.level = 1;
1119 baseLayerInfo.extent = baiduBounds;
1120 break;
1121 case 'CLOUD_BLACK':
1122 baseLayerInfo.url = 'http://t3.dituhui.com/MapService/getGdp?x={x}&y={y}&z={z}';
1123 baseLayerInfo.epsgCode = 'EPSG:3857';
1124 baseLayerInfo.minZoom = 1;
1125 baseLayerInfo.maxZoom = 18;
1126 baseLayerInfo.level = 1;
1127 baseLayerInfo.extent = baiduBounds;
1128 break;
1129 case 'tencent':
1130 baseLayerInfo.epsgCode = 'EPSG:3857';
1131 baseLayerInfo.minZoom = 1;
1132 baseLayerInfo.maxZoom = 18;
1133 baseLayerInfo.level = 1;
1134 baseLayerInfo.extent = baiduBounds;
1135 break;
1136 case 'TIANDITU_VEC_3857':
1137 case 'TIANDITU_IMG_3857':
1138 case 'TIANDITU_TER_3857':
1139 baseLayerInfo.iserverUrl = 'https://map.tianditu.gov.cn/';
1140 baseLayerInfo.epsgCode = 'EPSG:3857';
1141 baseLayerInfo.minZoom = 0;
1142 baseLayerInfo.maxZoom = 19;
1143 baseLayerInfo.level = 1;
1144 baseLayerInfo.extent = baiduBounds;
1145 if (baseLayerInfo.layerType === 'TIANDITU_TER_3857') {
1146 baseLayerInfo.maxZoom = 14;
1147 }
1148 break;
1149 case 'TIANDITU_VEC_4326':
1150 case 'TIANDITU_IMG_4326':
1151 case 'TIANDITU_TER_4326':
1152 baseLayerInfo.iserverUrl = 'https://map.tianditu.gov.cn/';

Callers 2

addBaseMapMethod · 0.95
WebMap2Spec.jsFile · 0.80

Calls 1

getLangMethod · 0.95

Tested by

no test coverage detected