|
@@ -12,91 +12,6 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- // getMap() {
|
|
|
|
- // var _this = this
|
|
|
|
- // this.http.post( this.port.map.mapList, {},
|
|
|
|
- // res => {
|
|
|
|
- // if (res.code == "ok") {
|
|
|
|
- // var list = res.data;
|
|
|
|
-
|
|
|
|
- // if(list != null && list.length > 0){
|
|
|
|
- // var map = new AMap.Map('container', {
|
|
|
|
- // resizeEnable: true,
|
|
|
|
- // zoom: 5
|
|
|
|
- // });
|
|
|
|
- // map.clearMap();
|
|
|
|
- // var markers = [] ,
|
|
|
|
- // infoWindow ,
|
|
|
|
- // data = list;
|
|
|
|
-
|
|
|
|
- // var marker;
|
|
|
|
- // for(var i in data){
|
|
|
|
- // var jfong=[ data[i].ylng , data[i].xlat];
|
|
|
|
- // marker = new AMap.Marker({
|
|
|
|
- // position: jfong,
|
|
|
|
- // zIndex: 101,
|
|
|
|
- // map:map
|
|
|
|
- // });
|
|
|
|
- // marker.setMap(map);
|
|
|
|
- // marker.msg = data[i];
|
|
|
|
- // marker.on('click', function(data){
|
|
|
|
- // var str = "<div class='window'>" +
|
|
|
|
- // "<div class='info-top'><div>"+ data.target.msg.companyName +"</div><i class='el-icon-close' @click='closeInfoWindow()'></i></div>" +
|
|
|
|
- // "<div class='info-middle'>";
|
|
|
|
- // for(var i in data.target.msg.list){
|
|
|
|
- // str += "<div class='info-item'><a @click='jumpToMold("+ data.target.msg.list[i].id +")'>" + data.target.msg.list[i].modelName + "(" + data.target.msg.list[i].modelNo + ")</a>"
|
|
|
|
- // if(data.target.msg.list[i].state=='0'){
|
|
|
|
- // str += "<span class='info-state'><span class='info-ball' style='background:#999999;'></span>" + _this.$t('base.static') + "</span>"
|
|
|
|
- // } else {
|
|
|
|
- // str += "<span class='info-state'><span class='info-ball' style='background:#00CD66;'></span>" + _this.$t('base.run') + "</span>"
|
|
|
|
- // }
|
|
|
|
- // str += "</div>"
|
|
|
|
- // }
|
|
|
|
- // str += "</div>" +
|
|
|
|
- // "</div>"
|
|
|
|
-
|
|
|
|
- // var MyComponent = Vue.extend({
|
|
|
|
- // template: str ,
|
|
|
|
- // methods:{
|
|
|
|
- // closeInfoWindow:function() {
|
|
|
|
- // map.clearInfoWindow();
|
|
|
|
- // },
|
|
|
|
- // jumpToMold:function(id) {
|
|
|
|
- // _this.$router.push("/moldList/" + id + "/0");
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- // var component= new MyComponent().$mount();
|
|
|
|
- // infoWindow.setContent(component.$el);
|
|
|
|
- // infoWindow.open(map, data.lnglat);
|
|
|
|
- // });
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // infoWindow = new AMap.InfoWindow({
|
|
|
|
- // isCustom: true,
|
|
|
|
- // draggable: true, //是否可拖动
|
|
|
|
- // showShadow: true,
|
|
|
|
- // autoMove: true,
|
|
|
|
- // offset: new AMap.Pixel(0, -31),
|
|
|
|
- // content:""
|
|
|
|
- // });
|
|
|
|
-
|
|
|
|
- // marker.setMap(map);
|
|
|
|
- // }
|
|
|
|
- // } else {
|
|
|
|
- // this.$message({
|
|
|
|
- // message: res.msg,
|
|
|
|
- // type: "error"
|
|
|
|
- // });
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
- // error => {
|
|
|
|
- // this.$message({
|
|
|
|
- // message: error,
|
|
|
|
- // type: "error"
|
|
|
|
- // });
|
|
|
|
- // });
|
|
|
|
- // },
|
|
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
//this.getMap();
|
|
//this.getMap();
|
|
@@ -130,9 +45,7 @@
|
|
if (!item) {
|
|
if (!item) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
- //var parts = item.split(',');
|
|
|
|
//返回经纬度
|
|
//返回经纬度
|
|
- //return [parseFloat(parts[0]), parseFloat(parts[1])];
|
|
|
|
return [parseFloat(item.lng), parseFloat(item.lat)];
|
|
return [parseFloat(item.lng), parseFloat(item.lat)];
|
|
},
|
|
},
|
|
getHoverTitle: function(dataItem, idx) {
|
|
getHoverTitle: function(dataItem, idx) {
|
|
@@ -154,12 +67,12 @@
|
|
width: 6,
|
|
width: 6,
|
|
height: 6,
|
|
height: 6,
|
|
// fillStyle:'rgba(0, 236, 252, 0.9)'
|
|
// fillStyle:'rgba(0, 236, 252, 0.9)'
|
|
- fillStyle:'rgba(255, 0, 0, 1)'
|
|
|
|
|
|
+ fillStyle:'rgba(255, 0, 0, 1)',
|
|
},
|
|
},
|
|
//鼠标hover时的title信息
|
|
//鼠标hover时的title信息
|
|
hoverTitleStyle: {
|
|
hoverTitleStyle: {
|
|
position: 'top'
|
|
position: 'top'
|
|
- }
|
|
|
|
|
|
+ },
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
@@ -242,14 +155,9 @@
|
|
|
|
|
|
labelCtx.closePath();
|
|
labelCtx.closePath();
|
|
labelCtx.fill();
|
|
labelCtx.fill();
|
|
- // labelCtx.fillRect(centerX - halfTxtWidth - 3 * pixelRatio,
|
|
|
|
- // centerY - 11 * pixelRatio,
|
|
|
|
- // textMetrics.width + 6 * pixelRatio,
|
|
|
|
- // 22 * pixelRatio);
|
|
|
|
|
|
|
|
labelCtx.fillStyle = '#ffffff';
|
|
labelCtx.fillStyle = '#ffffff';
|
|
labelCtx.textBaseline = 'middle';
|
|
labelCtx.textBaseline = 'middle';
|
|
- //labelCtx.stroke();
|
|
|
|
|
|
|
|
labelCtx.fillText(text, centerX - halfTxtWidth, centerY - 5);
|
|
labelCtx.fillText(text, centerX - halfTxtWidth, centerY - 5);
|
|
labelCtx.fillText(num , centerX - halfNumWidth, centerY + 12);
|
|
labelCtx.fillText(num , centerX - halfNumWidth, centerY + 12);
|
|
@@ -267,9 +175,7 @@
|
|
if (!item) {
|
|
if (!item) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
- // var parts = item.split(',');
|
|
|
|
//返回经纬度
|
|
//返回经纬度
|
|
- //return [parseFloat(parts[0]), parseFloat(parts[1])];
|
|
|
|
return [parseFloat(item.lng), parseFloat(item.lat)];
|
|
return [parseFloat(item.lng), parseFloat(item.lat)];
|
|
},
|
|
},
|
|
renderConstructor: MyRender,
|
|
renderConstructor: MyRender,
|
|
@@ -294,10 +200,6 @@
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
|
|
- map.on('click', function(item) {
|
|
|
|
- console.log(item);
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
window.distCluster = distCluster;
|
|
window.distCluster = distCluster;
|
|
|
|
|
|
map.on('zoomend', function() {
|
|
map.on('zoomend', function() {
|
|
@@ -315,13 +217,6 @@
|
|
pointStyle.width = pointStyle.height = 2 * Math.pow(1.2, map.getZoom() - 3);
|
|
pointStyle.width = pointStyle.height = 2 * Math.pow(1.2, map.getZoom() - 3);
|
|
|
|
|
|
$('<div id="loadingTip">加载数据,请稍候...</div>').appendTo(document.body);
|
|
$('<div id="loadingTip">加载数据,请稍候...</div>').appendTo(document.body);
|
|
- // $.get('https://a.amap.com/amap-ui/static/data/10w.txt', function(csv) {
|
|
|
|
-
|
|
|
|
- // $('#loadingTip').remove();
|
|
|
|
- // var data = csv.split('\n');
|
|
|
|
- // distCluster.setData(data);
|
|
|
|
- // pointSimplifierIns.setData(data);
|
|
|
|
- // });
|
|
|
|
_this.http.post( _this.port.map.newMap, {},
|
|
_this.http.post( _this.port.map.newMap, {},
|
|
res => {
|
|
res => {
|
|
$('#loadingTip').remove();
|
|
$('#loadingTip').remove();
|