lzpathPlanning.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <view class="realtimeWatch">
  3. <map-container
  4. ref="mapContainerRef"
  5. toolMapKey="createPolyline"
  6. :pointsData="pointsData"
  7. @handleMarkerClick="handleMarkerClick">
  8. </map-container>
  9. <view class="options">
  10. <view class="options-item" @click="showSatelliteLayer">
  11. <image
  12. style="width: 100%; height: 100%"
  13. :src="$getImages('/assetsMobile/images/map/icon/weixing.png')" />
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. import MapContainer from '@/components/MapContainer'
  20. export default {
  21. components: {
  22. MapContainer,
  23. },
  24. data() {
  25. return {
  26. //卫星图层
  27. isShowStelliteLayer: false,
  28. pointsData: []
  29. }
  30. },
  31. computed: {
  32. countInfo() {
  33. return this.$store.state.realtimeWatch.countInfo
  34. },
  35. },
  36. onLoad() {
  37. this.pointsData = []
  38. },
  39. onReady() {
  40. },
  41. methods: {
  42. // 查询自身位置
  43. queryLocation() {
  44. uni.getLocation({
  45. type: "gcj02",
  46. success: (res) => {
  47. const { latitude, longitude } = res
  48. this.$refs.mapContainerRef.setZoomAndCenter(12, [longitude, latitude], true)
  49. },
  50. fail: (res) => {
  51. console.log('定位失败', JSON.stringify(res));
  52. }
  53. });
  54. },
  55. //选车辆
  56. showPanel() {
  57. this.$refs.panelRef.show()
  58. },
  59. //展示卫星图层
  60. showSatelliteLayer() {
  61. this.isShowStelliteLayer = !this.isShowStelliteLayer
  62. if (this.$refs.mapContainerRef) this.$refs.mapContainerRef.setStelliteLayer(this.isShowStelliteLayer)
  63. },
  64. //点击标注点
  65. handleMarkerClick(e) {
  66. // console.log(e,'handleMarkerClick')
  67. const { cluster } = e
  68. let item = cluster.p.item
  69. this.$refs.vehInfoRef.show(item)
  70. }
  71. },
  72. beforeDestroy() {
  73. this.$store.dispatch('setVheicleCheckArr', [])
  74. this.$store.dispatch('setPeopleCheckArr', [])
  75. }
  76. }
  77. </script>
  78. <style lang="scss" scoped>
  79. .realtimeWatch {
  80. width: 100%;
  81. height: 100vh;
  82. position: relative;
  83. #map {
  84. width: 750rpx;
  85. height: 100%;
  86. }
  87. .counts {
  88. position: absolute;
  89. left: 2%;
  90. top: 20rpx;
  91. width: 96%;
  92. background: #fff;
  93. border-radius: 10rpx;
  94. box-shadow: 0 2px 6px #3f57c252;
  95. // margin: 10rpx;
  96. .counts-item {
  97. padding: 14rpx 10rpx;
  98. display: flex;
  99. justify-content: center;
  100. align-items: center;
  101. flex-direction: column;
  102. .counts-item-label {
  103. font-size: 24rpx;
  104. font-family: PingFangSC-Medium, PingFang SC;
  105. font-weight: 400;
  106. color: #333333;
  107. text-align: center;
  108. }
  109. .counts-item-value {
  110. margin-top: 10rpx;
  111. font-size: 26rpx;
  112. font-family: PingFangSC-Regular, PingFang SC;
  113. font-weight: 600;
  114. color: #333333;
  115. text-align: center;
  116. }
  117. }
  118. }
  119. .options {
  120. position: absolute;
  121. width: 72rpx;
  122. right: 30rpx;
  123. bottom: 156rpx;
  124. // box-shadow: 0px 3px 30px 0px rgba(0, 0, 0, 0.15);
  125. z-index: 9999;
  126. .options-item {
  127. height: 72rpx;
  128. }
  129. .options-item+.options-item {
  130. margin-top: 20rpx;
  131. }
  132. }
  133. }
  134. </style>