POST
|
Thanks for the feedback. But from the original question: "I know I can remove and re-add the feature from the layer instead of toggle the visibility, but for a few reasons it would be more convenient to just toggle the visibility." Likewise, using the GraphicsLayer instead of FeatureLayers for all graphics just for this ability to toggle individual feature visibility would (at least in our case) be a significant change and consequences (loss of other features that require FeatureLayer).
... View more
02-12-2019
11:20 AM
|
0
|
0
|
368
|
POST
|
Thanks Robert. But just to clarify, I am only trying to get this working with purely client side features (no map service on the server). Prior to 4.10, the 'source' collection used to provide live references to the graphics on the feature layer (additions and removals from this collection modified the layer contents, and direct edits to these objects (like visibility) was applied to the scene). But with 4.10, the source collection is now only handled as inputs to layer creation, and graphics obtained from queries act like snapshot copies, not the live source object. The only API that I can see that you can affect any changes to a Graphic is through applyEdits.
... View more
02-08-2019
07:11 AM
|
0
|
4
|
1509
|
POST
|
Here is a sample using 4.9 (through v 2.5 of esri-loader) that toggles a graphic visibility on a feature layer. map-toggle-vis - StackBlitz Of course, to upgrade this to 4.10, the graphic would be added through applyEdits (instead of adding to the layer's source). And I would expect that modifying the visibility should similarly be done through applyEdits.
... View more
02-07-2019
04:51 PM
|
0
|
6
|
1509
|
POST
|
That line item from the functionality matrix is in the GraphicsLayer section, not for FeatureLayer. Are you sure it applies? We already have 'applyEdits' with 'updateFeatures' support for FeatureLayer graphics, and it can be used to 'modify graphics'. The documentation is not clear about any limits to the types of updates, but I know geometry and attribute updates take, so I would have thought visibility state would have as well. Since this was already available in 4.9 and apparently removed in 4.10 is there a plan to replace this or am I just missing something about how to properly do it in 4.10? Kris
... View more
02-06-2019
07:30 AM
|
0
|
8
|
1509
|
POST
|
Prior to 4.10, Graphic client side features added to a FeatureLayer could be hidden and shown by toggling the Graphic.visible property, but this no longer appears to work in 4.10. I have tried changing 'visible' and calling FeatureLayer.applyEdits in the 'updateFeatures' value, but this does not appear to modify the property value (nor change the visibility). I know I can remove and re-add the feature from the layer instead of toggle the visibility, but for a few reasons it would be more convenient to just toggle the visibility. Is this still possible in 4.10? Kris
... View more
02-05-2019
03:34 PM
|
0
|
12
|
2309
|
POST
|
FWIW: I have temporarily worked around this problem by just removing the onfocusout event handler from the esri-search__input element (after the first focus event to make sure it is after their event handlers are attached). Obviously this removes any side effects this handler was performing, but so far iremoving this has not had any significant problems (definitely not as bad as the original error). Kris // With version 4.7 the search widget's onfocusout handler will throw an error // whenever there is a jQuery onfocusout handler along the event path because of // jQuery's event bubbling workaround for focusin/out events. So for now, just // remove the Search widget's onfocusout handler to silence the error. const handler = this.search.on('search-focus', event => { handler.remove(); const input = searchDiv.querySelector('.esri-search__input'); if (input) { input.onfocusout = null; } });
... View more
10-29-2018
07:34 AM
|
2
|
0
|
1134
|
POST
|
Chris, Yes. I referenced that discussion in my post with "This seems related to this discussion...". There definitely does appear to still be issue (or regession) with the map destroying. I was hoping to find some way to force it. Kris
... View more
06-28-2018
01:23 PM
|
0
|
0
|
418
|
POST
|
When a map is displayed, it regularly uses CPU every second or two (timers triggering requestAnimationFrames). In the Chrome task manager, a tab with a map view constantly bounces around 5% (from zero to ten). Unfortunately, even if the window is not active. But I would at least expect to be able to stop this CPU usage by destroying the MapView, and/or the Map. But this does not seem to be the case. Detaching the MapView from it's container and releasing the view and the map does not stop the CPU usage. But perhaps I'm not stopping the map view properly (but I didn't notice any official documentation or sample about this). I can reproduce this with a sample in the sandbox (e.g. intro-mapview) by adding the following attempt to cleanup code. setTimeout(() => {
view.container = null
view.map = null
view = null
map = null
}, 10000) This seems related to this discussion and the suggestion is that removing the container reference and releasing the references is all it should take. Removing the container reference from the view does do the majority of the detach of the canvas and surface from the dom, but there seems to be a reference keeping the timers firing and reacting. How can we fully release the view? Kris
... View more
06-25-2018
12:09 PM
|
0
|
2
|
525
|
POST
|
Thanks a lot. I spent a lot of time trying to preserve the order, and never tried reversing it. Kris
... View more
06-14-2018
06:55 AM
|
0
|
0
|
602
|
POST
|
Is it possible to control the sublayer visibility of a map service layer that does not support dynamic sublayers in 4.7? In 3.24 this was possible with the LAYER_OPTION_SHOW in the ImageParameters passed to ArcGISDynamicMapServiceLayer. See this example. In 4.7 the matrix indicates MapImageLayer is the eqivalent. But specifying more than one sublayer in the 'sublayers' property causes it to require dynamic layer support from the layer source. See this example. This sample emits an error in the console indicating the service 'doesn't support dynamic layers, which is required to be able to change the sublayer's order, rendering, labeling or source'. But I am not attempting to change the order, rendering, labeling, or source. Just layer visibility. Is it possible to show multiple sublayers without requiring dynamic layers? Kris
... View more
06-13-2018
02:57 PM
|
0
|
2
|
943
|
POST
|
With the 4.7 release, we are seeing errors coming from the onfocusout handler of the Search widget. It was tracked down to be caused by an interaction with jQuery. If a jQuery 'focusout' event listener is anywhere along the parent path of the search widget input, the widget's handler will error trying to walk up the parentNode path. This is because the simulated bubble event fired by jQuery (apparently to work around some browser version focus event issues) fires with the target element at the top of the path (not the input). The error is: dojo.js:2072 Uncaught TypeError: Cannot read property 'parentNode' of null
at HTMLInputElement.d [as onfocusout] (dojo.js:2072)
at Object.trigger (jquery-3.3.1.js:8255)
at Object.simulate (jquery-3.3.1.js:8318)
at HTMLDocument.handler (jquery-3.3.1.js:8352)
This can be reproduced by added jQuery and a focusout listener to any element outside the search input. For example to any sample with a Search widget add: <script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script>
$(document).ready(() => $('body').on('focusout', () => {}));
</script> Then click in the Search input control, and then click anywhere outside the Search input and check the console. If you change the arcgisjs API version from 4.7 to 4.6 the error does not occur. The following jsfiddle example demonstrates this. http://jsfiddle.net/xrwfhc1n Kris
... View more
06-05-2018
11:39 AM
|
4
|
5
|
2321
|
Title | Kudos | Posted |
---|---|---|
2 | 10-29-2018 07:34 AM | |
4 | 06-05-2018 11:39 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|