components_vector_tile_react.html 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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_componentsVectorTile_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 SmVectorTileLayer = SuperMap.Components.SmVectorTileLayer;
  29. var styleOptions =
  30. host +
  31. '/iserver/services/map-Population/rest/maps/PopulationDistribution/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true';
  32. ReactDOM.render(
  33. <SmWebMap serverUrl="https://iportal.supermap.io/iportal" mapId="1329428269">
  34. <SmVectorTileLayer styleOptions={styleOptions} />
  35. </SmWebMap>,
  36. document.getElementById('main')
  37. );
  38. </script>
  39. </body>
  40. </html>