|
POST
|
You should only need to use esriId.destroyCredentials() Don't try to manually remove cookies or session storage, that could be causing an issue when the IdentityManager tries to clean up. This app is a little older, but does this https://github.com/Esri/nearby-javascript Do you have a sample app showing this behavior? ArcGIS JSAPI version? Browser version? OS?
... View more
04-25-2022
07:34 AM
|
0
|
1
|
1804
|
|
POST
|
Like @UndralBatsukh said, hitTest for 4.24 will act on the actual symbol marker, with a slight tolerance. We don't have a list of updated modules these updates are in, as it could span multiple modules. As stated, if you have a repro showing what the expected behavior should be versus what it is that could help narrow down the issue during this release cycle.
... View more
04-22-2022
08:29 AM
|
0
|
0
|
2681
|
|
POST
|
The SketchViewModel state does change. It looks like while it's active, the view "click" event can't be captured. This is probably due to the introduction of snapping over the previous releases. If you update your code like this, it works. https://jsitor.com/oBfmc8eSf if (event.state === "complete") {
if(event.graphic.geometry.type === "point") {
params.returnGeometry = true;
params.geometry = event.graphic.geometry;
params.mapExtent = view.extent;
identifyTask.execute(params)
.then(function (response) {
var results = response.results;
let feature = results.map(function (result) {
var feature = result.feature;
var layerName = result.layerName;
feature.attributes.layerName = layerName;
return feature;
});
if (feature && feature[0]) {
sketchGeometry = feature[0].geometry;
runQuery();
}
})["catch"](promiseRejected);
... If you need to do something when the SketchViewModel state is active, you can do something like this. sketchViewModel.watch("state", (state) => {
if ("active" === state) {
// stuff
}
}); You just need to refactor a little bit.
... View more
04-21-2022
06:49 PM
|
1
|
1
|
2177
|
|
POST
|
It looks like the MapView click event is superseded by Sketch events, so when you try to set the point for your identity geometry it doesn't get set, and you're ternary check for it doesn't pass, so you never actually call the Identify. You could grab the geometry of the graphic from the sketch params.geometry = event.graphic.geometry Then you can rework how that click handler works
... View more
04-21-2022
03:41 PM
|
0
|
3
|
2210
|
|
POST
|
You have two options Layer.fromArcGISServerUrl https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fromArcGISServerUrl Or using Layer.fromPortalItem https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#fromPortalItem The root on the service will give you the itemId I even did a video on this
... View more
04-21-2022
01:14 PM
|
0
|
0
|
1255
|
|
POST
|
This would require a full rewrite of your application. Here is a guide to help in the process. https://developers.arcgis.com/javascript/latest/migrating/ It should be noted, that depending how you built your original application and it's complexity, if your application is using the 3x CDN, you can probably continue to use the 4x CDN. However, if you were using the Dojo build tools to build your application, that process is deprecated for 4x. We recommend you use some modern build tools as shown in this sample repo. https://github.com/Esri/jsapi-resources/tree/master/esm-samples
... View more
04-19-2022
08:33 PM
|
1
|
0
|
3171
|
|
POST
|
Here is a sample adding a button to the popup content. https://codepen.io/odoe/pen/abEPGxR?editors=1000 You can either reuse the button you create, or be sure to remove the event listener if you don't This is using the CustomContent of the PopupTemplate https://developers.arcgis.com/javascript/latest/api-reference/esri-popup-content-CustomContent.html
... View more
04-18-2022
11:09 AM
|
0
|
0
|
4089
|
|
POST
|
This was kind of fun to do. Geolocation coordinates return an accuracy in meters. https://developer.mozilla.org/en-US/docs/Web/API/GeolocationCoordinates/accuracy You can use this value with the view resolution to figure out the size of the marker you want to display. https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#resolution I think I did this math right, I'm sure someone will correct if I didn't. track.on("track", ({ position }) => {
accuracy = position.coords.accuracy;
currentCoords = position.coords;
// divide accuracty (meters) by maps resolution (pixels)
const size = `${accuracy / view.resolution}px`;
symbol.size = size;
layer.removeAll();
layer.add({
geometry: {
type: "point",
latitude: currentCoords.latitude,
longitude: currentCoords.longitude
},
symbol
});
}); https://codepen.io/odoe/pen/zYpmEMB?editors=1000 The Geolocation API also returns a heading you can use to rotate you symbol, which would be simplest, or you could calculate how to draw a short line in that heading. I'll leave that up to you. https://developer.mozilla.org/en-US/docs/Web/API/GeolocationCoordinates/heading
... View more
04-14-2022
08:57 AM
|
1
|
0
|
1131
|
|
POST
|
I should note, this can happen if you are using two different versions of the API for some reason, or mixing npm with the CDN. This can also happen in some monorepo use cases as well.
... View more
04-11-2022
10:39 AM
|
1
|
0
|
2941
|
|
POST
|
How exactly are you measuring? Is this based on a screenshot? I tried this and I can't tell 100%, but it looks like it's fired after display. I used alert here because alert is blocking, and I can see the points when the alert is up https://codepen.io/odoe/pen/JjMvOdV?editors=1000
... View more
04-08-2022
08:21 AM
|
0
|
1
|
2928
|
|
POST
|
The graphics layer doesn't change its load status based on graphics added. Loaded just means the layer was created, since it doesn't need to load anything. Watching for the view updating property should let you know when new features are drawn on the map.
... View more
04-07-2022
01:40 PM
|
0
|
3
|
2960
|
|
POST
|
There's a couple of ways you can do this. One is to iterate over the array and add a new calcite-combobox-item to the combobox. const countyselection = document.getElementById('beg_county');
for (let item of countyList) {
const comboItem = document.createElement('calcite-combobox-item');
comboItem.setAttribute('value', item);
comboItem.setAttribute('text-label', item);
countyselection.appendChild(comboItem);
} This is fine, but could be improved because it's updating the DOM on each iteration. You could use a Fragment to limit it to a single DOM update. const countyselection = document.getElementById('beg_county');
const fragment = document.createDocumentFragment();
for (let item of countyList) {
const comboItem = document.createElement('calcite-combobox-item');
comboItem.setAttribute('value', item);
comboItem.setAttribute('text-label', item);
fragment.appendChild(comboItem);
}
countyselection.appendChild(fragment); Another option is to use template literals, and innerHTML, but I think document methods are a little more straightforward. I haven't tested this, but the comps should already be registered and display correctly. And for reference, I was just looking at the doc for how the HTML is structured https://developers.arcgis.com/calcite-design-system/components/combobox/
... View more
04-05-2022
10:43 AM
|
0
|
0
|
1478
|
|
POST
|
If you are going to use pure ESM via the ESM CDN, you need to add .js to filename. https://codepen.io/odoe/pen/xxpPppQ?editors=0010 Normally when using ESM, you would use build tools that don't need the file extension.
... View more
04-02-2022
10:24 AM
|
0
|
0
|
1131
|
|
POST
|
You can use view.ui.remove("zoom") https://developers.arcgis.com/javascript/latest/api-reference/esri-views-ui-DefaultUI.html#remove
... View more
03-31-2022
01:03 PM
|
1
|
0
|
1993
|
| 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 |
Offline
|
| Date Last Visited |
14 hours ago
|