MKGeodesicPolyline可以沿着线分为任意数量的点吗?

问题描述

可以将MKGeodesicpolyline划分为给定的点数,然后获取每个点的CLLocationCoordinate2D吗? 像这样:

let coordinate1=CLLocationCoordinate2D(latitude: abc,longitude: def)
let coordinate2=CLLocationCoordinate2D(latitude: ghi,longitude: jkl)
let points=[coordinate1,coordinate2]

let myRoute=MKGeodesicpolyline(coordinates: points,count: points.count)
let pointsEnroute=myRoute.getEquallydisplacedPoints(numOfPoints: 10)

平台是iOS,语言应该是Swift。

这样我将获得10 pointsEnroute作为所有位于“ myRoute”上的坐标数组?

感谢您的建议。

解决方法

我在以下位置找到了此解决方案:https://gist.github.com/freak4pc/98c813d8adb8feb8aee3a11d2da1373f

function autoFill() {
        if (document.getElementById("myText").value.length > 4) {
            var data2send = JSON.stringify(document.getElementById("myText").value);
            $.ajax({
                url: 'https://localhost:44348/api/values/CheckDatabase',type: 'POST',data: data2send,contentType: 'application/json',dataType: 'json',success: function (data) {
                    document.getElementById("myText").value = data;
                },});
        }

    }