JSAPI 4.1: How to load only the visible extent of a feature layer

1155
3
11-09-2016 10:15 AM
KevinHaeni
New Contributor III

I'm having a feature layer with lots of polygons (>200'000 points). Usually, when I load it with JSAPI 4.1, it seems to be loading a random subset of the polygons, maybe 5000, but they are usually not in the visible extent. 

How can I load only the polygons in the visible extent?

Tags (2)
3 Replies
RickeyFight
MVP Regular Contributor

Kevin,

I know this is possible with 3.18 but I am not sure about 4.1

I could not find it. 

FeatureLayer | API Reference | ArcGIS API for JavaScript 3.18 

MODE_ONDEMAND

In on-demand mode, the feature layer retrieves features from the server when needed. This is based on the requirements defined in the following properties:

  • Map properties such as the current spatial extent and time extent.
  • Layer properties such as time offset and definition expression.
KevinHaeni
New Contributor III

Thank you! Meanwhile, I received an official answer mentioning that the current version 4.2 does not yet support loading polygons based on the visible extent. 

I hope the DEV team is prioritizing this issue as the whole FeatureLayer seem pretty much useless when you have more features than what's reasonable for a MapService to return (5000-10000 features?).

Kevin

HyrumErnstrom
New Contributor III

Anyone figure this out?