APIにはwhereオプションとsetWhereメソッド、その他の時間フィルターメソッドがあります。<\/P>
L.esri.Layers.FeatureLayer | Esri Leaflet<\/A><\/P> ジオメトリも設定する方法はありますか?現在はマップの境界を使ってクエリを制限していますが、それをどこかで簡単に上書きできますか?<\/P>今はTurfを使ってポイントインポリゴン検索を行うためにいくつか工夫していますが、まだクエリされていないマップの境界外のポイントをチェックする必要がある場合は機能しません。<\/P>Turfjs\/turf-inside GitHub<\/A><\/P> <\/P>自分でデータをクエリしてGeoJSONに変換し、Turfとプロパティフィルタリングを使って結果を検索することも考えていますが、Esri-Leafletですでにこのためのワークフローがあることを期待していました。何かアイデアはありますか?<\/P> <\/P>ありがとうございます。<\/P>
ジオメトリも設定する方法はありますか?現在はマップの境界を使ってクエリを制限していますが、それをどこかで簡単に上書きできますか?<\/P>
今はTurfを使ってポイントインポリゴン検索を行うためにいくつか工夫していますが、まだクエリされていないマップの境界外のポイントをチェックする必要がある場合は機能しません。<\/P>
<\/P>
自分でデータをクエリしてGeoJSONに変換し、Turfとプロパティフィルタリングを使って結果を検索することも考えていますが、Esri-Leafletですでにこのためのワークフローがあることを期待していました。何かアイデアはありますか?<\/P>
ありがとうございます。<\/P>
Also forgot you could also use L.esri.get to query the endpoint directly and let the server do the spatial query for you.
L.esri.get(featureLayerQueryUrl, { spatialRel: "esriSpatialRelIntersects", geometryType: "esriGeometryPoint", geometry: L.esri.Utils.geojsonToArcGIS(geojsonPoint) }, function(error, response){ var geojson = L.esri.Utils.responseToFeatureCollection(response); });
This is dropping down pretty low into the request and utilities methods. But you will save yourself from using Turf and they are all documented in the API ref API Reference | Esri Leaflet
Thanks Patrick!
I think this will work, because ultimately what I end up doing is an attribute and spatial query of the data.
I keep forgetting about L.esri.get, ha.
I get where you are coming from Rene.
You were probably hoping for something like this
L.esri.featureLayer(featureLayer, { spatialMethod: 'intersects', geometry: latlng }).addTo(map);
Implementing this would be VERY difficult since the assumption that features are only loaded inside the current viewport is baked into Esri Leaflet all the way down to the core.
That said this did remind me of a feature I wanted to add Add additional spatial query types to L.esri.Tasks.Query · Issue #374 · Esri/esri-leaflet · GitHub.
Once this is implemented you could do something like the following to render all polygons that intersect a point.
L.esri.Tasks.query(featureLayer).intersects(latlng).run(function(error, geojson){ // use L.GeoJSON to add features to map });
For right now you can just use the raw L.esri.Tasks.query to query as many features as possible and use Turf on the client side for your point in polygon.
// queries all features up to the transfer limit (usually 1000-2000) L.esri.Tasks.query(featureLayer).run(function(error, geojson){ // now use Turf over all the geojson });
If you are doing it yourself, try the REST API - it will return JSON and allows you to select a geometry and a geometry type. Your URL should be
http://YourArcServerDomainName/ArcGIS/rest/services/yourFeatureName/FeatureServer/0/query
Hit that with a formatted AJAX request and get back the JSON rep of the results
Looks like the ESRI-Leaflet plugin only runs where on the whole data set. My money is on it just hitting your rest endpoint anyway so do it yourself.
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.