Skip to content

Commit a55234b

Browse files
fix 几何分析 api
1 parent 13cc784 commit a55234b

File tree

9 files changed

+21
-21
lines changed

9 files changed

+21
-21
lines changed

examples/leaflet/ugc_buffer.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ <h5 class="panel-title text-center">缓冲区分析</h5>
4040
<div class="panel-body content">
4141
<div class="panel">
4242
<div class="input-group">
43-
<span class="input-group-addon">缓冲区半径()</span>
44-
<input class="form-control" id="radius" type="number" value="300000" />
43+
<span class="input-group-addon">缓冲区半径()</span>
44+
<input class="form-control" id="radius" type="number" value="2" />
4545
</div>
4646
</div>
4747
<input type="button" class="btn btn-default" value="分析" onclick="createUGCBuffer()" />&nbsp;
@@ -81,7 +81,7 @@ <h5 class="panel-title text-center">缓冲区分析</h5>
8181
clearLayer();
8282
var radius = parseFloat(document.getElementById('radius').value);
8383
var geometryAnalysis = new L.supermap.GeometryAnalysis();
84-
var res = geometryAnalysis.buffer(pointGeometryData, radius / 100000);
84+
var res = geometryAnalysis.buffer(pointGeometryData, radius);
8585
bufferLayer = L.geoJSON(res);
8686
bufferLayer.addTo(map);
8787
}

examples/leaflet/ugc_computeParallel.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h5 class="panel-title text-center">根据设置距离获取直线平行线</h5>
4040
<div class="panel-body content">
4141
<div class="panel">
4242
<div class="input-group">
43-
<span class="input-group-addon">线距()</span>
43+
<span class="input-group-addon">线距()</span>
4444
<input class="form-control" id="distance" type="number" value="5" />
4545
</div>
4646
</div>

