LY_Map.js 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. const creatArcGISs = function creatArcGIS() {
  2. // 加载ArcGIS在线地图
  3. viewer.imageryLayers.addImageryProvider(
  4. new Cesium.ArcGisMapServerImageryProvider({
  5. url:
  6. "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"
  7. })
  8. );
  9. };
  10. const creatBaidus = function creatBaidu() {
  11. viewer.imageryLayers.addImageryProvider(
  12. new Cesium.UrlTemplateImageryProvider({
  13. url:
  14. "https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",
  15. minimumLevel: 3,
  16. maximumLevel: 18
  17. })
  18. );
  19. };
  20. const creatgaoimages = function creatimage() {
  21. viewer.imageryLayers.addImageryProvider(
  22. new Cesium.UrlTemplateImageryProvider({
  23. url:
  24. "https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}",
  25. minimumLevel: 3,
  26. maximumLevel: 18
  27. })
  28. );
  29. };
  30. const creatgaovectors = function creatvector() {
  31. viewer.imageryLayers.addImageryProvider(
  32. new Cesium.UrlTemplateImageryProvider({
  33. url:
  34. "http://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",
  35. minimumLevel: 4,
  36. maximumLevel: 18
  37. })
  38. );
  39. };
  40. const creattdimages = function creattdimage() {
  41. var tdt_key = "789e558be762ff832392a0393fd8a4f1";
  42. viewer.imageryLayers.addImageryProvider(
  43. new Cesium.WebMapTileServiceImageryProvider({
  44. url: "http://t0.tianditu.com/img_w/wmts?tk=" + tdt_key,
  45. layer: "img",
  46. style: "default",
  47. tileMatrixSetID: "w",
  48. format: "tiles",
  49. maximumLevel: 18
  50. })
  51. );
  52. };
  53. const creattdvectors = function creattdvector() {
  54. var tdt_key = "789e558be762ff832392a0393fd8a4f1";
  55. viewer.imageryLayers.addImageryProvider(
  56. new Cesium.WebMapTileServiceImageryProvider({
  57. url: "http://t0.tianditu.com/vec_w/wmts?tk=" + tdt_key,
  58. layer: "vec",
  59. style: "default",
  60. tileMatrixSetID: "w",
  61. format: "tiles",
  62. maximumLevel: 18
  63. })
  64. );
  65. };
  66. const creattdLebals = function creattdLebal() {
  67. var tdt_key = "789e558be762ff832392a0393fd8a4f1";
  68. viewer.imageryLayers.addImageryProvider(
  69. new Cesium.WebMapTileServiceImageryProvider({
  70. url: "http://t0.tianditu.com/cia_w/wmts?tk=" + tdt_key,
  71. layer: "cia",
  72. style: "default",
  73. tileMatrixSetID: "w",
  74. format: "tiles",
  75. maximumLevel: 18
  76. })
  77. );
  78. };
  79. const creattenimages = function creattenimage() {
  80. viewer.imageryLayers.addImageryProvider(
  81. new Cesium.UrlTemplateImageryProvider({
  82. url:
  83. "https://p2.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=229",
  84. customTags: {
  85. sx: function(imageryProvider, x, y, level) {
  86. return x >> 4;
  87. },
  88. sy: function(imageryProvider, x, y, level) {
  89. return ((1 << level) - y) >> 4;
  90. }
  91. }
  92. })
  93. );
  94. };
  95. const creattenvectors = function creattenvector() {
  96. viewer.imageryLayers.addImageryProvider(
  97. new Cesium.UrlTemplateImageryProvider({
  98. url:
  99. "https://rt3.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid=1&version=297",
  100. customTags: {
  101. sx: function(imageryProvider, x, y, level) {
  102. return x >> 4;
  103. },
  104. sy: function(imageryProvider, x, y, level) {
  105. return ((1 << level) - y) >> 4;
  106. }
  107. }
  108. })
  109. );
  110. };
  111. const creattenblacks = function creattenblack() {
  112. viewer.imageryLayers.addImageryProvider(
  113. new Cesium.UrlTemplateImageryProvider({
  114. url:
  115. "https://rt3.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid=4&scene=0",
  116. customTags: {
  117. sx: function(imageryProvider, x, y, level) {
  118. return x >> 4;
  119. },
  120. sy: function(imageryProvider, x, y, level) {
  121. return ((1 << level) - y) >> 4;
  122. }
  123. }
  124. })
  125. );
  126. };
  127. const creattenLebals1 = function creattenLebal1() {
  128. viewer.imageryLayers.addImageryProvider(
  129. new Cesium.UrlTemplateImageryProvider({
  130. url:
  131. "https://rt3.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid=3&scene=0",
  132. customTags: {
  133. sx: function(imageryProvider, x, y, level) {
  134. return x >> 4;
  135. },
  136. sy: function(imageryProvider, x, y, level) {
  137. return ((1 << level) - y) >> 4;
  138. }
  139. }
  140. })
  141. );
  142. };
  143. const creattenLebals2 = function creattenLebal2() {
  144. viewer.imageryLayers.addImageryProvider(
  145. new Cesium.UrlTemplateImageryProvider({
  146. url:
  147. "https://rt3.map.gtimg.com/tile?z={z}&x={x}&y={reverseY}&styleid=2&version=297",
  148. customTags: {
  149. sx: function(imageryProvider, x, y, level) {
  150. return x >> 4;
  151. },
  152. sy: function(imageryProvider, x, y, level) {
  153. return ((1 << level) - y) >> 4;
  154. }
  155. }
  156. })
  157. );
  158. };
  159. const creatLineMaps = function creatLineMap() {
  160. viewer.imageryLayers.addImageryProvider(
  161. new Cesium.UrlTemplateImageryProvider({
  162. url: "http://data.mars3d.cn/tile/googleImg/{z}/{x}/{y}.jpg"
  163. })
  164. );
  165. };
  166. const mapList = data => {
  167. let Vuemouunted = null;
  168. let bodydiv = null;
  169. let Vuedata = null;
  170. let Vuemethod = null;
  171. let importData = null;
  172. switch (data.name) {
  173. case "ArcGis地图":
  174. Vuemouunted = "\n" + data.interiormethod + "\n" + creatArcGISs.toString();
  175. break;
  176. case "百度地图":
  177. Vuemouunted = "\n" + data.interiormethod + "\n" + creatBaidus.toString();
  178. break;
  179. case "高德影像":
  180. Vuemouunted =
  181. "\n" + data.interiormethod + "\n" + creatgaoimages.toString();
  182. break;
  183. case "高德矢量":
  184. Vuemouunted =
  185. "\n" + data.interiormethod + "\n" + creatgaovectors.toString();
  186. break;
  187. case "天地图影像":
  188. Vuemouunted =
  189. "\n" + data.interiormethod + "\n" + creattdimages.toString();
  190. break;
  191. case "天地图矢量":
  192. Vuemouunted =
  193. "\n" + data.interiormethod + "\n" + creattdvectors.toString();
  194. break;
  195. case "天地图标注":
  196. Vuemouunted =
  197. "\n" + data.interiormethod + "\n" + creattdLebals.toString();
  198. break;
  199. case "腾讯影像":
  200. Vuemouunted =
  201. "\n" + data.interiormethod + "\n" + creattenimages.toString();
  202. break;
  203. case "腾讯矢量":
  204. Vuemouunted =
  205. "\n" + data.interiormethod + "\n" + creattenvectors.toString();
  206. break;
  207. case "腾讯黑色风格":
  208. Vuemouunted =
  209. "\n" + data.interiormethod + "\n" + creattenblacks.toString();
  210. break;
  211. case "腾讯注记1":
  212. Vuemouunted =
  213. "\n" + data.interiormethod + "\n" + creattenLebals1.toString();
  214. break;
  215. case "腾讯注记2":
  216. Vuemouunted =
  217. "\n" + data.interiormethod + "\n" + creattenLebals2.toString();
  218. break;
  219. case "离线瓦片":
  220. Vuemouunted =
  221. "\n" + data.interiormethod + "\n" + creatLineMaps.toString();
  222. break;
  223. }
  224. return { bodydiv, Vuedata, importData,Vuemethod, Vuemouunted };
  225. };
  226. export { mapList };