xmmap.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <!-- 地图找人 -->
  3. <map :style="{height:winHeight+'px'}" class="map" :markers="markers" scale='12' enable-building='true' :latitude="latitude" :longitude="longitude" id="map" ref='map'
  4. :show-location='true' @callouttap='callouttap'>
  5. <cover-view slot="callout">
  6. <block v-for="(item, index) in markers" :key="index">
  7. <cover-view :marker-id="index" style='height:188rpx'>
  8. <cover-image style='width:99rpx;height:110rpx;'
  9. src='/static/images/onlineBg.png' />
  10. <cover-image style='width:88rpx;height:88rpx;border-radius:50%;margin-top:-105rpx;margin-left:6rpx;box-shadow:0 26rpx 8rpx 0 rgba(136, 136, 136, 0.5);'
  11. :src="markers[index].customCallout.avatar || '/static/images/my/mine_def_touxiang_3x.png'" />
  12. </cover-view>
  13. </block>
  14. </cover-view>
  15. </map>
  16. <!-- 地图找人end -->
  17. </template>
  18. <script>
  19. export default {
  20. props: {
  21. //中心点纬度
  22. latitude: {
  23. type: String,
  24. default: ''
  25. },
  26. //中心点经度
  27. longitude: {
  28. type: String,
  29. default: ''
  30. },
  31. //标记点数据
  32. markers: {
  33. type: Array,
  34. default () {
  35. return []
  36. }
  37. },
  38. //地图高度
  39. winHeight: {
  40. type: Number,
  41. default: 600
  42. },
  43. },
  44. data() {
  45. return {}
  46. },
  47. onReady() {
  48. },
  49. onShow: function() {
  50. },
  51. methods: {
  52. callouttap(e) {
  53. this.$emit("callouttap", e)
  54. },
  55. },
  56. }
  57. </script>
  58. <style>
  59. .map {
  60. flex: 1;
  61. width: 100%;
  62. }
  63. </style>