components_compare_vue.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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_componentsCompare_Vue'></title>
  9. <script type="text/javascript" include="vue" src="../js/include-web.js"></script>
  10. <script include="iclient-mapboxgl-vue,mapbox-gl-enhance"
  11. src="../../dist/mapboxgl/include-mapboxgl.js"></script>
  12. <style>
  13. #main {
  14. margin: 0 auto;
  15. width: 100%;
  16. height: 100%;
  17. }
  18. .compare-title {
  19. position: absolute;
  20. top: 20px;
  21. left: 12%;
  22. display: flex;
  23. align-items: center;
  24. justify-content: space-between;
  25. width: 74%;
  26. z-index: 100;
  27. }
  28. .compare-title .sm-component-border {
  29. width: 334px;
  30. height: 48px;
  31. }
  32. </style>
  33. </head>
  34. <body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
  35. <div id="main">
  36. <div class="compare-title">
  37. <sm-border type="border6">
  38. <sm-text v-bind="textProps" title="全球疫情累积确诊">
  39. </sm-text>
  40. </sm-border>
  41. <sm-border type="border6">
  42. <sm-text v-bind="textProps" title="全球疫情累积发病率">
  43. </sm-text>
  44. </sm-border>
  45. </div>
  46. <sm-compare :before-map-options="beforeMapOptions" :after-map-options="afterMapOptions"></sm-compare>
  47. <!-- <sm-compare>
  48. <sm-web-map slot="beforeMap" target="beforeMap" server-url="https://www.supermapol.com/" @load="load"
  49. :map-id="2134374143">
  50. </sm-web-map>
  51. <sm-web-map slot="afterMap" target="afterMap" server-url="https://www.supermapol.com/"
  52. :map-id="1127786844">
  53. </sm-web-map>
  54. </sm-compare> -->
  55. </div>
  56. <script>
  57. new Vue({
  58. el: '#main',
  59. data() {
  60. return {
  61. beforeMapOptions: {
  62. target: 'beforeMap',
  63. serverUrl: 'https://www.supermapol.com',
  64. mapId: 2134374143,
  65. mapOptions: {
  66. center: [-39.9535, 38.0542],
  67. zoom: 2.44
  68. },
  69. legendControl: {
  70. background: "rgba(0,0,0,0.3)",
  71. textColor: "#fff",
  72. show: true,
  73. position: "bottom-left",
  74. layerNames: ["0315countrycenternpc"],
  75. mode: "simple"
  76. }
  77. },
  78. afterMapOptions: {
  79. target: 'afterMap',
  80. serverUrl: 'https://www.supermapol.com/',
  81. mapId: 1127786844,
  82. mapOptions: {
  83. center: [-39.9535, 38.0542],
  84. zoom: 2.44
  85. },
  86. legendControl: {
  87. background: "rgba(0,0,0,0.3)",
  88. textColor: "#fff",
  89. show: true,
  90. position: "bottom-right",
  91. layerNames: ["0315contryregion"],
  92. mode: "simple"
  93. }
  94. },
  95. textProps: {
  96. textColor: "#fff",
  97. background: "rgba(0,0,0,0)",
  98. fontStyle: {
  99. fontSize: '27px',
  100. lineHeight: 1.5,
  101. fontWeight: "normal",
  102. justifyContent: "center",
  103. textIndent: 0,
  104. fontFamily: "微软雅黑",
  105. }
  106. }
  107. };
  108. }
  109. })
  110. </script>
  111. </body>
  112. </html>