计算feometry面积esri/geometry/geometryEngineAsync

来源:互联网 发布:网络架构师年薪 编辑:程序博客网 时间:2024/05/24 05:53
Object: esri/geometry/geometryEngineAsync
require(["esri/geometry/geometryEngineAsync"], function(geometryEngineAsync) { /* code goes here */ });

Description

(Added at v3.13)
A client-side asynchronous geometry engine. The difference between the geometryEngineAsync and geometryEngine modules is the async functions return aPromise that are resolved with the same argument as is returned by the sync functions. See theunion method for a code sample.

Known limitation: the geometryEngineAsync module requires a browser with Web Worker support. This can be tested for by inspecting thewindow.Worker property in the browser. In addition to this, it is only supported using AMD-style coding syntax.

geodesicArea(geometry, unit)PromiseCalculates the area of the input geometry.

geodesicArea(geometry, unit)函数详解

Calculates the area of the input geometry. As opposed to planarArea(), geodesicArea takes into account the curvature of the earth when performing this calculation. Therefore, when using input geometries with a spatial reference of either WGS-84 (wkid: 4326) or Web Mercator Auxiliary Sphere (wkid: 3857), it is best practice to calculate areas using geodesicArea(). If the input geometries have a projected coordinate system other than Web Mercator, use planarArea() instead.

This method only works with WGS-84 (wkid: 4326) and Web Mercator (wkid: 3857) spatial references.
Return type: Promise
Parameters:<Geometry> geometryRequiredThe input geometry.<String |Number> unitRequiredMeasurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the numeric codes listed here.

Possible Values: acres | ares | hectares | square-feet | square-meters | square-yards | square-kilometers | square-miles

原创粉丝点击