I do not know why "line" features display incomplete significantly when using SceneView but correctly when using MapView.
-local Arcgis server.
-local Sceneview.
-FeatureLayer of a dynamic map service.
MapView:
Scene View:
Features in a feature layer are fetched using the query function on a feature service, which is documented here: ArcGIS REST API
The controller is in charge of determining when to send those queries, besides the first query, which is sent before the controller is instantiated. The controller watches its extent property and the layer's definition expression for changes, and it sends a new query when a change occurs. This is why changing the extent property on the controller or changing the definition expression causes new features to be fetched.
If you need to set this process up for all feature layers, you might try something like this:
view<SPAN class="punctuation token">.</SPAN><SPAN class="token function">watch</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'stationary'</SPAN><SPAN class="punctuation token">,</SPAN> isStationary <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>isStationary<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN> view<SPAN class="punctuation token">.</SPAN>layerViews<SPAN class="punctuation token">.</SPAN><SPAN class="token function">forEach</SPAN><SPAN class="punctuation token">(</SPAN>lv <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>lv<SPAN class="punctuation token">.</SPAN>layer<SPAN class="punctuation token">.</SPAN>type <SPAN class="operator token">===</SPAN> <SPAN class="string token">'feature'</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN> lv<SPAN class="punctuation token">.</SPAN>controller<SPAN class="punctuation token">.</SPAN>extent <SPAN class="operator token">=</SPAN> view<SPAN class="punctuation token">.</SPAN>extent<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
I think that will catch group layers.
In general, there's one layerView for each layer. The layer itself represents the reference to some back-end resource (or sometimes a front-end resource) while the layerView contains logic and information about how the layer is actually displayed in the view.
You might try something like this for 3D:
view<SPAN class="punctuation token">.</SPAN><SPAN class="token function">watch</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'stationary'</SPAN><SPAN class="punctuation token">,</SPAN> isStationary <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>isStationary<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">let</SPAN> lv <SPAN class="operator token">=</SPAN> view<SPAN class="punctuation token">.</SPAN>layerViews<SPAN class="punctuation token">.</SPAN><SPAN class="token function">find</SPAN><SPAN class="punctuation token">(</SPAN>lv <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN> lv<SPAN class="punctuation token">.</SPAN>layer <SPAN class="operator token">===</SPAN> featureLayer<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>lv<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN> lv<SPAN class="punctuation token">.</SPAN>controller<SPAN class="punctuation token">.</SPAN>extent <SPAN class="operator token">=</SPAN> view<SPAN class="punctuation token">.</SPAN>extent<SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
For 2D, this becomes:
view<SPAN class="punctuation token">.</SPAN><SPAN class="token function">watch</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">'stationary'</SPAN><SPAN class="punctuation token">,</SPAN> isStationary <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>isStationary<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">let</SPAN> lv <SPAN class="operator token">=</SPAN> view<SPAN class="punctuation token">.</SPAN>layerViews<SPAN class="punctuation token">.</SPAN><SPAN class="token function">find</SPAN><SPAN class="punctuation token">(</SPAN>lv <SPAN class="operator token">=</SPAN><SPAN class="operator token">></SPAN> lv<SPAN class="punctuation token">.</SPAN>layer <SPAN class="operator token">===</SPAN> featureLayer<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>lv<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN> lv<SPAN class="punctuation token">.</SPAN>controller<SPAN class="punctuation token">.</SPAN>activeController<SPAN class="punctuation token">.</SPAN>extent <SPAN class="operator token">=</SPAN> view<SPAN class="punctuation token">.</SPAN>extent<SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
This should cause your layer to re-query using a filter based on the extent of the view.
Thank you Thomas
Indeed, this layer contains about 13000 features. However, what confused me, is an opposite issue on This Post.
Nevertheless, I may have found a solution by using DefinitionExpression on the layer where only a portion of the layer will appear (but correctly).
I only need a way to alter that Expression dynamically..
Any ideas?
One option may be to use a map server instead of a feature server, so an image is served up, rather than features.
I understand this may not be ideal, but I think there are likely performance limits on what can be displayed in 3D at the moment. I don't know if this is documented anywhere, but the scene viewer in portal will not allow you to add layers with more than 2000 features. My understanding is that this is an area of the API that is being worked on.
I raised map service "maximum Number of Records Returned by Server" from 1000 to 5000 and now it is better but still incomplete. it kept this level no matter how much I raise that value:
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.