vectorTileLayerMVT_4326.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <!--********************************************************************
  2. * Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  3. *********************************************************************-->
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7. <meta charset="UTF-8">
  8. <title data-i18n="resources.title_vectorTileLayerMVT4326"></title>
  9. <script type="text/javascript" src="../js/include-web.js"></script>
  10. </head>
  11. <body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
  12. <div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
  13. <script type="text/javascript" src="../../dist/leaflet/include-leaflet.js"></script>
  14. <script type="text/javascript">
  15. var host = window.isLocal ? window.server : "https://iserver.supermap.io";
  16. var map, vectorLayer,
  17. url = host + "/iserver/services/map-world/rest/maps/世界地图_Gray";
  18. map = L.map('map', {
  19. crs: L.CRS.EPSG4326,
  20. center: [0, 0],
  21. maxZoom: 15,
  22. zoom: 1
  23. });
  24. vectorLayer = L.supermap.tiledVectorLayer(url, {
  25. tileSize: 512,
  26. format: L.supermap.VectorTileFormat.MVT,
  27. cacheEnabled: true,
  28. returnAttributes: true,
  29. attribution: "Tile Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='https://iclient.supermap.io' target='_blank'>SuperMap iClient</a></span>"
  30. }).addTo(map);
  31. </script>
  32. </body>
  33. </html>