|
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
|
4503
|
|
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
|
4392
|
|
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
|
4517
|
|
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
|
4522
|
|
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
|
4543
|
|
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
|
1049
|
|
POST
|
Hi @JohnRegan this sounds like a configuration issue. Do you have a basic github repo you can share that reproduces the issue?
... View more
06-14-2021
07:52 AM
|
0
|
1
|
2224
|
|
POST
|
This sounds like a life-cycle issue with the mapping component. If you are using ngOnInit() you might need to try switching to using ngAfterViewInit().
... View more
06-10-2021
08:13 AM
|
0
|
0
|
5458
|
|
POST
|
Hi @JethroLeevers since it is a parse error, one thing is to make sure you have this set: https://github.com/Esri/jsapi-resources/blob/master/4.x/amd/dojo/build.profile.js#L491
... View more
06-03-2021
09:04 AM
|
0
|
1
|
2229
|
|
POST
|
Hi @Wasique can you upgrade the app from 4.2 to 4.19? Version 4.2 was retired in December of last year. Also, calcite-maps is retired. For integration with Angular (latest) we recommend using ES module and you can find an example here: https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-angular-cli. Otherwise, if you can't upgrade and need to stick with AMD modules, then we recommend using the esri-loader library, here's an unmaintained example: https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-angular-cli
... View more
06-02-2021
12:00 PM
|
1
|
3
|
5501
|
|
POST
|
Hi @NilankaD the angular-esri-map project was fully retired in November 2020: https://github.com/Esri/angular-esri-map#angular-esri-map Also, note that Google does not support that version of Angular anymore, currently they only support version 9+: https://angular.io/guide/releases#support-policy-and-schedule. I suggest trying to get the ArcGIS JS API 4.19 functionality working in a non-Angular vanillaJS app and then migrate that code back to your Angular app. We typically only offer samples that work with the latest versions of a particular framework, and where possible we now recommend upgrading from using the APIs AMD modules to using ES modules. Here's a sample using Angular 11 (soon to be upgraded to Angular 12): https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-angular-cli
... View more
05-20-2021
08:49 AM
|
0
|
0
|
941
|
|
POST
|
@Jay_Gregory since you mention that the JS API works and axios doesn't, this is most likely an issue with axios adding a header field that is triggering preflight rather than a problem with your ArcGIS Server install. I'm not familiar with axios, but my suggestion is figure out what header field is being added that is causing the problem and remove it. The best way to do that would be to compare the axios request headers with the JS API headers.
... View more
05-07-2021
08:31 AM
|
0
|
0
|
11391
|
|
POST
|
I have a couple questions on the CORS errors. There's nothing in the ArcGIS JS API that should be triggering preflight: Do you know if your secure login system is creating signed URLs? It could be injecting additional header fields into the ArcGIS CDN .json requests. Are you using an interceptor to add a header? I understand the desire to reduce the on-disk size, but depending on what you find, you may have a good case for sticking with local assets.
... View more
05-05-2021
04:19 PM
|
0
|
1
|
4769
|
|
POST
|
Hi @GiovanniVanore1 that error looks like it has something to do with your Angular configuration. I tried your code in our Angular ESM sample and it worked: https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-angular-cli.
... View more
05-05-2021
08:53 AM
|
0
|
0
|
959
|
|
POST
|
Hi @ShaneBuscher1 I haven't used Angular elements, but with a webpack build you have to include all the output bundle files from the Angular build - main,js is just the entry point. Here's a couple blog posts that talk about the ES modules: https://www.esri.com/arcgis-blog/products/js-api-arcgis/announcements/arcgis-api-for-javascript-working-with-frameworks-and-build-tools-just-got-easier-part-2/ and https://www.esri.com/arcgis-blog/products/js-api-arcgis/mapping/javascript-just-works/
... View more
05-05-2021
07:50 AM
|
1
|
0
|
3017
|
| 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
|