版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yuliqi0429/article/details/90229780
findNearPoint(centerPoint,pointArr){
let minLen=99999999;
let nearP=centerPoint;
pointArr.forEach((point,index)=>{
let dic = Cesium.Cartesian3.distance(
new Cesium.Cartesian3(centerPoint[0], centerPoint[1], 0),
new Cesium.Cartesian3(point[0], point[1], 0)
);
if(dic<minLen){
minLen=dic;
nearP=point;
}
});
return nearP;
},