當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


JavaScript ArcGIS normalizeUtils.normalizeCentralMeridian用法及代碼示例

基本信息

以下是所在類或對象的基本信息。

AMD: require(["esri/geometry/support/normalizeUtils"], (normalizeUtils) => { /* code goes here */ });

ESM: import * as normalizeUtils from "@arcgis/core/geometry/support/normalizeUtils";

對象: esri/geometry/support/normalizeUtils

自從:用於 JavaScript 4.3 的 ArcGIS API

用法說明

normalizeUtils.normalizeCentralMeridian函數(或屬性)的定義如下:

normalizeCentralMeridian (geometries, geometryService, requestOptions) {Promise<Geometry[]>}


標準化與中央子午線相交或落在世界範圍之外的幾何圖形,使其保持在視圖的坐標係內。僅支持 Web Mercator 和 WGS84 空間參考。

參數:

類型說明
geometries Geometry[]

要標準化的幾何數組。

geometryService GeometryService
可選的

用於執行規範化的幾何服務。如果此值為null,則使用esriConfig.geometryServiceUrl 中的默認幾何服務。

requestOptions Object
可選的

用於數據請求的附加 options

返回:

類型 說明
Promise<Geometry[]> 解析為歸一化幾何的數組。

例子:

// create a non-normalized line that crosses the dateline
const polyline = new Polyline({
  paths: [
    [170, 52.68],
    [190, 49.5]
  ]
});

normalizeUtils.normalizeCentralMeridian([polyline])
  .then(function(polylines){
    // returns a line representing the same geometry, but
    // now is normalized between -180 and 180 on the x-coordinate.
    // but represents the same feature
    const graphic = new Graphic({
      geometry: polylines[0],
      symbol: { type: "simple-line" }
    });

相關用法


注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 normalizeUtils.normalizeCentralMeridian。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。