|
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
|
4004
|
|
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
|
2167
|
|
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
|
3472
|
|
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
|
2353
|
|
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
|
6979
|
|
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
|
2363
|
|
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
|
5274
|
|
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
|
3010
|
|
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
|
3010
|
|
POST
|
Hmmm, the multiple calls are most likely related to the toggle function, it shouldn't really be there. A better approach would be to remove toggleI() and any other state management/business logic from the widget and only use plain old data binding. That way the View is only used as a View. The component should handle all state management and business logic. So in the widget you'd have: @property()
message = "Start"; //default value
render() {
return (
<div>{this.message}</div>
);
}
... View more
07-01-2021
08:52 AM
|
0
|
1
|
5340
|
|
POST
|
We don't have any examples of custom widgets in Angular, but you can build them. How you build them depends on whether you are using JavaScript or TypeScript. And, it will be easier if you are using Angular 11+ because then you can use the APIs ES modules (npm @arcgis/core) Here's another conversation about TypeScript widgets: https://community.esri.com/t5/arcgis-api-for-javascript/handling-and-rendering-in-a-widget/m-p/1073956#M73686. and scroll down towards the bottom. A couple of items to note: * Build your widget in .tsx (if using TypeScript + Angular) * In tsconfig.json set "jsx": "react", "jsxFactory": "tsx"
... View more
06-30-2021
01:40 PM
|
1
|
1
|
4978
|
|
POST
|
Just a quick follow-up, I tested the above code and it worked. Here's some more psuedo-code: //Add widget to component
this.simpleWidget = new SimpleWidget2({
container: document.createElement("div")
});
// Be sure to add widget to the view
this.view.ui.add(this.simpleWidget, "bottom-right");
// After map initialized and widget has been added to the component
let count = 0;
const c = this.simpleWidget.container.addEventListener("click", () => {
this.simpleWidget.msg = "test" + this.count++;
})
... View more
06-30-2021
12:58 PM
|
0
|
1
|
5354
|
|
POST
|
Yep, getting closer. There is still state management in the render() method, you'll need to move the button click event listener code to the component. Some other suggestions, note this is psuedo-code because I haven't tested it: import Widget from "@arcgis/core/widgets/Widget";
import { subclass, property } from "@arcgis/core/core/accessorSupport/decorators";
import { tsx } from "@arcgis/core/widgets/support/widget";
@subclass("esri.widgets.SimpleWidget2")
class SimpleWidget2 extends Widget {
@property()
msg = "test"; //to test simply assign this property a different string.
private _toggle(){
return this.msg;
}
render() {
const testMessage = this._toggle();
return (
<div>
{testMessage}
</div>
);
}
}
export default SimpleWidget2;
... View more
06-30-2021
09:21 AM
|
1
|
0
|
5359
|
|
POST
|
Hi @litch it's best to avoid setting up any state management in the render() method. One recommendation is to move any state management code (e.g. onMapChange) into the postInitialize() stage of the widget's life cycle. You can implement postInitialize() just like you can with render(). Here's some additional Widget-related documentation you can read through, if you haven't done so already: https://developers.arcgis.com/javascript/latest/custom-widget/#implement-properties-and-methods.
... View more
06-28-2021
05:17 PM
|
0
|
1
|
5380
|
|
POST
|
One suggestion is to get your basic app running in Vue without capacitor: https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-vue-cli. That will help identify any non-Capacitor related performance issues. Also be sure to check out the system requirements documentation: https://developers.arcgis.com/javascript/latest/system-requirements/#hardware-requirements.
... View more
06-14-2021
08:19 AM
|
0
|
0
|
1295
|
| 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
|