examples/mapboxgl/ugc_buffer.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ <h5 class="panel-title text-center">缓冲区分析</h5>
4040
<div class="panel-body content">
4141
<div class="panel">
4242
<div class="input-group">
43-
<span class="input-group-addon">缓冲区半径()</span>
44-
<input class="form-control" id="radius" type="number" value="30000" />
43+
<span class="input-group-addon">缓冲区半径()</span>
44+
<input class="form-control" id="radius" type="number" value="2" />
4545
</div>
4646
</div>
4747
<input type="button" class="btn btn-default" value="分析" onclick="createBuffer()" />&nbsp;
@@ -102,7 +102,7 @@ <h5 class="panel-title text-center">缓冲区分析</h5>
102102
clearLayer();
103103
var radius = parseFloat(document.getElementById('radius').value);
104104
var geometryAnalysis = new mapboxgl.supermap.GeometryAnalysis();
105-
var res = geometryAnalysis.buffer(pointGeometryData, radius / 100000);
105+
var res = geometryAnalysis.buffer(pointGeometryData, radius);
106106
var bufferSource = {
107107
type: 'geojson',
108108
data: res

examples/mapboxgl/ugc_computeParallel.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h5 class="panel-title text-center">根据设置距离获取直线平行线</h5>
4040
<div class="panel-body content">
4141
<div class="panel">
4242
<div class="input-group">
43-
<span class="input-group-addon">线距()</span>
43+
<span class="input-group-addon">线距()</span>
4444
<input class="form-control" id="distance" type="number" value="5" />
4545
</div>
4646
</div>

examples/maplibregl/ugc_buffer.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ <h5 class="panel-title text-center">缓冲区分析</h5>
4040
<div class="panel-body content">
4141
<div class="panel">
4242
<div class="input-group">
43-
<span class="input-group-addon">缓冲区半径()</span>
44-
<input class="form-control" id="radius" type="number" value="30000" />
43+
<span class="input-group-addon">缓冲区半径()</span>
44+
<input class="form-control" id="radius" type="number" value="2" />
4545
</div>
4646
</div>
4747
<input type="button" class="btn btn-default" value="分析" onclick="createBuffer()" />&nbsp;
@@ -102,7 +102,7 @@ <h5 class="panel-title text-center">缓冲区分析</h5>
102102
clearLayer();
103103
var radius = parseFloat(document.getElementById('radius').value);
104104
var geometryAnalysis = new maplibregl.supermap.GeometryAnalysis();
105-
var res = geometryAnalysis.buffer(pointGeometryData, radius / 100000);
105+
var res = geometryAnalysis.buffer(pointGeometryData, radius);
106106
var bufferSource = {
107107
type: 'geojson',
108108
data: res

examples/maplibregl/ugc_computeParallel.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h5 class="panel-title text-center">根据设置距离获取直线平行线</h5>
4040
<div class="panel-body content">
4141
<div class="panel">
4242
<div class="input-group">
43-
<span class="input-group-addon">线距()</span>
43+
<span class="input-group-addon">线距()</span>
4444
<input class="form-control" id="distance" type="number" value="5" />
4545
</div>
4646
</div>

examples/openlayers/ugc_buffer.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ <h5 class="panel-title text-center">缓冲区分析</h5>
4040
<div class="panel-body content">
4141
<div class="panel">
4242
<div class="input-group">
43-
<span class="input-group-addon">缓冲区半径()</span>
44-
<input class="form-control" id="radius" type="number" value="300000" />
43+
<span class="input-group-addon">缓冲区半径()</span>
44+
<input class="form-control" id="radius" type="number" value="2" />
4545
</div>
4646
</div>
4747
<input type="button" class="btn btn-default" value="分析" onclick="createBuffer()" />&nbsp;
@@ -98,7 +98,7 @@ <h5 class="panel-title text-center">缓冲区分析</h5>
9898
type: 'Point'
9999
}
100100
},
101-
radius / 100000
101+
radius
102102
);
103103
polygon = new ol.geom.Polygon(res.geometry.coordinates);
104104
var polygonSource = new ol.source.Vector({

examples/openlayers/ugc_computeParallel.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h5 class="panel-title text-center">根据设置距离获取直线平行线</h5>
4040
<div class="panel-body content">
4141
<div class="panel">
4242
<div class="input-group">
43-
<span class="input-group-addon">线距()</span>
43+
<span class="input-group-addon">线距()</span>
4444
<input class="form-control" id="distance" type="number" value="5" />
4545
</div>
4646
</div>

src/common/util/GeometryAnalysis.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class GeometryAnalysis extends Events {
4747
* @version 11.2.0
4848
* @description 缓冲区分析。
4949
* @param {GeoJSONFeature} feature - geojson 要素。
50-
* @param {number} radius - 缓冲区距离。
50+
* @param {number} radius - 缓冲区距离,单位与数据单位一致
5151
* @returns {GeoJSONFeature} 结果要素。
5252
*/
5353
buffer(feature, radius) {
@@ -347,7 +347,7 @@ export class GeometryAnalysis extends Events {
347347
* @version 11.2.0
348348
* @description 计算经纬度面积。
349349
* @param {GeoJSONFeature} feature - geojson 面要素。
350-
* @returns {number} 经纬度面积。
350+
* @returns {number} 经纬度面积,结果单位与参数单位一致
351351
*/
352352
computeGeodesicArea(feature) {
353353
const ugFeature = geojson2UGGeometry(feature);
@@ -376,9 +376,9 @@ export class GeometryAnalysis extends Events {
376376
* @description 计算测地线长度。
377377
* @param {Array} xArray - x 坐标数组。
378378
* @param {Array} yArray - y 坐标数组。
379-
* @param {number} majorAxis - 测地线所在椭球体的长轴。
379+
* @param {number} majorAxis - 测地线所在椭球体的长轴,单位为米
380380
* @param {number} flatten - 测地线所在椭球体的扁率。
381-
* @returns {number} 测地线的长度。
381+
* @returns {number} 测地线的长度,结果单位为米
382382
*/
383383
computeGeodesicDistance(xArray, yArray, majorAxis, flatten) {
384384
let pXArray = geojsonCoords2UGDoubleArray(xArray);
@@ -390,7 +390,7 @@ export class GeometryAnalysis extends Events {
390390
* @version 11.2.0
391391
* @description 根据距离获取线要素的平行线。
392392
* @param {GeoJSONFeature} feature - geojson 要素。
393-
* @param {number} distance - 平行线距离。
393+
* @param {number} distance - 平行线距离,单位与数据单位一致
394394
* @returns {GeoJSONFeature} 结果要素。
395395
*/
396396
computeParallel(feature, distance) {

0 commit comments

Comments
 (0)