LY_Tile.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. const getMaptiles = function getMaptile() {
  2. viewer.imageryLayers.addImageryProvider(
  3. new Cesium.SingleTileImageryProvider({
  4. url: "https://data.mars3d.cn/file/img/world/blue.jpg"
  5. })
  6. );
  7. };
  8. const getMaptilereachs = function getMaptilereach() {
  9. var rectangle = Cesium.Rectangle.fromDegrees(
  10. 117.259691,
  11. 31.834432,
  12. 117.267778,
  13. 31.84387
  14. );
  15. viewer.imageryLayers.addImageryProvider(
  16. new Cesium.SingleTileImageryProvider({
  17. url: "https://data.mars3d.cn/file/img/zkd-dq.png",
  18. rectangle: rectangle
  19. })
  20. );
  21. viewer.camera.flyTo({
  22. destination: Cesium.Cartesian3.fromDegrees(117.259691, 31.834432, 500),
  23. orientation: {
  24. heading: Cesium.Math.toRadians(0.0),
  25. pitch: Cesium.Math.toRadians(-25.0),
  26. roll: 0.0
  27. }
  28. });
  29. };
  30. const tilewms = function tilewm() {
  31. viewer.imageryLayers.addImageryProvider(
  32. new Cesium.WebMapServiceImageryProvider({
  33. url:
  34. "https://nationalmap.gov.au/proxy/http://geoserver.nationalmap.nicta.com.au/geotopo_250k/ows",
  35. layers: "Hydrography:bores",
  36. parameters: {
  37. transparent: true,
  38. format: "image/png"
  39. }
  40. })
  41. );
  42. };
  43. const tileWMTS = function tilewmt() {
  44. viewer.imageryLayers.addImageryProvider(
  45. new Cesium.WebMapTileServiceImageryProvider({
  46. url:
  47. "https://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS",
  48. layer: "USGSShadedReliefOnly",
  49. style: "default",
  50. format: "image/jpeg",
  51. tileMatrixSetID: "default028mm",
  52. maximumLevel: 19,
  53. credit: "U. S. Geological Survey"
  54. })
  55. );
  56. };
  57. const ArcGISServers = function ArcGISServer() {
  58. viewer.imageryLayers.addImageryProvider(
  59. new Cesium.ArcGisMapServerImageryProvider({
  60. url:
  61. "http://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer"
  62. })
  63. );
  64. };
  65. const imageTools = ` formatTooltip(val) {
  66. return val / 100;
  67. },
  68. imageBrightne() {
  69. this.$nextTick(() => {
  70. viewer.scene.imageryLayers.get(0).brightness = this.Brightnessnum / 100;
  71. });
  72. },
  73. imageContras() {
  74. this.$nextTick(() => {
  75. viewer.scene.imageryLayers.get(0).contrast = this.Contrastsnum / 100;
  76. });
  77. },
  78. imageColor() {
  79. this.$nextTick(() => {
  80. viewer.scene.imageryLayers.get(0).hue = this.Coloursum / 100;
  81. });
  82. },
  83. imageLevel() {
  84. this.$nextTick(() => {
  85. viewer.scene.imageryLayers.get(0).saturation = this.Levelsum / 100;
  86. });
  87. },
  88. imageGamma() {
  89. this.$nextTick(() => {
  90. viewer.scene.imageryLayers.get(0).gamma = this.Gammasum / 100;
  91. });
  92. },
  93. imageOpacity() {
  94. this.$nextTick(() => {
  95. viewer.scene.imageryLayers.get(0).alpha = this.Opacitysum / 100;
  96. });
  97. }`;
  98. const tileList = data => {
  99. let Vuemouunted = data.Vuemouunted || null;
  100. let bodydiv = data.bodydiv || null;
  101. let Vuedata = data.Vuedata || null;
  102. let Vuemethod = data.outmethod || null;
  103. let importData = data.importData || null;
  104. let refdata = data.ref || null;
  105. switch (data.name) {
  106. case "image本地单张图片":
  107. Vuemouunted = "\n" + data.interiormethod + "\n" + getMaptiles.toString();
  108. break;
  109. case "image本地单张图片(区域)":
  110. Vuemouunted =
  111. "\n" + data.interiormethod + "\n" + getMaptilereachs.toString();
  112. break;
  113. case "OGC WMS服务":
  114. Vuemouunted = "\n" + data.interiormethod + "\n" + tilewms.toString();
  115. break;
  116. case "OGC WMST服务":
  117. Vuemouunted = "\n" + data.interiormethod + "\n" + tileWMTS.toString();
  118. break;
  119. case "ArcGIS Server服务":
  120. Vuemouunted =
  121. "\n" + data.interiormethod + "\n" + ArcGISServers.toString();
  122. break;
  123. case "色彩级透明度属性":
  124. Vuemethod = imageTools;
  125. break;
  126. }
  127. return { bodydiv, Vuedata, importData, Vuemethod, Vuemouunted, refdata };
  128. };
  129. export { tileList };