I used to use ArcGIS for JS 3.19 to load the map of heaven and earth, using the default coordinate system: 4326. Now, because all maps provided by the customer are 4490, we have no choice but to use 4490, otherwise the layers of different coordinate systems cannot be stacked together.

4490 is WKID of CGCS2000 coordinate system, 4326 is WKID of WGS84. For their differences and connections, see the reference article at the end. It is said that the 4490 is more suitable for us than the 4326.

Here is the complete code for loading map of heaven and Earth, written in the form of arcGIS plug-in:

define(["dojo/_base/declare"."esri/layers/tiled"].function(declare) {
	return declare(esri.layers.TiledMapServiceLayer, {
		constructor: function(path, option) {
			this.baseUrl = path;
			this.layerType = option ? option.mode : null;
			if(option.name){
				this.id = option.name;
			}
			this.tk = getTk(option);
			this.spatialReference = new esri.SpatialReference({
				wkid: 4490
			});
			this.initialExtent = (this.fullExtent = new esri.geometry.Extent(45.0, -27.0.163.0.45.0.this.spatialReference));// China and its environs
			this.tileInfo = getTileInfo();
			this.loaded = true;
			this.onLoad(this);
			
			function getTk(option){
				var tk;
				
				if(option.tk){
					tk = option.tk;
				} else {
					console.error("TK lacking the map of heaven and earth!!");
				}
				
				return tk;
			}
			function getTileInfo(){
				return new esri.layers.TileInfo({
					/* titleInfo is available from layer */
					"dpi": 96."rows": 256."cols": 256."compressionQuality": 0."origin": {
						x: -180.y: 90
					},
					"spatialReference": {
						"wkid": 4490."latestWkid": 4490
					},
					/* Scale, resolution */    
					"lods": [{level: 0.resolution: 1.40625.scale: 590995197.14166909755553014475 },
						{
							"level": 1."resolution": 0.7031250000000002."scale": 2.9549759305875003 e8
						},
						{
							"level": 2."resolution": 0.3515625000000001."scale": 1.4774879652937502 e8
						},
						{
							"level": 3."resolution": 0.17578125000000006."scale": 7.387439826468751 e7
						},
						{
							"level": 4."resolution": 0.08789062500000003."scale": 3.6937199132343754 e7
						},
						{
							"level": 5."resolution": 0.043945312500000014."scale": 1.8468599566171877 e7
						},
						{
							"level": 6."resolution": 0.021972656250000007."scale": 9234299.783085939
						},
						{
							"level": 7."resolution": 0.010986328125000003."scale": 4617149.891542969
						},
						{
							"level": 8."resolution": 0.005493164062500002."scale": 2308574.9457714846
						},
						{
							"level": 9."resolution": 0.002746582031250001."scale": 1154287.4728857423
						},
						{
							"level": 10."resolution": 0.0013732910156250004."scale": 577143.7364428712
						},
						{
							"level": 11."resolution": 6.866455078125002 e-4."scale": 288571.8682214356
						},
						{
							"level": 12."resolution": 3.433227539062501 e-4."scale": 144285.9341107178
						},
						{
							"level": 13."resolution": 1.7166137695312505 e-4."scale": 72142.9670553589
						},
						{
							"level": 14."resolution": 8.583068847656253 e-5."scale": 36071.48352767945
						},
						{
							"level": 15."resolution": 4.2915344238281264 e-5."scale": 18035.741763839724
						},
						{
							"level": 16."resolution": 2.1457672119140632 e-5."scale": 9017.870881919862
						},
						{
							"level": 17."resolution": 1.0728836059570316 e-5."scale": 4508.935440959931
						},
						{
							"level": 18."resolution": 5.364418029785158 e-6."scale": 2254.4677204799655}}]); }},//end of constructor
		baseUrl: null.layerType: null.tk: null.id:null.getTileUrl: function (level, row, col) {
			return this.baseUrl 
				+ "? SERVICE = WMTS&REQUEST = GetTile&VERSION = 1.0.0 & STYLE = = default&TILEMATRIXSET = c&FORMAT tiles"
				+ "&LAYER=" + this.layerType 
				+ "&TILEMATRIX=" + level 
				+ "&TILEROW=" + row 
				+ "&TILECOL=" + col 
				+ "&tk=" + this.tk; }}); });Copy the code

The code,

"lods": [{level: 0.resolution: 1.40625.scale: 590995197.14166909755553014475 },
			{
				"level": 1."resolution": 0.7031250000000002."scale": 2.9549759305875003 e8
			},
Copy the code

This part is a mystery. I’m not sure what it is, but from the information on a lot of the 4490 layers, it looks like a map slicing scheme or scale or something. You see, here’s a base map of frame 4490:



The numbers are the same as in the code. However, its Level 0 corresponds to Level 1 in the code. The map will only load if this is set up in the code. It’s not clear why. Perhaps this is what the current (April 2021) version of Map Heaven and Earth looks like.

Refer to GIS to develop literacy paste-geographic coordinate system

Wkid =4326, 4490, CGCS2000, coordinate system summary