|
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
|
1447
|
|
POST
|
Thanks for the input, it's worth the time investment to do that.
... View more
09-27-2021
11:39 AM
|
0
|
0
|
1251
|
|
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
|
1342
|
|
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
|
4333
|
|
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
|
4365
|
|
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
|
4389
|
|
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
|
708
|
|
POST
|
That's what I was thinking, thanks for your answer.
... View more
06-03-2021
07:01 AM
|
0
|
0
|
1240
|
|
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
|
1309
|
|
POST
|
Thanks for the suggestion, I can play around with that idea and see where I can take it.
... View more
04-22-2021
02:19 PM
|
0
|
0
|
1023
|
|
POST
|
Good Day I have a map with a mix of points and polygons: If I zoom out and try to select a polygon near the point, the point will almost always be included in the Hit Test, to spite not overlapping the polygon. In this case I was trying to select the area pointed to by the red arrow. If I look at the hit test I see two elements, are obviously the point and the polygon: My question is, how do I query the correct object? It has the screen point, which I assume has to be the tip of the mouse pointer, so is there away to correlate that again the objects returned from the Hit Test? This is core part of the Hit Function: clickHandler() { this._view.on('click', (event) => { console.clear(); console.log('Click Event'); console.log(event); this._view.hitTest(event).then((response) => { console.log('Hit Test Result'); console.log(response); }); }); } Thanks
... View more
04-22-2021
11:17 AM
|
0
|
2
|
1036
|
|
POST
|
Sorry, I totally spaced on this ticket! I changed our code over to use ArcGIS Core from: https://github.com/Esri/jsapi-resources/tree/master/esm-samples I used that to create this example: https://github.com/docmur/angular-core-esri I accidentally left it running for 60 hours last weekend and overall the memory was fine. It grabbed a little for the map, but otherwise didn't grab anymore. Take a look and see if you can make it work 🙂
... View more
04-22-2021
11:10 AM
|
0
|
0
|
3690
|
|
POST
|
I'll try that on my end, I was doing some similar in 4.15 / 4.16 of the ArcGIS lib, but maybe things got better in 4.17+. Thanks for the tip! Cheers
... View more
03-21-2021
11:51 AM
|
0
|
0
|
3741
|
|
POST
|
Well you've been talking with Andy whose fairly responsive, and that's good! I know at a few other ESRI dev's know about this, and I've given them a couple test repo's to demonstrate the issue, so I'm not sure what else we can do. Apart from refreshing, which is certainly not ideal, I think we're stuck until they figure out a solution on their end.
... View more
03-18-2021
08:46 AM
|
0
|
0
|
3750
|
|
POST
|
Your map-service is doing the same thing our esri-service is doing, so at least we approached the problem from the same angle!
... View more
03-18-2021
07:35 AM
|
0
|
2
|
3754
|
| 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 |
10-24-2025
07:12 AM
|