SOURCE

console 命令行工具 X clear

                    
>
console
<!-- tianditu4490.html -->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">

  <title>WMTS(天地图) </title>

  <style type="text/css">
    html,body {
      padding: 0;
      margin: 0;
      width: 100%;
      height: 100%;
    }
    .mapContainer{
      width: 100%;
      height: 100%;
    }
  </style>

  <!--Styles-->
  <link rel="stylesheet" type="text/css" href="https://js.arcgis.com/4.6/esri/css/main.css">
  <link rel="stylesheet" type="text/css" href="https://js.arcgis.com/4.6/dijit/themes/soria/soria.css">
  <script type="text/javascript" src="https://js.arcgis.com/4.6/"></script>
</head>
<body class="soria">

<div id="map" class="mapContainer">
</div>

<script type="text/javascript">
  require(["dojo/dom",
      "dojo/on",
      "dojo/_base/declare",
      "dojo/json",
      "dojo/_base/lang",
      "dojo/_base/url",
      "dojo/string",
      "dojo/dom-construct",
      "dojo/number",
      "esri/Map",
      "esri/geometry/Extent",
      "esri/layers/support/TileInfo",
      "esri/layers/support/LOD",
      "esri/geometry/SpatialReference",
      "esri/geometry/Point",
      "esri/views/MapView",
      "esri/views/SceneView",
      "esri/layers/WebTileLayer",
      "esri/layers/TileLayer",
      "esri/layers/MapImageLayer",
      "esri/core/urlUtils",
      "esri/core/JSONSupport",
      "dojo/domReady!"
    ],
    function (dom, on, declare, JSON, lang,url,string, domConstruct, number,
              Map,Extent,TileInfo,LOD,SpatialReference,Point,
              MapView,SceneView,WebTileLayer,TileLayer,MapImageLayer,urlUtils,JSONSupport) {
      // Create ogc.WMTSLayer custom layer

      var options1 = {
       // "urlTemplate": "http://61.243.4.66:9800/ext/wgs84yx-proxy/img_c/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=c&TileMatrix={level}&TileCol={col}&TileRow={row}&style=default&format=tiles&tk=5853c0e92459c816623625d1c54d4593&ua_token=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJ6aG91YmFuIiwiY3JlYXRlZCI6MTY0MDkxNDk3ODIxMiwiZXhwIjoxNzA0MDM4NDAwfQ.ga50eYdSDFfTtefizoSr0cDHb1PjuPEK5IzvVkxvIapUPMI2Th1FNzKwrdy-GAr00ZBFCYB5yfDZMETBzKwvVA",
      //"urlTemplate": "http://10.66.241.240:808/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=c&TileMatrix=w&TileCol={col}&TileRow={row}&style=default&format=tiles&tk=42a5dfa93ea7a9cbf423c4c1bb9ec16d"
      "urlTemplate": "https://t0.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}&tk=8c88eba266a165eac9c085724708f2f9"
      };
      var options2 = {
        "urlTemplate": "http://10.66.241.217:8090/iserver/services/map-HHKQ20190813/wmts100?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=RV_LK_R&STYLE=default&TILEMATRIXSET=GoogleMapsCompatible_RV_LK_R&FORMAT=image/png&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}",
      };
      var layer1 = new WebTileLayer(options1);
       var layer2 = new WebTileLayer(options2);
      var map = new Map({
        layers: [layer1]
      });
      var view = new MapView({
        container: "map",
        zoom: 6,
        center: [85, 42.2],
        map: map
      });
    });
</script>
</body>
</html>