OGC_wcs.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <!--********************************************************************
  2. * Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  3. *********************************************************************-->
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  8. <title data-i18n="resources.title_wcs"></title>
  9. </head>
  10. <body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
  11. <div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
  12. <script type="text/javascript" include="bootstrap" src="../js/include-web.js"></script>
  13. <script type="text/javascript" exclude="iclient-classic" src="../../dist/classic/include-classic.js"></script>
  14. <script type="text/javascript">
  15. var map, layer, layerWorld,
  16. host = window.isLocal ? window.server : "https://iserver.supermap.io",
  17. url1 = host + "/iserver/services/map-world/rest/maps/World",
  18. url2 = host + "/iserver/services/data-world/wcs111";
  19. map = new SuperMap.Map("map", {
  20. controls: [
  21. new SuperMap.Control.ScaleLine(),
  22. new SuperMap.Control.Zoom(),
  23. new SuperMap.Control.LayerSwitcher(),
  24. new SuperMap.Control.Navigation({
  25. dragPanOptions: {
  26. enableKinetic: true
  27. }
  28. })], units: "degrees", allOverlays: true
  29. });
  30. layerWorld = new SuperMap.Layer.TiledDynamicRESTLayer("World", url1, {transparent: true, cacheEnabled: true});
  31. layerWorld.events.on({"layerInitialized": addLayer1});
  32. function addLayer1() {
  33. //基于SuperMap对WCS地图图层进行了支持与扩展,需要额外引入WCSLayer.js脚本;
  34. //脚本位于js/layer/WCSLayer.js;
  35. //初始化WCS图层
  36. layer = new SuperMap.Layer.WCS("wcsLayer", url2);
  37. map.addLayers([layerWorld, layer]);
  38. map.setCenter(new SuperMap.LonLat(0, 0), 2);
  39. }
  40. </script>
  41. </body>
  42. </html>