components_raster_react.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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_componentsRasterTile_React"></title>
  9. <script type="text/javascript" include="react" src="../js/include-web.js"></script>
  10. <script include="antd,iclient-mapboxgl-react,mapbox-gl-enhance" src="../../dist/mapboxgl/include-mapboxgl.js"></script>
  11. <style>
  12. html,
  13. body {
  14. height: 100%;
  15. margin: 0;
  16. padding: 0;
  17. }
  18. #main {
  19. height: 100%;
  20. }
  21. </style>
  22. </head>
  23. <body>
  24. <div id="main"></div>
  25. <script type="text/babel">
  26. var host = window.isLocal ? window.server : 'https://iserver.supermap.io';
  27. var SmWebMap = SuperMap.Components.SmWebMap;
  28. var SmRasterTileLayer = SuperMap.Components.SmRasterTileLayer;
  29. var mapUrl = host + '/iserver/services/map-Population/rest/maps/PopulationDistribution';
  30. ReactDOM.render(
  31. <SmWebMap serverUrl="https://iportal.supermap.io/iportal" mapId="1329428269">
  32. <SmRasterTileLayer layerId={resources.text_myRasterLayer} opacity={0.8} visible={true} mapUrl={mapUrl} />
  33. </SmWebMap>,
  34. document.getElementById('main')
  35. );
  36. </script>
  37. </body>
  38. </html>