|
POST
|
I changed the data so we only use 1 set of ~15 800 features and use the attributes to show the time values. Using this method I have ~70 attributes, but I can use "valueExpressions" to change the render setting, giving me almost instance response and feed back because I don't have to regrab the data, I only have to apply a new render setting. I've been extended this idea out, over the last several days, so I have a Unique Value Renderer with ~170+ settings in it, and then change the fields / "valueExpression" to change the view, which has been game changer. If anyone else is running into this problem, try to flatten the data out and use attributes instead of duplicating features if you can get away with it 🙂 Thanks for the suggestion, I was actually logging to update my progress, but you said exactly what I did, and it worked like a charm. Cheers
... View more
11-03-2022
02:44 PM
|
1
|
1
|
3436
|
|
POST
|
Good Day After looking through the widget list: https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Widget.html, I was wondering what's available to duplicate the Style, Filter and Properties widget available from ArcGIS Online: I assume those widgets not being in the list means I have to code something myself, is this true? Thanks
... View more
11-01-2022
10:00 AM
|
0
|
0
|
543
|
|
POST
|
Thanks for the suggestion but it's still a choppy mess, no matter how I breakdown the queries. Using pagination the year change code is now: if (changes.year.currentValue) {
const useDefinitionExpression = false;
if (useDefinitionExpression) {
this._view.map.layers.forEach((layer) => {
if (layer.type === 'feature') {
layer.definitionExpression = 'Year = ' + this._year;
}
})
} else {
const featureBreak = 10;
this._view.when(() => {
this._view.map.layers.forEach((layer) => {
if (layer.type === 'feature') {
this.queryFeatureCount(layer).then((featureCount: number) => {
const runQueryCode = true;
if (runQueryCode) {
const featureGroup = featureCount / featureBreak;
const featureSteps = [];
for (let i = 0; i <= featureCount; i += featureGroup) {
featureSteps.push({
start: Number(i.toFixed(0)),
end: Number((i + featureGroup - 1).toFixed(0))
})
}
const runFeatureStepLoop = true;
if (runFeatureStepLoop) {
this._map.removeAll();
featureSteps.forEach((step) => {
const query = {
start: step.start,
num: step.end,
where: 'Year = ' + this._year,
outFields: ["*"],
returnGeometry: true,
};
console.log('Query');
console.log(query);
layer.queryFeatures(query).then((queryResult) => {
try {
console.log('Adding New Features');
this._map.addMany(queryResult?.features);
} catch (error) {
console.log(error);
}
}).catch((queryError) => {
console.log('Error Querying Features');
console.log(queryError);
})
}) // END_FOREACH: Feature Steps
}
}
});
}
})
})
}
} Using "featureBreak" I can control how many queries are generated, but no matter what I set that to I run into the same problem. Right now that problem is a lot of shuddering and crashing. Apart from using this method, are there any considered best practices? I'm thinking we might have to use 1 layer / year to make this effective, because nothing I try seems to work. Thanks 😀
... View more
11-01-2022
09:13 AM
|
0
|
4
|
3458
|
|
POST
|
Thanks! I'm going to try and build a version of this to load the data in parts, that might solve my issue. I'll let you know if it works 🙂
... View more
10-31-2022
12:38 PM
|
0
|
0
|
3464
|
|
POST
|
Good Day I have a layer with ~790k features which is comprised of 15 800 features over 50 years, 15 800 * 50 = 790k. At any one point I only need to show 1 year or 15 800 features, and the field I need to filter on is called "Year". I'm using a Hosted Feature Layer and my current process is: 1. Grab the Feature Layer by Portal ID 2. Run a query on that layer give me all features 3. Use those features to build the render settings 4. Set the initial definitionExpression to the 2022, so I see the first batch of 15 800 features 5. Add that layer to the map: this._layers = [];
this._layers.push(new FeatureLayer({
portalItem: {
id: "<feature id>"
},
}))
this.buildRenderSetting().then((render) => {
if (_.isEmpty(this._year)) {
this._year = new Date().getFullYear();
}
this._layers[0].renderer = render;
if (this._year) {
this._layers[0].definitionExpression = 'Year = ' + this._year;
}
this._map.removeAll();
this._layers.forEach((layer) => {
this._map.add(layer);
})
}) This works great, and I get a nice map with the first 15 800 features, the problem is when I change the year! My code to handle the year change: if (changes.year.currentValue) {
console.log('Year Changed');
console.log(changes.year.currentValue);
this._view.when(() => {
this._view.map.layers.forEach((layer) => {
layer.definitionExpression = 'Year = ' + this._year;
})
})
}) When that code executes I'm getting a really latent update, that results in several tile errors, and the map locks up for a solid minute or two, before eventually updating. If I'm zoomed in to a small area ~200 features, the update is much faster, on the order of seconds. I've tried to use both FeatureFilter and FeatureEffect, but those run so slow that it's honestly unusable, and I can replicate the same experience with Effect / Filter on ArcGIS Online with this same layer. I'm using a UniqueRenderValue for the render setting, looks like: const uniqueRenderSettings = {
type: 'unique-value',
valueExpression: `When(${_valueExpression})`,
uniqueValueInfos: [{
value: <renderKey>,
label: <renderKey>,
symbol: {
type: <symbol>,
color: <colour>,
size: 12,
width: 3,
outline: {
width: 4,
color: <symbol>
}
}
}]
} Is there a way to properly handle this case? Thanks
... View more
10-28-2022
11:34 AM
|
0
|
7
|
3586
|
|
POST
|
Figured out the problem, you have to tell the setting it's a coded-value domain, the following code works: this._editWidgetConfiguration.push({
layer: layer,
formTemplate: {
elements: [{
type: "field",
fieldName: "layer",
label: "blah",
domain: {
codedValues: [
{name: "1", code: "1"},
{name: "2", code: "2"},
],
type: 'coded-value'
}
}]
}
}) Hopefully this helps someone else 🙂 Thanks
... View more
10-07-2022
08:14 AM
|
1
|
0
|
1287
|
|
POST
|
Good Day I have a field visible in the editor to change how a featured is rendered, but the field itself is a string value. Is it possible / how do It pass, codedValues in the editor config, so the input is a drop down? if (event.added.length > 0) {
this._editWidgetConfiguration = [];
this._view.map.layers.forEach((layer) => {
this._editWidgetConfiguration.push({
layer: layer,
formTemplate: {
elements: [{
type: "field",
fieldName: "layer",
label: "blah",
codedValues: [
{name: "1", code: "1"},
{name: "2", code: "2"},
]
}]
}
})
});
console.log('Edit Widget Configuration');
console.log(_.cloneDeep(this._editWidgetConfiguration));
this.editorWidget.layerInfos = this._editWidgetConfiguration;
} That code is ran when layers are added to the map. I have the list of available settings available at this point, because I've built the unqiue render settings, so how do I pass the coded values to the editor? The field is defined as: {
name: 'layer',
alias: 'layer',
type: 'string'
}, Thanks
... View more
10-07-2022
07:49 AM
|
0
|
1
|
1294
|
|
POST
|
I apologize if this is in the wrong area. Is it possible to create a Hosted Feature Layer / Feature Layer in C# and publish to ArcGIS Online? We have a case where users can upload GIS data into our system, and we want to see if we can turn that data into a Hosted Feature Layer / Feature Layer programmatically, without having to go through the manual steps to do so, is this possible? Our backend is in C# / Entity, our frontend is in Angular. Thanks
... View more
10-04-2022
09:47 AM
|
0
|
3
|
1344
|
|
POST
|
That accomplished exactly what I'm looking for 🙂 - Thanks!
... View more
12-01-2021
11:26 AM
|
0
|
0
|
1818
|
|
POST
|
Good Day Is there an event that will trigger once my updated / added features are visible on the map and ready for interaction? Once the promise resolves ex: layer.applyEdits({
updateFeatures: data
}).then(() => {
this.layerLoadedEvent.emit(true);
r(null);
}) I'm still waiting for the features to be visible on the map, is there any event to let me know when everything is ready? Thanks
... View more
12-01-2021
10:11 AM
|
0
|
2
|
1883
|
|
POST
|
If you give me a few days I'll adapt my test repo to replicate the issue. We're using Angular 12, and the test repo is also using Angular 12. Every class break has a label uniqueValueInfo.push({
value: renderKey,
label: renderKey,
symbol: {
type: renderType,
color: mapData.attributes.colour,
size: 12,
width: 3,
outline: {
width: 4,
color: mapData.attributes.colour,
}
}
}) Render Key can never be null. I'll see what I can get you mid next week. Thanks for your help 🙂
... View more
11-19-2021
02:12 PM
|
1
|
0
|
2708
|
|
POST
|
Good Day I ran the test again, this time setting arcgis/core to 'next' instead of 4.21.2 in package.json, I still have the same problem: 4.21.2 Next: I also confirmed that the title on each Feature Layer is set to ''. Cheers
... View more
11-19-2021
12:04 PM
|
0
|
2
|
2710
|
|
POST
|
Good Day @Noah-Sager - Thanks for the reply, the PictureMarker is resolved! The second issue is that Roads is showing up without a line in front of it. The screen cap has Roads, and then under that (green line) Roads, which is correctly. I don't know why 'Roads' with no green line shows up. I'm assuming that's due to a title being generated for the Feature Layer, because if I generate multiple Feature Layers I can cause the same behaviour, for the Points or Polygon Layer. In the above example I have title: '' in the FeatureLayer code, which I thought should set the title to nothing. Hopefully that makes sense. Cheers
... View more
11-19-2021
07:43 AM
|
0
|
5
|
2714
|
|
POST
|
Good Day I switched from using a simple render to a unique render, but now when I print the map using the PrintTask, it's now showing the picture markers the same as before. This view from the PrintTask: Should look something like: My render setting is: field: "layer"
type: "unique-value"
uniqueValueInfos: [
{
label: "Market 1"
symbol: {
height: "20px"
type: "picture-marker"
url: "blah.png"
width: "20px"
}
value: "someValue1"
},
{...},
{...}
] Did I do something wrong setting up the render? I also noticed that if I try to map multiple things a label shows up that appears random, without a legend marker: Would this be the Feature Layer title, or where else would that come from / can I turn it off? I set the title to an empty string, but it's not disabling it: return {
fields: this._fields,
source: data,
outFields: ['*'],
objectIdField: 'ObjectID',
geometryType: geometryType,
spatialReference: {
wkid: 4326
},
title: ''
}; If anyone knows about either issue, do you know how to fix it? Thanks in advance 🙂
... View more
11-18-2021
02:20 PM
|
0
|
7
|
2771
|
| 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
|