基本信息
以下是所在類或對象的基本信息。
AMD:
require(["esri/rest/support/TopFilter"], (TopFilter) => { /* code goes here */ });
ESM:
import TopFilter from "@arcgis/core/rest/support/TopFilter";
類:
esri/rest/support/TopFilter
繼承: TopFilter > Accessor
自從:用於 JavaScript 4.20 的 ArcGIS API
用法說明
此類定義了頂級過濾器參數,用於對 FeatureLayer 中的要素執行頂級要素查詢。在函數層上調用任何頂級查詢方法時,必須在 TopFeaturesQuery 對象上設置此參數。它用於設置 top 特征查詢使用的 groupByFields、orderByFields 和計數條件。例如,您可以使用FeatureLayer的queryTopFeatures()方法查詢美國每個州人口最多的三個縣。
// query the top three most populous counties from each state.
// Results will be ordered based the population of each county in descending order
// top query will run against all features available in the service
const query = new TopFeaturesQuery({
outFields: ["State, Pop_total, County"],
topFilter: new TopFilter({
topCount: 3,
groupByFields: ["State"],
orderByFields: ["Pop_total DESC"]
})
});
featureLayer.queryTopFeatures(query)
.then(function(response){
// returns a feature set with features containing the most populous
// three counties in each state ordered by the number of population.
// The following attributes are returned as well: State, Pop_total, County
});
相關用法
- JavaScript ArcGIS TopFilter.orderByFields用法及代碼示例
- JavaScript ArcGIS TopFilter.topCount用法及代碼示例
- JavaScript ArcGIS TopFeaturesQuery.spatialRelationship用法及代碼示例
- JavaScript ArcGIS TopFeaturesQuery.where用法及代碼示例
- JavaScript ArcGIS TopFeaturesQuery用法及代碼示例
- JavaScript ArcGIS TopFeaturesQuery.units用法及代碼示例
- JavaScript ArcGIS TopFeaturesQuery.topFilter用法及代碼示例
- JavaScript ArcGIS TopFeaturesQuery.outFields用法及代碼示例
- JavaScript ArcGIS TopFeaturesQuery.orderByFields用法及代碼示例
- JavaScript ArcGIS TopFeaturesQuery.timeExtent用法及代碼示例
- JavaScript TimeSlider.container用法及代碼示例
- JavaScript TypedArray.sort()用法及代碼示例
- JavaScript TimeSlider.next用法及代碼示例
- JavaScript Track.classes用法及代碼示例
- JavaScript TimeSlider.mode用法及代碼示例
- JavaScript ArcGIS TimeInfo.fullTimeExtent用法及代碼示例
- JavaScript TableList trigger-action事件用法及代碼示例
- JavaScript TypedArray map()用法及代碼示例
- JavaScript ArcGIS Terminal用法及代碼示例
- JavaScript TypedArray every()用法及代碼示例
- JavaScript TimeSlider.loop用法及代碼示例
- JavaScript TypedArray.indexOf()用法及代碼示例
- JavaScript TypedArray findIndex()用法及代碼示例
- JavaScript ArcGIS TileLayer layerview-create-error事件用法及代碼示例
- JavaScript Track.goToOverride用法及代碼示例
注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 TopFilter。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。