当前位置:   article > 正文

vue echarts 中国地图处理南海诸岛为简图_echarts地图海南诸岛多余部分

echarts地图海南诸岛多余部分

1.下载中国地图的json文件

中国地图json文件      <=访问这个网址,进入下图页面,选择图中标记的按钮,下载成功后的json文件为中文名称,将其改名为china.json

2.将json文件引入项目,展示效果如图

问题:

南海诸岛多占区域较长,视觉效果不好,期望在右下角出现南海诸岛的缩略图

解决方法:

1.显示南海诸岛缩略图

        问题原因在于地图注册的时候,China的首字母大写,改成小写,就会出现缩略图

        修改之后的效果图:

2.隐藏边界线

        json文件中,删掉下面所示代码

        删除之后的效果如下:

3.隐藏南洋诸岛

        这些岛屿都属于“海南省”,所以找到json文件中的“海南”,将其中的“coordinates”替换成下方代码:

  1. "coordinates": [
  2. [
  3. [
  4. [110.106396, 20.026812],
  5. [110.042339, 19.991384],
  6. [109.997375, 19.980136],
  7. [109.965346, 19.993634],
  8. [109.898825, 19.994196],
  9. [109.855093, 19.984073],
  10. [109.814441, 19.993072],
  11. [109.76147, 19.981261],
  12. [109.712195, 20.017253],
  13. [109.657993, 20.01163],
  14. [109.585312, 19.98801],
  15. [109.526797, 19.943573],
  16. [109.498464, 19.873236],
  17. [109.411001, 19.895184],
  18. [109.349407, 19.898561],
  19. [109.300748, 19.917693],
  20. [109.25948, 19.898561],
  21. [109.255784, 19.867045],
  22. [109.231147, 19.863105],
  23. [109.159082, 19.79048],
  24. [109.169553, 19.736411],
  25. [109.147379, 19.704863],
  26. [109.093792, 19.68965],
  27. [109.048829, 19.619764],
  28. [108.993394, 19.587065],
  29. [108.92872, 19.524468],
  30. [108.855424, 19.469182],
  31. [108.806148, 19.450561],
  32. [108.765496, 19.400894],
  33. [108.694047, 19.387346],
  34. [108.644772, 19.349518],
  35. [108.609048, 19.276661],
  36. [108.591186, 19.141592],
  37. [108.598577, 19.055633],
  38. [108.630606, 19.003017],
  39. [108.637997, 18.924346],
  40. [108.595497, 18.872256],
  41. [108.593033, 18.809386],
  42. [108.65278, 18.740258],
  43. [108.663866, 18.67337],
  44. [108.641077, 18.565614],
  45. [108.644772, 18.486738],
  46. [108.68912, 18.447571],
  47. [108.776583, 18.441894],
  48. [108.881293, 18.416344],
  49. [108.905315, 18.389087],
  50. [108.944735, 18.314107],
  51. [109.006329, 18.323198],
  52. [109.108575, 18.323766],
  53. [109.138756, 18.268081],
  54. [109.17448, 18.260125],
  55. [109.287813, 18.264671],
  56. [109.355566, 18.215221],
  57. [109.441182, 18.199303],
  58. [109.467051, 18.173718],
  59. [109.527413, 18.169169],
  60. [109.584696, 18.143579],
  61. [109.661688, 18.175424],
  62. [109.726362, 18.177698],
  63. [109.749767, 18.193618],
  64. [109.785492, 18.339672],
  65. [109.919767, 18.375457],
  66. [110.022629, 18.360121],
  67. [110.070672, 18.376025],
  68. [110.090382, 18.399309],
  69. [110.116867, 18.506602],
  70. [110.214186, 18.578662],
  71. [110.246215, 18.609859],
  72. [110.329366, 18.642185],
  73. [110.367555, 18.631977],
  74. [110.499366, 18.651824],
  75. [110.499366, 18.751592],
  76. [110.578206, 18.784458],
  77. [110.590525, 18.838841],
  78. [110.585597, 18.88075],
  79. [110.619474, 19.152334],
  80. [110.676756, 19.286264],
  81. [110.706321, 19.320153],
  82. [110.729727, 19.378878],
  83. [110.787009, 19.399765],
  84. [110.844292, 19.449996],
  85. [110.888023, 19.518827],
  86. [110.920668, 19.552668],
  87. [111.008747, 19.60398],
  88. [111.061718, 19.612436],
  89. [111.071573, 19.628784],
  90. [111.043856, 19.763448],
  91. [111.013675, 19.850159],
  92. [110.966248, 20.018377],
  93. [110.940994, 20.028499],
  94. [110.871393, 20.01163],
  95. [110.808567, 20.035808],
  96. [110.778386, 20.068415],
  97. [110.744509, 20.074036],
  98. [110.717408, 20.148778],
  99. [110.687843, 20.163947],
  100. [110.655814, 20.134169],
  101. [110.562191, 20.110006],
  102. [110.526467, 20.07516],
  103. [110.495054, 20.077408],
  104. [110.387265, 20.113378],
  105. [110.318279, 20.108882],
  106. [110.28933, 20.056047],
  107. [110.243135, 20.077408],
  108. [110.144585, 20.074598],
  109. [110.106396, 20.026812]
  110. ]
  111. ]
  112. ]

最终修改后的效果

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/197957
推荐阅读
相关标签
  

闽ICP备14008679号