|
POST
|
This is a fun use case for using reactiveUtils. The AreaMeasurement3D has an analysis object with the geometry being drawn that you can watch for changes. It also has a measurement object on the viewModel. So you can watch the area or the perimeterLength to get those values when using it. This is the displayed text for these, so not raw numbers, but looks like the results of the geometryEngine functions used on the analysis object. watch(
// watch for the analysis geometry to update
() => activeWidget.analysis?.geometry,
() => console.log("analysis", activeWidget.analysis)
);
when(
// wait for the area text to be available
() => activeWidget.viewModel.measurement?.area.state === "available",
() => console.log(activeWidget.viewModel.measurement)
);
when(
// wait for the perimeter text to be available
() => activeWidget.viewModel.measurement?.perimeterLength.state === "available"
() => console.log(activeWidget.viewModel.measurement)
); demo: https://codepen.io/odoe/pen/abjYLzy?editors=1000
... View more
01-24-2023
08:55 AM
|
1
|
1
|
1211
|
|
POST
|
This would be correct. Popups don't support object fields out of the box.
... View more
01-18-2023
10:38 AM
|
0
|
0
|
5097
|
|
POST
|
Do you have a repro? Codepen or github? No way to know otherwise.
... View more
01-12-2023
07:37 AM
|
0
|
0
|
613
|
|
POST
|
The reactiveUtils have an option object you can provide where you can set "once" to true. https://developers.arcgis.com/javascript/latest/api-reference/esri-core-reactiveUtils.html#ReactiveListenerOptions Your above code snippet would look something like this, but the way you have it written, the else is unreachable, maybe the main is watch and not whenFalse? when(
() => !view.stationary,
() => {
console.log("view stationary is: ", view.stationary);
when(
() => view.stationary,
() => console.log("view is now stationary"),
{ once: true }
);
}
); Here is a codepen with both options. https://codepen.io/odoe/pen/zYLwKGb?editors=0010
... View more
01-11-2023
06:59 AM
|
1
|
1
|
1893
|
|
POST
|
In your require and function, the MapView and FeatureLayer order are swapped. When using amd, the order matters.
... View more
01-07-2023
11:13 AM
|
0
|
0
|
1037
|
|
POST
|
The Expand widget has a group property that will handle this for you. https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html#group
... View more
12-21-2022
12:00 PM
|
1
|
0
|
2010
|
|
POST
|
Do you have a repo sample showing the issue, like what you're importing and stuff. We have a 4.24 cra sample here. https://github.com/Esri/jsapi-resources/tree/legacy/esm-samples/jsapi-create-react-app
... View more
12-20-2022
06:38 AM
|
0
|
0
|
1598
|
|
POST
|
The MapImageLayer is used to add MapServices and sublayers. https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html
... View more
12-19-2022
09:43 AM
|
0
|
1
|
2082
|
|
POST
|
You can probably do this a couple of ways, but one would be using the reactive utils. https://developers.arcgis.com/javascript/latest/api-reference/esri-core-reactiveUtils.html You can watch visible prop of the popup, then the selectedFeature, and check the layer the feature comes from. watch(
() => view.popup.visible,
() => {
watch(
() => view.popup.selectedFeature,
(selectedFeature) => console.log("Source layer", selectedFeature.layer),
{ once: true }
);
}
); Here's a sample showing how you can use it. https://codepen.io/odoe/pen/GRGVBgr?editors=1000 You don't even need to watch the Popup visible, and just watch the selectedFeature, but if you paginate, it wouldn't always be the one that opened the popup.
... View more
12-15-2022
09:08 AM
|
1
|
0
|
1242
|
|
POST
|
I changed the values in the sample to load in 30 and less features and it worked ok. Do you have a codepen showing the issue with your data? That samples shows how to batch applyEdits with a large amount of features so you don't block map interactions. With smaller datasets, you can probably get away without needing to batch the operation.
... View more
12-14-2022
08:10 AM
|
1
|
0
|
1184
|
|
POST
|
You can use a FeatureFilter, which will done on the layerView, which will filter data already downloaded on the client. I'm guessing in your use case, you are updating the def expression a bit, it needs to refetch the data based on that, and could cause a perf issue. But if you do it on the LayerView, the data is already available and filtering is fast. https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureFilter.html You can set the where clause and you will get much better performance. The data is still downloaded as normal, but you won't keep refetching it as you update the definition expression. Here's a sample that uses it. https://developers.arcgis.com/javascript/latest/sample-code/featurefilter-attributes/
... View more
12-13-2022
08:51 AM
|
0
|
0
|
1542
|
|
POST
|
You can listen for the "edits" event directly on the source layer https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#event-edits
... View more
12-09-2022
08:33 AM
|
0
|
0
|
1130
|
|
POST
|
FeatureLayer doesn't have a removeAll method, that's a GraphicsLayer. But you can accomplish this by updating the definitionExpression of a FeatureLayer. let defExpression;
let oids = [];
view.when(() => {
const oidField = featureLayer.objectIdField;
view.popup.on("trigger-action", ({ action }) => {
if (action.id === "hide-this") {
const oid = view.popup.selectedFeature.attributes[oidField];
oids.push(oid);
defExpression = `${oidField} NOT IN (${oids.join(",")})`;
featureLayer.definitionExpression = defExpression;
}
});
}); Here's a codepen demo https://codepen.io/odoe/pen/RwJORed?editors=0010
... View more
12-09-2022
08:31 AM
|
0
|
2
|
1570
|
|
POST
|
I'm not sure what changes you may have made, but if you only care about the selected result, you can just listen for the search-complete event, and ignore anything else. https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#event-search-complete Lots of changes between 3x and 4x, events are completely different.
... View more
12-06-2022
05:19 PM
|
0
|
0
|
2645
|
|
POST
|
Do you have a codepen or github repo sample of the issue? Are you trying go get the search result only after you select from suggestions? Or do you want the suggestions? A repro sample would help with your error. Here is the list of events on the Search widget https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#events-summary
... View more
12-06-2022
03:22 PM
|
0
|
2
|
2661
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 2 | 3 weeks ago | |
| 1 | 02-27-2026 06:31 AM | |
| 1 | 01-13-2026 02:15 PM | |
| 1 | 12-31-2025 09:05 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|