| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <template>
- <div>
- <div id="container">
- </div>
- </div>
- </template>
- <script>
- export default {
- name:'amapLong',
- props:["row","arriveIcon"],
- data(){
- return {
- }
- },
- mounted(){
- this.getMap();
- },
- methods:{
- getMap(){
- var _this = this;
- var map = new AMap.Map('container', {
- resizeEnable: true, //是否监控地图容器尺寸变化
- zoom:18,
- center:[_this.row.poleLng, _this.row.poleLat]
- });
- // map.setFeatures(['bg', 'road', 'building']);
- // map.setCity('长沙市');
- // map.setMapStyle("amap://styles/blue");
- // new AMap.Marker({
- // map:map,
- // icon:"http://106.52.134.22:9080/000000-bladex/upload/20200606/diangan.png",
- // position:[item.poleLng, item.poleLat],
- // autoRotation: true
- // });
- var circle = new AMap.Marker({
- position:[_this.row.poleLng, _this.row.poleLat ],
- // radius:100,
- // strokeColor:"#fff",
- // strokeOpacity:1,
- // strokeWeight:3,
- // fillColor:"#fff",
- // fillOpacity:1
- map:map,
- icon:_this.arriveIcon || "http://106.52.134.22:9080/000000-bladex/upload/20200606/diangan.png",
- autoRotation:true
- });
- map.add(circle);
-
- }
- }
- }
- </script>
- <style scoped>
- #container{
- width:600px;
- height:300px;
- }
- #container >>> .amap-icon img{
- width:71px !important;
- height:71px !important;
- }
- </style>
|