diff --git a/dist/index.html b/dist/index.html index 3eeeae4..c342717 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1 +1 @@ -
{{inoutmsg}} {{inouttime|formatDate}}
diff --git a/src/components/VMap.vue b/src/components/VMap.vue index 4f5bfef..c6e0aea 100644 --- a/src/components/VMap.vue +++ b/src/components/VMap.vue @@ -13,11 +13,11 @@ export default { data(){ return{ map:'', - //mapData:[] + mapdataarr:[] } }, mounted(){ - + this.map = new BMap.Map('map', {enableMapClick: false}) }, watch:{ @@ -26,36 +26,43 @@ export default { // } mapdata: function () { this.$nextTick(()=>{ + this.mapdataarr = this.mapdata + let mapData = this.mapdataarr + // let map = this.map + console.log(this.mapdata) + // let data = [ + // {Name:'万达停车场1',lonId:'111.742579',latId:'40.818675',status:0,freeBrethNum:0,plBerthNum:1000,plName:'万达广场停车场1',plAddress:'北京万达广场1'}, + // {Name:'万达停车场2',lonId:'111.622579',latId:'40.878675',status:1,freeBrethNum:100,plBerthNum:800,plName:'万达广场停车场2',plAddress:'北京万达广场2'}, + // {Name:'万达停车场333333',lonId:'111.782579',latId:'40.778675',status:2,freeBrethNum:300,plBerthNum:500,plName:'万达广场停车场3',plAddress:'北京万达广场3'} + // ]; + // let data = this.data + console.log(mapData[0].lonId) + console.log(mapData[0].latId) + var point = new BMap.Point(mapData[0].lonId, mapData[0].latId) + this.map.centerAndZoom(point, 22) + var mapStyle={ style : "midnight" } + this.map.enableScrollWheelZoom(false); + this.map.setMapStyle(mapStyle); + // var marker = new BMap.Marker(point) // 创建标注 + // map.addOverlay(marker) // 将标注添加到地图中 + this.drawMap() }) - } + }, }, methods:{ initMap(){ }, drawMap(){ - let mapData = this.mapdata - let map = this.map - console.log(this.mapdata) - // let data = [ - // {Name:'万达停车场1',lonId:'111.742579',latId:'40.818675',status:0,freeBrethNum:0,plBerthNum:1000,plName:'万达广场停车场1',plAddress:'北京万达广场1'}, - // {Name:'万达停车场2',lonId:'111.622579',latId:'40.878675',status:1,freeBrethNum:100,plBerthNum:800,plName:'万达广场停车场2',plAddress:'北京万达广场2'}, - // {Name:'万达停车场333333',lonId:'111.782579',latId:'40.778675',status:2,freeBrethNum:300,plBerthNum:500,plName:'万达广场停车场3',plAddress:'北京万达广场3'} - // ]; - // let data = this.data - map = new BMap.Map('map', {enableMapClick: false}) - var point = new BMap.Point(mapData[0].lonId, mapData[0].latId) - map.centerAndZoom(point, 22) - var mapStyle={ style : "midnight" } - map.enableScrollWheelZoom(false); - map.setMapStyle(mapStyle); - // var marker = new BMap.Marker(point) // 创建标注 - // map.addOverlay(marker) // 将标注添加到地图中 - - map.clearOverlays(); + + + + this.map.clearOverlays(); var i = 0; var points = []; + let mapData = this.mapdata + var that = this for (var item in mapData) { (function (x) { var itemthat = item; @@ -91,9 +98,9 @@ export default { // }); marker.setTop(true,27000000); - map.addOverlay(marker); + that.map.addOverlay(marker); var myLabel; - map.removeOverlay(myLabel); + that.map.removeOverlay(myLabel); // map.removeOverlay(myLabel); myLabel = new BMap.Label( diff --git a/src/components/VParking.vue b/src/components/VParking.vue index 750747e..86346a7 100644 --- a/src/components/VParking.vue +++ b/src/components/VParking.vue @@ -1,6 +1,6 @@