Mapxbox地图
index.html
<!DOCTYPE html>
<html>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>底图与地理投影 - Mapxbox地图</title>
  <link rel="icon" href="/examples/static/resource/image/favicon.png" />
  <style type="text/css">
    html,body{margin:0px;height:100%;width:100%}
    .container{width:100%;height:100%}
  </style>
  <link rel="stylesheet" href="//rd.sz-map.com/libs/gm/gl/gl.min.css">
  <script type="text/javascript" src="//rd.sz-map.com/libs/gm/gl/gl.min.js"></script>
  <body>

    <div id="map" class="container"></div>
    <!-- Mapbox GL -->
    <link href="https://api.tiles.mapbox.com/mapbox-gl-js/v1.2.0/mapbox-gl.css" rel='stylesheet' />
    <script src="https://api.tiles.mapbox.com/mapbox-gl-js/v1.2.0/mapbox-gl.js"></script>

    <script>
      function initMap() {
        this.map = new GL.Map('map', {
          center: "120.650847,31.3092434",
          zoom: 12,
          zoomControl: false,
          scaleControl: false
        });

        var accessToken = 'pk.eyJ1IjoiZ2VlMWsiLCJhIjoiY2psb3ZmanVrMXkxbDNwcGg5YXN3d3RodCJ9.t5K4YsIwYb8pJuPbCWf5Jg'

        var styleList = [
          'mapbox://styles/mapbox/streets-v10',
          'mapbox://styles/mapbox/outdoors-v10',
          'mapbox://styles/mapbox/light-v9',
          'mapbox://styles/mapbox/dark-v9',
          'mapbox://styles/mapbox/satellite-v9',
          'mapbox://styles/mapbox/satellite-streets-v10',
          'mapbox://styles/mapbox/navigation-preview-day-v2',
          'mapbox://styles/mapbox/navigation-preview-night-v2',
          'mapbox://styles/mapbox/navigation-guidance-day-v2',
          'mapbox://styles/mapbox/navigation-guidance-night-v2'
        ]

        styleList.forEach(function (style) {
          var baseLayer = GL.LayerLookup.createMapboxTiledLayer({
            accessToken: accessToken,
            style: style,
            preview: 'http://192.168.3.217/examples/static/images/preview.png'
          });
          this.map.addBaseLayer(baseLayer);
        });
      }

      GL.init(initMap, '/examples/static/conf.json');

    </script>
  </body>
</html>
已复制!