index.html
<!DOCTYPE html>
<html>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title> - </title>
  <style type="text/css">
    html,body{margin:0px;height:100%;width:100%}
    .container{width:100%;height:100%}
  </style>
  <link rel="stylesheet" href="https://unpkg.com/maptalks/dist/maptalks.css">
  <script type="text/javascript" src="https://unpkg.com/maptalks/dist/maptalks.min.js"></script>
  <body>

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

    <script>
      var arcUrl = 'http://116.211.137.33:8010/ServiceAdapter/MAP/%E7%94%B5%E5%AD%90%E5%9C%B0%E5%9B%BE/07769b53b5243b7d6aea9df803f471c1';

      maptalks.SpatialReference.loadArcgis(arcUrl + '?f=pjson', function (err, conf) {
        if (err) {
          throw new Error(err);
        }
        var ref = conf.spatialReference;
        ref.projection = 'EPSG:4490';
        var map = new maptalks.Map('map', {
          center: [114.2802000833099, 30.57662124451251],
          zoom: 0,
          spatialReference : ref,
          baseLayer: new maptalks.TileLayer('base', {
            'renderer' : 'canvas',
            'tileSystem' : conf.tileSystem,
            'tileSize' : conf.tileSize, // [256, 256]
            'urlTemplate' : arcUrl + '/tile/{z}/{y}/{x}',
            'attribution' : '&copy; <a target="_blank" href="http://www.digitalwuhan.gov.cn/map/">天地图.武汉</a>'
          })
        });
      });

    </script>
  </body>
</html>
Copied!