map.vue 929 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <view>
  3. <view class="page-body">
  4. <view class="page-section page-section-gap">
  5. <map style="width: 100%; height: 300px;" clickable="true" :latitude="latitude" :longitude="longitude" :markers="covers">
  6. </map>
  7. </view>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. data() {
  14. return {
  15. longitude: '',
  16. latitude: '',
  17. id: 0, // 使用 marker点击事件 需要填写id
  18. title: 'map',
  19. covers: []
  20. }
  21. },
  22. onLoad: function(option) {
  23. const item = JSON.parse(decodeURIComponent(option.item));
  24. this.longitude = item.longitude;
  25. this.latitude = item.latitude;
  26. var cover = [];
  27. var cov = {};
  28. cov["latitude"] = item.latitude;
  29. cov["longitude"] = item.longitude;
  30. cov["iconPath"] = '../../../static/img/map.png';
  31. cover.push(cov);
  32. cover.push(cov);
  33. this.covers = cover;
  34. var kk = this.covers;
  35. },
  36. methods: {
  37. }
  38. }
  39. </script>
  40. <style>
  41. </style>