|
POST
|
Yeah, looks like you're using the LayerView. Here is a sample that does something similar. https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=featurelayerview-query-distance view.whenLayerView(layer).then(function (layerView) {
watchUtils.whenFalseOnce(layerView, "updating", function (val) {
// Query layer view statistics as the user clicks
// or drags the pointer across the view.
view.on(["click", "drag"], function (event) {
// disables navigation by pointer drag
event.stopPropagation();
queryStatsOnDrag(layerView, event)
.then(updateCharts)
.catch(function (error) {
if (error.name !== "AbortError") {
console.error(error);
}
});
});
});
}); Notice how it uses the whenFalseOnce watchUtils helper to make sure the LayerView is done updating before it queries it. That should help!
... View more
03-31-2022
09:05 AM
|
0
|
0
|
3505
|
|
POST
|
Sorry, I just realized, I think you're using the layerview for clientside queries. You need to wait for the layerview to finish updating. Check out this blog post https://odoe.net/blog/when-are-layers-done Since you're using a CSVLayer, you can query the layer directly as the data is already in memory, so there is no request to the service in this case.
... View more
03-31-2022
05:44 AM
|
0
|
0
|
3518
|
|
POST
|
Sorry, not sure. If you can provide a simple repo, could take a look. Not enough info to really tell.
... View more
03-30-2022
12:14 PM
|
0
|
0
|
3539
|
|
POST
|
Is the layer visible on the map? Sounds like the layer isn't loaded, but tough to tell by the snippet. You can do a check or preload when the app starts using layer.load() or check if it's loaded before that query https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#loaded
... View more
03-30-2022
09:42 AM
|
0
|
0
|
3572
|
|
POST
|
Do you have a snippet or something to show how you are using hitTest and doing this filter? If there are no results, accessing it via array[0] will be undefined on an empty array. You can use response.results.find() and check for null instead. But you should be doing some kind of null checking in this scenario.
... View more
03-30-2022
07:33 AM
|
0
|
0
|
1243
|
|
POST
|
Not specific to local assets, but you need to update the browserlist for your production build in the package.json https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-create-react-app#misc I'm surprised it worked in 4.22, but some of the down-compiling and babel helpers with the default browserlist will break some stuff. There's no errors, which is odd, but updating for evergreen browsers fixes this issue with CRA.
... View more
03-27-2022
11:36 AM
|
1
|
0
|
941
|
|
POST
|
Did you add your own API Key to your code? Is there a particular error that shows in the console?
... View more
03-27-2022
11:17 AM
|
0
|
0
|
910
|
|
POST
|
Do you have a sample or codepen showing this issue to track down? The samples with popup seem to be working.
... View more
03-24-2022
08:22 AM
|
0
|
0
|
2429
|
|
POST
|
The view.goTo() method can also take an array of graphics or geometries so you can pass multiple values at once. https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo https://codepen.io/odoe/pen/OJzRrGM?editors=0010
... View more
03-22-2022
08:19 AM
|
0
|
0
|
1684
|
|
POST
|
Try the solution mentioned here, because you are dealing with tiles, you need to define the lods as well. https://community.esri.com/t5/arcgis-api-for-javascript-questions/allow-over-zoom-in-map-view/m-p/1062798#M73318
... View more
03-20-2022
09:36 AM
|
1
|
1
|
2338
|
|
POST
|
You don't need to listen to any events, you can watch for the popup.selectedFeature property to change https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedFeature view.popup.watch("selectedFeature", (feature) => {
// do something
})
... View more
03-18-2022
08:37 AM
|
0
|
0
|
2187
|
|
POST
|
Here is a sample of how to do this on a hold event. https://codepen.io/odoe/pen/bLEroK?editors=0010 view.on("hold", ({ mapPoint }) => {
view.hitTest(view.toScreen(mapPoint)).then((hitResult) => {
if (!hitResult.results[0].graphic) return;
console.log("hold event, now drag mouse to move graphic");
pointGraphic.symbol = selectSymbol;
const pausePan = view.on("drag", stop);
const move = view.on("pointer-move", updateGraphic);
const up = view.on("pointer-up", cleanUp);
handlers.push(pausePan);
handlers.push(move);
handlers.push(up);
});
});
... View more
03-18-2022
07:37 AM
|
1
|
1
|
3388
|
|
POST
|
You can use the LayerList widget https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html
... View more
03-17-2022
07:59 AM
|
1
|
0
|
2760
|
|
POST
|
This is expected behavior. The API takes advantage of dynamic import loading, especially when working with Portal items such as WebMap contents. The number of bundled files can vary from 200-300 depending on your tooling. You can see a chart here of build metrics for various ESM samples we have. https://github.com/Esri/jsapi-resources/blob/master/esm-samples/.metrics/4.22.2.csv
... View more
03-15-2022
08:43 AM
|
1
|
1
|
3021
|
|
POST
|
Glad you got it working! In that example, the symbol object is added to the renderer of the layer. Under the hood, the renderer sees the object of the symbol passed to the setter, it will reactively create an instance of the symbol class based on the type property to the correct symbol instance. But the object has to be passed to something for that to happen.
... View more
03-02-2022
08:07 AM
|
0
|
1
|
2585
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 3 weeks ago | |
| 2 | 2 weeks ago | |
| 2 | 05-19-2026 02:12 PM | |
| 1 | 04-24-2026 11:01 AM | |
| 2 | 04-21-2026 07:06 AM |
| Online Status |
Online
|
| Date Last Visited |
10 hours ago
|