代码拉取完成,页面将自动刷新
同步操作将从 刘斌/leaflet-wind 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
L.GeometryUtil = L.extend(L.GeometryUtil || {}, {
// Ported from the OpenLayers implementation. See https://github.com/openlayers/openlayers/blob/master/lib/OpenLayers/Geometry/LinearRing.js#L270
geodesicArea: function (latLngs) {
var pointsCount = latLngs.length
var area = 0.0
var d2r = (Math.PI / 180)
var p1; var p2
// console.log(pointsCount+"个");
// console.log(L.LatLng.DEG_TO_RAD);
// console.log(Math.PI/180);
if (pointsCount > 2) {
for (var i = 0; i < pointsCount; i++) {
p1 = latLngs[i]
p2 = latLngs[(i + 1) % pointsCount]
area += ((p2.lng - p1.lng) * d2r) *
(2 + Math.sin(p1.lat * d2r) + Math.sin(p2.lat * d2r))
}
area = area * 6378137.0 * 6378137.0 / 2.0
}
return Math.abs(area)
},
readableArea: function (area, isMetric) {
var areaStr
if (isMetric) {
if (area >= 1000000) {
areaStr = (area * 0.000001).toFixed(2) + ' km²'
} else {
areaStr = area.toFixed(2) + ' m²'
}
} else {
area *= 0.836127 // Square yards in 1 meter
if (area >= 3097600) { // 3097600 square yards in 1 square mile
areaStr = (area / 3097600).toFixed(2) + ' mi²'
} else if (area >= 4840) { // 48040 square yards in 1 acre
areaStr = (area / 4840).toFixed(2) + ' acres'
} else {
areaStr = Math.ceil(area) + ' yd²'
}
}
return areaStr
},
readableDistance: function (distance, isMetric) {
var distanceStr
if (isMetric) {
// show metres when distance is < 1km, then show km
if (distance > 1000) {
distanceStr = (distance / 1000).toFixed(2) + ' km'
} else {
distanceStr = Math.ceil(distance) + ' m'
}
} else {
distance *= 1.09361
if (distance > 1760) {
distanceStr = (distance / 1760).toFixed(2) + ' miles'
} else {
distanceStr = Math.ceil(distance) + ' yd'
}
}
return distanceStr
}
})
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。