vue+高德地图根据不同标准换图标
关键;
①
代码:
Markup
realPointSimplifierIns(){
this.map =amapManager.getMap();
let data="";
//this.monitorInfo=this.tableData;
let i=0;
let list=this.tableData;
this.tableData.forEach((item) => {
// console.log(""[[[[]]]],item);
if(item.longitude){
this.monitorInfo.push(item)
data +=[item.longitude+","+item.latitude] + "|"
}
});
// console.log("4454848",data);
AMapUI.load(['ui/geo/DistrictCluster','ui/misc/PointSimplifier', 'lib/$'], (DistrictCluster, PointSimplifier, $)=>{
const blue = require('@/assets/cmp.png') ;
const yellow = require('@/assets/yel.png') ;
const ora = require('@/assets/ora.png') ;
const red = require('@/assets/red.png') ;
const gre = require('@/assets/gre.png') ;
let groupStyleMap ;
let pointSimplifierIns;
if (!PointSimplifier.supportCanvas) {
alert('当前环境不支持 Canvas!');
return;
}
let distCluster = new DistrictCluster({
zIndex: 100,
topAdcodes: [330000],
map: this.map, //所属的地图实例
getPosition: function(item) {
if (!item) {
return null;
}
var parts = item.split(',');
//返回经纬度
return [parseFloat(parts[0]), parseFloat(parts[1])];
}
});
window.distCluster = distCluster;
pointSimplifierIns = new PointSimplifier({
map: this.map, //所属的地图实例
getPosition: function(item) {
if (!item) {