0
我看this documentation和getClosesPoint()想获得最接近的功能,以给定的特征是这样的:的OpenLayers 3 - 一个给定的特征
var foo = pretendLocation.getGeometry();
console.log(getClosestPoint(foo));
我也试过:
console.log(pretendLocation.getClosestPoint());
pretendLocation
是我创建的一个功能,
var pretendLocation = new ol.Feature({
geometry: new ol.geom.Point(ol.proj.transform([-121, 37], 'EPSG:4326', 'EPSG:3857'))
});
我使用的是getClosestPoint()
不正确?我用什么函数来获得给定特征的最近特征?我搜索了其他帖子,但找不到解决方案。我从两种方式获取控制台错误 - getClosestPoint未定义,以及无法读取0错误的属性。