|
POST
|
After changing the timeout to 0, I'm no longer getting the cancelled request, but I'm getting lots of 500 / 504 errors. The 200 at the top had a 500 response inside it: I ran the same test several more times, and was able to get a response, and the only different I can see is that the successful one took 1.9 minutes, and all the failures took 1.0 minutes or 2.0+ minutes. This is the capture of the other responses, the top 200 was actually successful, the second was had a 500 response code it: Thanks
... View more
10-27-2021
08:04 AM
|
0
|
0
|
1940
|
|
POST
|
Good Day I'm trying to print a large view of ~4600 segment, after pressing the print button, which executes the following function: printMap() { try { const printTask = new PrintTask(); printTask.url = 'https://utility.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task'; const template = new PrintTemplate({ format: 'jpg', layout: 'a4-landscape', }); const params = new PrintParameters({ view: this._view, template: template }); this.printProgress = true; printTask.execute(params).then((result) => { this.printProgress = false; window.open(result.url); }, (err) => { this.printProgress = false; this.alert.errorDialog('Print Error', 'Please try again or contact support!'); }); } catch (error) { console.log(error); } } I get 'cancelled' in the network tab of the Dev Console: I'm assuming this is a timeout issue, due to the amount of data being sent, is there a way to add a timeout override to the execute call? Is there an upper limit to the amount of data you can push from a client side ArcGIS JS Map to the Print Service? Thanks
... View more
10-27-2021
07:17 AM
|
0
|
4
|
1951
|
|
POST
|
I know this an old post, but I got it! 1. Look at https://github.com/epaitz/jsapi-angular-ngrx-ds2021 2. I took that code and made: https://github.com/docmur/angular-core-esri (Look at master-a12) 3. When you allocate a map, store it's "settings" in a Store (map, view, feature layers, etc…) 4. When you recall the map, don't allocate a new feature layer, just remove and add the features to the existing layer(s) if you need to change the layer or features. 5. That code is using a single map and view, then changing the features in the layer, but the same idea works for multiple maps. 6. Don't try and destroy the map or view, or feature layer, you won't reclaim memory doing that. For some reason the featureLayer.destroy(), and map.removeAll() / map.layers.removeAll(), won't free the memory being held by the feature layer, which is why it continues to climb. I've already rolled this code into our production application, and it works wonderfully! We allocate 2 maps in total, and then just hold them in the Store, being recalled when we need them, then I use the feature layer to apply edits to do the main work. The multiple map variation has been able to run for 20+ hours with no issue and using ~35MB of memory from the Dev Console. This is the solution you're probably looking for 🙂 Cheers
... View more
10-22-2021
12:59 PM
|
1
|
1
|
4002
|
|
POST
|
Thanks for the suggestion, I actually solved it by using .filter instead of .effect featureLayerView.filter = new FeatureFilter({ where: featureQuery }) If anyone else runs into this problem, trying using a Feature Filter instead...
... View more
10-06-2021
10:56 AM
|
1
|
0
|
1642
|
|
POST
|
Good Day I have a map with many layers on it, when I turned off a layer by setting opacity to 0 in the feature query: if (featureQuery.length > 0) { this._view.whenLayerView(this._layers[prop][innerProp]).then((featureLayerView) => { featureLayerView.effect = { filter: { where: featureQuery }, excludedEffect: 'opacity(0%)' }; }); } else { this._layers[prop][innerProp].visible = false; } the layer disappears, but I'm still able to select the feature, the circle is not visible on the map I'm using ArcGIS Core 4.20.2, I'm doing a hittest to pick up the feature clicked, is there away to filter out features which aren't visible, or have an opacity of 0? This is the main part of my query function: try { if (this._layers[prop][geometryProp]) { if (this._layers[prop][geometryProp].visible) { if (typeof this._layers[prop][geometryProp].createQuery === 'function') { const query = this._layers[prop][geometryProp].createQuery(); query.where = 'ObjectID = ' + objectId; query.outFields = ['*']; query.returnGeometry = geometry; this._layers[prop][geometryProp].queryFeatures(query).then((queryRes) => { queryRes.features.map((feature) => { if (geometry) { if (feature.geometry) { r(feature.geometry); } } else { if (feature) { r(feature); } } }); }); } } } } catch (error) { console.log(error); } Thanks
... View more
10-06-2021
09:36 AM
|
0
|
2
|
1670
|
|
POST
|
Thanks for the input, it's worth the time investment to do that.
... View more
09-27-2021
11:39 AM
|
0
|
0
|
1484
|
|
POST
|
Good Day Is it possible to move the basemap labels above mapped feature layers? Ideally, if possible, I'd like to move the Regina St above the green polyline. Thanks
... View more
08-31-2021
10:50 AM
|
0
|
2
|
1575
|
|
POST
|
Good Day The problem is on the client's server, but they don't know how to resolve it. We've bypassed the issue for now, by using a token and passing it to the request API. Thanks for your help 🙂
... View more
08-04-2021
09:59 AM
|
0
|
0
|
4971
|
|
POST
|
Good Day We can have them look, it's self-hosted, and they've been troubleshooting a problem with ESRI, so they may have changed the settings to something invalid. It's odd the request works from Post Man / Insomnia, but not from Angular. My co-worker also ran the token query from C# and was able to retrieve the token. We'll reach out to the client in question. Thanks
... View more
08-03-2021
09:32 AM
|
0
|
0
|
5003
|
|
POST
|
Good Day A function which retrieves the token for a client, and uses it to authenticate to the hosted feature layer, started failing out of the blue, throwing CORS errors from Angular. The specific error we're getting is: Access to fetch at 'https://<client>.geopedia.ca/portal/sharing/rest/generateToken' from origin 'http://localhost:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. When we try to access the resource using Insomnia or Postman, we can get a token, and the code we used to fetch the token was working fine a couple of weeks ago, this is the function: const tokenParams = {
username: 'blah',
password: 'blah',
ip: '',
referer: '',
client: 'requestip',
expiration: '60',
f: 'pjson'
}
// -ignore
request(this._tokenURL, {params: tokenParams}).then((esriResponse) => {
request(this.testURL, {params: {token: esriResponse.token}}).then((response) => {
this._featureLayer = _.cloneDeep(response);
r(this._featureLayer.fields);
}).catch((error) => {
console.log('Error');
console.log(error);
j(error);
});
}).catch((error) => {
console.log('Error');
console.log(error);
this.alert.genericError();
j(error);
}); I generated the tokenParams object using: https://<client>.geopedia.ca/portal/sharing/rest/generateToken which will also return a token. I haven't changed anything in this code in weeks, so I have to assume it's either something on the clients side or ESRI's. Has anyone run into similar issues? Thanks
... View more
08-03-2021
08:57 AM
|
0
|
4
|
5027
|
|
POST
|
Good Day I wrote a function that grabs a token from an authentication URL, which requires the "client" field in the params. When we use client: 'referer', and then set referer, we get a token, and can use that token to authenticate against the feature layer. If we try to use client: 'requestip' or client: 'ip', and then use the token we get back, we get a FEDERATION error, BUT, if we change client to clientid and set 'requestip' or 'ip', the token that comes back is just fine. I swore I read about this somewhere but can't find it, and I can't explain why this is happening. This is the query function that also handles authentication. query(url?: string) { return new Promise( (r, j) => { const tokenParams = { username: this._session.username, password: this._session.password, clientid: 'requestip', } request(this._tokenURL, {params: tokenParams}).then((esriResponse) => { request(this.testURL, {params: {token: esriResponse.token}}).then((response) => { this._featureLayer = _.cloneDeep(response); r(this._featureLayer.fields); }).catch((error) => { console.log('Error'); console.log(error); j(error); }); }); }); } You can see tokenParams is set with clientid: 'requestip', and this works, so does anyone know why? Thanks
... View more
07-09-2021
02:14 PM
|
0
|
0
|
840
|
|
POST
|
That's what I was thinking, thanks for your answer.
... View more
06-03-2021
07:01 AM
|
0
|
0
|
1536
|
|
POST
|
Good Day I have two objects left with the print template, one is to centre the legend and the other is to remove the text under the scale, is it possible to do both of those things? My current template object: const template = new this.PrintTemplate({ format: 'jpg', layout: 'a4-landscape', layoutOptions: { authorText: '', copyrightText: '', customTextElements: [{ 'description': '', 'location': '' }], titleText: titleText }, attributionVisible: false, showLabelsBoolean: false, }); If it's not possible, that's fine. Thanks
... View more
06-02-2021
12:37 PM
|
0
|
2
|
1605
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-25-2025 07:33 AM | |
| 1 | 03-18-2025 11:15 AM | |
| 1 | 10-07-2022 08:14 AM | |
| 1 | 08-25-2023 10:47 AM | |
| 1 | 02-23-2023 08:22 AM |
| Online Status |
Offline
|
| Date Last Visited |
03-13-2026
07:55 AM
|