controler_attribution.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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_attribution"></title>
  9. <script type="text/javascript" src="../js/include-web.js"></script>
  10. <script type="text/javascript" src="../../dist/ol/include-ol.js"></script>
  11. </head>
  12. <body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%; position: absolute;top: 0;">
  13. <div id="map" style="margin:0 auto;width: 100%;height: 100%;"></div>
  14. <script>
  15. var map,
  16. url = (window.isLocal ? window.server : "https://iserver.supermap.io") + "/iserver/services/map-world/rest/maps/World";
  17. map = new ol.Map({
  18. controls: ol.control.defaults({attribution: false, zoom: false}),
  19. target: 'map',
  20. view: new ol.View({
  21. center: [0, 0],
  22. zoom: 2,
  23. projection: 'EPSG:4326',
  24. multiWorld: true
  25. })
  26. });
  27. var layer = new ol.layer.Tile({
  28. source: new ol.source.TileSuperMapRest({
  29. url: url
  30. }),
  31. projection: 'EPSG:4326'
  32. });
  33. //添加版权控件
  34. map.addControl(new ol.control.Attribution({collapsed: false}));
  35. map.addLayer(layer);
  36. </script>
  37. </body>
  38. </html>