|
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
|
4390
|
|
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
|
1430
|
|
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
|
1749
|
|
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
|
4396
|
|
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
|
3367
|
|
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
|
1821
|
|
POST
|
How are you copying your assets? Maybe delete the assets in your working directory and recopy just to make sure you have the most current ones.
... View more
07-19-2021
07:30 AM
|
1
|
2
|
3380
|
|
POST
|
Hi @bobypan8089 do you have a sample app or codepen that reproduces the issue?
... View more
07-16-2021
09:35 AM
|
0
|
1
|
1843
|
|
POST
|
Hi @RyanSutcliffe unlike the AMD CDN, the ESM CDN isn't recommended for production use because it is "un-built" and not optimized. When you use it you'll notice there are dozens or even hundreds of CDN requests. Currently the recommended way to optimize ES modules for the best performance, whether they are ArcGIS JS API modules or not, is to use local build tools. That way your application gets a customized build that takes advantage of tree shaking, chunking, bundling, minimizing and obfuscating. One item to note is that by default the @arcgis/core static assets are hosted on CDN to reduce the on-disk build size. You can override that by setting config.assetsPath and consume the assets locally if needed.
... View more
07-13-2021
02:06 PM
|
1
|
0
|
2986
|
|
POST
|
Interesting, I think I understand your issue that there is a chain of synchronous DOM events after the parent widget has been created, and the question is whether or not the parent is aware when the final afterCreate event takes place. I'm just wondering, have you look at setting afterUpdate on the parent div? I can see there being potential problems with that but just in case here's the doc: https://maquettejs.org/typedoc/interfaces/vnodeproperties.html#afterupdate. Also on that page you can browse through all the event methods. Reference: https://developers.arcgis.com/javascript/latest/custom-widget/#widget-rendering
... View more
07-09-2021
09:12 AM
|
1
|
0
|
1981
|
|
POST
|
Hi @craragon77 Try setting jest to ignore the @arcgis/core modules, for example: https://github.com/andygup/angular-jsapi-jest/blob/main/jest.config.js#L4
... View more
07-09-2021
07:55 AM
|
2
|
1
|
6264
|
|
POST
|
Hi @MartijnHoogstraten the short answer is no. What are you trying to do? Here's the widget life cycle events: https://developers.arcgis.com/javascript/latest/custom-widget/#widget-life-cycle.
... View more
07-09-2021
07:46 AM
|
1
|
0
|
1991
|
|
POST
|
You'll need to use Angular data binding to pass data between the component class and the widget class, here's some additional info: https://angular.io/guide/two-way-binding and https://angular.io/guide/binding-syntax
... View more
07-09-2021
07:42 AM
|
0
|
0
|
4433
|
|
POST
|
Oh, forgot to add that you might also take a look at this library: https://github.com/Esri/arcgis-rest-js/tree/master/packages/arcgis-rest-feature-layer
... View more
07-08-2021
05:18 PM
|
1
|
1
|
2507
|
|
POST
|
Hi @Neberu note, this is not an issue with the ArcGIS API for JavaScript it's an issue with the manually created REST API requests. What's happening is the POST code is adding a header field that is triggering pre-flight. There's nothing in the JS API that would trigger pre-flight. One recommendation is to build a simple, vanilla JS app against a secured feature layer using the ArcGIS API for JavaScripts applyEdits() method and then compare the headers with your manually generated REST requests. Here's some psuedo-code to help you get started: //create feature layer
const fl = new FeatureLayer({url: ". . .", apiKey:"your_key"});
// Add feature layer to map
map.add(fl);
const editFeature = new Graphic({
geometry: someValidGeometry,
attributes: {
attribute1: "TBD",
attribute2: "TBD"
}
});
const edits = {
updateFeatures: [editFeature]
};
fl.applyEdits(edits)
.then((editResults) => {
console.log("edit results: ", editResults);
})
.catch((error) => {
console.error("Editing error: ", error);
}) Additional info: * apiKey * https://community.esri.com/t5/arcgis-api-for-javascript/how-to-make-http-requests-work-with-axios-arcgisserver-amp-cors/m-p/1055674
... View more
07-08-2021
05:14 PM
|
0
|
0
|
2507
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 08-01-2025 06:20 AM | |
| 1 | 05-27-2025 12:39 PM | |
| 1 | 04-23-2025 06:56 AM | |
| 1 | 04-23-2025 07:09 AM | |
| 1 | 04-08-2025 09:05 AM |
| Online Status |
Offline
|
| Date Last Visited |
12-05-2025
07:24 AM
|