index.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <view class="main">
  3. <map class="map" :latitude="latitude" :longitude="longitude" :scale="scale" :markers="covers"></map>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. latitude: 43.3517, // 设置地图的纬度
  11. longitude: 125.86854, // 设置地图的经度
  12. scale: 13,
  13. covers: [{
  14. id: 0,
  15. latitude: 43.34931,
  16. longitude: 125.87221,
  17. width: 20, //宽
  18. height: 30, //高
  19. callout: { //自定义标记点上方的气泡窗口 点击有效
  20. content: '吊水壶森林公园', //文本
  21. color: '#ffffff', //文字颜色
  22. fontSize: 14, //文本大小
  23. borderRadius: 15, //边框圆角
  24. borderWidth: '10',
  25. bgColor: '#e51860', //背景颜色
  26. display: 'ALWAYS', //常显
  27. },
  28. }, {
  29. id: 1,
  30. latitude: 43.34526,
  31. longitude: 125.85224,
  32. width: 20, //宽
  33. height: 30, //高
  34. callout: { //自定义标记点上方的气泡窗口 点击有效
  35. content: '公厕', //文本
  36. color: '#ffffff', //文字颜色
  37. fontSize: 14, //文本大小
  38. borderRadius: 15, //边框圆角
  39. borderWidth: '10',
  40. bgColor: '#e51860', //背景颜色
  41. display: 'ALWAYS', //常显
  42. },
  43. }]
  44. }
  45. },
  46. methods: {
  47. }
  48. }
  49. </script>
  50. <style lang="scss" scoped>
  51. .main {
  52. display: flex;
  53. flex-direction: column;
  54. width: 100vw;
  55. height: 100vh;
  56. .map {
  57. width: 100%;
  58. height: 100vh;
  59. .button {
  60. background-color: var(--f3CColor);
  61. }
  62. }
  63. }
  64. </style>