|
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
|
3000
|
|
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
|
3945
|
|
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
|
977
|
|
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
|
2819
|
|
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
|
2719
|
|
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
|
2751
|
|
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
|
1376
|
|
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
|
1040
|
|
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
|
1842
|
|
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
|
3057
|
|
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
|
3070
|
|
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
|
3091
|
|
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
|
3124
|
|
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
|
1103
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 4 weeks ago | |
| 2 | a month 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 |
13 hours ago
|