mapMarker.vue 867 B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <div>
  3. <baidu-map class="map" :center="{lng: info.lon, lat:info.lat}" :zoom="16" :scroll-wheel-zoom="true" ak="n4CW0ajDw1LBUIj1RTlwd1bbTTXuN8v6">
  4. <bm-marker :position="{lng: info.lon, lat:info.lat}" :dragging="true" animation="BMAP_ANIMATION_BOUNCE">
  5. <bm-label :content="info.addressLine" :labelStyle="{color: 'red', fontSize : '16px'}" :offset="{width: -100, height: 30}"/>
  6. </bm-marker>
  7. </baidu-map>
  8. </div>
  9. </template>
  10. <script>
  11. import {BaiduMap, BmControl,BmLabel, BmView, BmAutoComplete, BmLocalSearch, BmMarker} from 'vue-baidu-map'
  12. export default {
  13. name: "mapMarker",
  14. components: {
  15. BaiduMap,
  16. BmMarker,
  17. BmLabel
  18. },
  19. props: {
  20. info:{
  21. type: Object,
  22. default:()=>{
  23. return {lng: null, lat: null}
  24. }
  25. }
  26. }
  27. }
  28. </script>
  29. <style scoped>
  30. .map{
  31. width: 100%;
  32. height: 400px;
  33. }
  34. </style>