|
POST
|
That approach won't work in the future. The underlying architecture for out-of-the-box widgets is going to change, the specifics are still being worked out. We currently only recommend extending Widget and BaseLayers.
... View more
08-13-2021
02:50 PM
|
1
|
0
|
2593
|
|
POST
|
Hi @FrederickPowers going forward all the widget view-based .tsx files will be marked deprecated, we are in the process of doing that for the upcoming 4.21 release (tentatively late September). The missing imports are just one of several reasons why we don't recommend that pattern anymore. Note, you will still be able to build custom widgets, here's the documentation for that: https://developers.arcgis.com/javascript/latest/custom-widget/. The current doc uses the AMD pattern, we are also in the process of updating them for ES modules, and there will be a new sample using that pattern.
... View more
08-13-2021
08:07 AM
|
0
|
1
|
2604
|
|
POST
|
@YingWang I recommend comparing your app to the sample app here: https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-angular-cli. Also make sure you are following the recommendations outlined in the README.
... View more
08-12-2021
09:40 AM
|
0
|
0
|
2332
|
|
POST
|
I recommend opening up a support ticket for Web App Builder. It doesn't sound like an ArcGIS API for JavaScript issue.
... View more
08-12-2021
09:36 AM
|
0
|
0
|
966
|
|
POST
|
Hi @FranklinAlexander I recommend either opening a support ticket or contacting your Esri rep for a technical review. Those offer the most thorough approach for reviewing your architecture to coming up with the best solution.
... View more
08-10-2021
07:40 AM
|
0
|
0
|
1255
|
|
POST
|
Tagging onto Ben's comment, add this code to that sample and it should just work: map.add(layer);
view.whenLayerView(layer).then((layerView) => {
console.log(layerView);
})
.catch((error) => {
console.error(error);
});
... View more
08-09-2021
04:29 PM
|
0
|
0
|
1929
|
|
POST
|
I've seen similar implementations and they aren't recommended because it can lead to unintentional memory leaks in the form of detached DOM nodes and other unpredictable Map/MapView life-cycle issues.
... View more
08-06-2021
01:21 PM
|
1
|
0
|
2177
|
|
POST
|
Hi @rogenjh, can you explain a bit more about what you want to do? In general that seems problematic with all the external dependencies and life-cycle hooks that are inherited with an Angular component. It wouldn't be a clean implementation.
... View more
08-06-2021
10:43 AM
|
0
|
1
|
2182
|
|
POST
|
Postman gives precise control over headers, in comparison you may not be aware of all the headers that are being generated by the JavaScript-based request() method. That's why we recommend comparing headers between requests that are successful and requests that aren't.
... View more
08-03-2021
09:58 AM
|
1
|
1
|
5039
|
|
POST
|
I took a quick look and it looks like geopedia.ca is a self-hosted Portal? If so, it's possible something changed on their server-side CORS configuration. Otherwise, you'll need to do some testing to figure out which header within the app is triggering the error, or maybe you are missing a header.
... View more
08-03-2021
09:08 AM
|
0
|
1
|
5061
|
|
POST
|
@JoeHershman on the surface this sounds like a configuration issue within your environment. Can you open a support ticket? They can review your configuration in detail, there could be quite a few variables in play that are best investigated in a one-on-one support setting.
... View more
07-27-2021
10:27 AM
|
0
|
0
|
1710
|
|
POST
|
@BenRomlein A few things come to mind. You don't need a 3rd party module loader, such as dojo, when using ES modules. Also, JavaScript build tools need to be specially configured to interpret AMD or commonJS. Most implementations follow the ESM pattern: import xyz from "/mymodule/module"; Here's a link to a slightly older unofficial sample app that demonstrates using a custom widget with ES modules + TypeScript. https://github.com/kellyhutchins/arcgis-core-demo-app . And last, we do not currently recommend using the ArcGIS API for JavaScript ES modules with snowpack, for reference see this open issue: https://github.com/Esri/jsapi-resources/issues/299. We do have a bunch of other build-tool samples to choose from, in the event you are able to switch away from snowpack: https://github.com/Esri/jsapi-resources/tree/master/esm-samples.
... View more
07-23-2021
03:54 PM
|
0
|
1
|
2098
|
|
POST
|
I have some code that uses latitude and longitude as input values to calculate a second point based on bearing and distance. Haven't used this in quite a while. I'm not sure how much efficiency you need, you would have handle any additional coordinate conversions: function bearingDistance(lat, lon, radius, bearing){
const lat1Rads = toRad(lat);
const lon1Rads = toRad(lon);
const R_KM = 6371; // radius in KM
const d = radius/R_KM; //angular distance on earth's surface
const bearingRads = toRad(bearing);
const lat2Rads = Math.asin(
Math.sin(lat1Rads) * Math.cos(d) + Math.cos(lat1Rads) * Math.sin(d) * Math.cos(bearingRads)
);
const lon2Rads = lon1Rads + Math.atan2(
Math.sin(bearingRads) * Math.sin(d) * Math.cos(lat1Rads),
Math.cos(d) - Math.sin(lat1Rads) * Math.sin(lat2Rads)
);
return {
latitude: toDeg(lat2Rads),
longitude: toDeg(lon2Rads)
}
}
function toRad(degrees){
return degrees * Math.PI / 180;
}
function toDeg(radians){
return radians * 180 / Math.PI;
}
... View more
07-20-2021
08:41 AM
|
2
|
3
|
5399
|
|
POST
|
Do you need to use local assets? It's not required, try commenting out esriConfig and see if your app works: // esriConfig.assetsPath = "./assets"; // comment out this line Additional reading: https://developers.arcgis.com/javascript/latest/es-modules/#working-with-assets
... View more
07-20-2021
07:36 AM
|
0
|
1
|
3989
|
|
POST
|
Based on what I see in the codepen, this isn't an issue with the ArcGIS API for JavaScript, something in your custom library injection code isn't working right. We recommend using esri-loader to lazy load the ArcGIS JS API: https://github.com/esri/esri-loader for exactly these types of use cases.
... View more
07-19-2021
08:18 AM
|
0
|
0
|
2143
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-10-2026 08:29 AM | |
| 1 | 03-26-2026 03:12 PM | |
| 2 | 02-21-2026 10:23 AM | |
| 2 | 08-01-2025 06:20 AM | |
| 1 | 05-27-2025 12:39 PM |
| Online Status |
Offline
|
| Date Last Visited |
Monday
|