|
POST
|
Usually this is related to babel and the browserlist settings noted here https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-create-react-app#misc But without a test repo, no way to tell.
... View more
05-19-2022
09:16 PM
|
0
|
1
|
1450
|
|
POST
|
You can use the Home widget or save the initial extent and apply it on a button click if you want to DIY. https://developers.arcgis.com/javascript/latest/sample-code/widgets-home/
... View more
05-18-2022
01:09 PM
|
1
|
0
|
1283
|
|
POST
|
// change this
if (!view.graphics.length) {
// check if layer where you clicked
// with hitTest
view.hitTest(evt).then(({results}) => {
if (results.length) {
view.graphics.removeAll();
view.graphics.add(graphic);
}
});
}
// to this
// check if layer where you clicked
// with hitTest
view.hitTest(evt).then(({results}) => {
if (results.length) {
view.graphics.removeAll();
view.graphics.add(graphic);
}
});
... View more
05-18-2022
08:10 AM
|
1
|
3
|
2286
|
|
POST
|
That error you're getting means the layer doesn't support editing, but could you try using your layer in this simple sample and see if you can edit the features https://codepen.io/odoe/pen/dydvvaB?editors=1000 Try to edit, add, delete, and see if it works there.
... View more
05-17-2022
09:01 AM
|
0
|
1
|
5591
|
|
POST
|
Remove the check on graphics length and that will do it.
... View more
05-16-2022
08:12 AM
|
0
|
5
|
2292
|
|
POST
|
Sorry, I misunderstood what you were looking for. You can use a hitTest to check if your layer where you clicked. I would normally do more checks for the layer id or title, but in this case just checking for results is ok. if (!view.graphics.length) {
// check if layer where you clicked
// with hitTest
view.hitTest(evt).then(({results}) => {
if (results.length) {
view.graphics.removeAll();
view.graphics.add(graphic);
}
});
} I updated the codepen in my previous post.
... View more
05-13-2022
10:32 AM
|
0
|
7
|
2309
|
|
POST
|
Not in 4x, no. The workflow for that is the view click, like you showed with view hitTest.
... View more
05-12-2022
06:03 PM
|
0
|
0
|
881
|
|
POST
|
Here you go, I made a fork of your codepen showing where to add it. https://codepen.io/odoe/pen/RwQGxbP?editors=0010
... View more
05-12-2022
09:14 AM
|
0
|
9
|
2320
|
|
POST
|
You can check the length of the graphics layer collection. if (!view.graphics.length) {
view.graphics.removeAll();
view.graphics.add(graphic);
}
... View more
05-12-2022
07:45 AM
|
0
|
11
|
2331
|
|
POST
|
You can use StatisticDefinition with the query.outStatistics to get the min/max values. https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-StatisticDefinition.html You can search for "statistics" in the Sample Code page and find a number of samples including this one. https://developers.arcgis.com/javascript/latest/sample-code/popup-customcontent/
... View more
05-11-2022
11:17 AM
|
1
|
0
|
1707
|
|
POST
|
Ah, you can't fix this via your server then. The origin server has deliberately disabled CORS or only has certain allows. You can try to write a proxy server for this. The crossorigin.me dev site publishes their source code and you can try to use that as a base for your own. https://github.com/corihudson/crossorigin.me
... View more
05-11-2022
07:11 AM
|
0
|
0
|
8720
|
|
POST
|
You can try a custom theme using the source SASS files. This utility might be able to help with that https://github.com/Esri/arcgis-js-cli#author-a-custom-theme
... View more
05-10-2022
11:53 AM
|
0
|
2
|
1674
|
|
POST
|
Ok, I think you can simplify this rather try to grab the style like that. All Basemaps are published in LivingAtlas. https://livingatlas.arcgis.com/en/browse All Basemaps are published as WebMaps, but we have a Basemap class in the API you can use for it. https://developers.arcgis.com/javascript/latest/api-reference/esri-Basemap.html You can create the Basemap from the LivingAtlas item you found, then add your hillshade into the baseLayers. The add() method takes an index as the second argument. https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#add Then you can get a map like this. https://codepen.io/pen?editors=0010 That might be easier so you don't need to manually load the style file, and create the VT layers. async function load() {
const basemap = new Basemap({
portalItem: {
id: "358ec1e175ea41c3bf5c68f0da11ae2b"
}
});
const hillshade = new TileLayer({
portalItem: {
id: "1b243539f4514b6ba35e7d995890db1d"
}
});
await basemap.load();
basemap.baseLayers.forEach((layer) => {
layer.effect = "opacity(80%) brightness(90%)";
});
basemap.baseLayers.add(hillshade, 0);
const map = new ArcGISMap({
basemap
});
const view = new MapView({
container: "viewDiv",
map,
center: [-118, 34],
zoom: 4
});
}
... View more
05-10-2022
11:40 AM
|
2
|
1
|
2873
|
|
POST
|
edit - Is this on the server you are trying to get the WMS from?
... View more
05-10-2022
07:25 AM
|
0
|
2
|
8766
|
|
POST
|
This is updated in our "next" version of the API, so it will be 4.24 @UndralBatsukh put together a sample here https://codepen.io/U_B_U/pen/abEMrzq?editors=1000
... View more
05-10-2022
07:22 AM
|
0
|
0
|
958
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 2 | 05-19-2026 02:12 PM | |
| 1 | 04-24-2026 11:01 AM | |
| 2 | 04-21-2026 07:06 AM | |
| 1 | 02-27-2026 06:31 AM |
| Online Status |
Online
|
| Date Last Visited |
an hour ago
|