|
POST
|
Setting resultGraphicEnabled in the sample with 4.31 works as well...
... View more
05-15-2025
05:27 PM
|
1
|
0
|
909
|
|
POST
|
My bad, just saw you were using 4.31. I'll check the samples with that version.
... View more
05-15-2025
05:24 PM
|
0
|
1
|
909
|
|
POST
|
It does sound like a bug, but since it works in the samples, I'm not sure what to say about it. Are you also using 4.32? The code I gave is the "autocast" syntax, so should work without the constructor: const invisible = {
type: "simple-marker",
style: "square",
color: [0, 0, 0, 0],
size: "8px",
outline: {
color: [0, 0, 0, 0],
width: 1
}
};
sources.forEach(searchSource => {
searchSource.resultSymbol = invisible;
}); I'm not certain it'll make a difference, but may be worth a try. Other things would be to delete your temporary internet files (i.e. clear your cache), and user your browser's developer tools to ensure you see the latest code, and it's actually being executed by placing breakpoints, etc.
... View more
05-15-2025
05:22 PM
|
0
|
2
|
909
|
|
POST
|
It seems to me that setting resultGraphicEnabled to false should have done it, but since it didn't, there are alternatives. For example, sources is a collection of SearchSource objects. Each of those has its own resultGraphicEnabled property, so you might try setting those to false. If that doesn't work, SearchSource objects also have a resultSymbol property that allows you to define the appearance of the selection symbol. You might try setting that property with a completely transparent symbol. For example: //SimpleMarkerSymbol for points
{
type: "simple-marker",
style: "square",
color: [0,0,0,0],
size: "8px",
outline: {
color: [0,0,0,0],
width: 1
}
} or //SimpleFillSymbol for polygons
{
type: "simple-fill",
color: [0,0,0,0],
style: "solid",
outline: {
color: [0,0,0,0],
width: 1
}
}
... View more
05-15-2025
02:58 PM
|
0
|
4
|
928
|
|
POST
|
Technically yes, but it's not pretty. Despite the workflow being different, the basic problem and its solution are described in this thread. In your workflow, you just want the layer to draw the changes. What makes these similar is that the layer is doing the same kind of query operation seen in that thread in order to retrieve the data and draw it on the map. The only way I know of to alter this workflow and insert a where clause is to use a RequestInterceptor. A recent thread involving the use of those is here.
... View more
04-28-2025
10:43 AM
|
1
|
0
|
554
|
|
POST
|
After testing, I've concluded this was fixed in 4.32 since the situation described above now works without having to apply any fixes.
... View more
04-24-2025
12:12 PM
|
0
|
0
|
378
|
|
POST
|
The short answer is yes, you can do what you're talking about. The key to it is implementing a RequestInterceptor that captures the print service request before it's sent, and modifies the request to include the definitionExpression that you want for your request, but not necessarily for the layer presently in your map. That way you don't have to assign it directly to the layer. Note, interceptors are added to the "interceptors" property of esriConfig.request.
... View more
04-21-2025
03:29 PM
|
2
|
1
|
779
|
|
POST
|
The object referred to as "esriId" is the esri/identity/IdentityManager module. A shortcut to the documentation of the registerToken method is here.
... View more
04-14-2025
12:31 PM
|
0
|
6
|
1157
|
|
POST
|
Did this end up working out, or did you find something else more suitable?
... View more
04-09-2025
11:09 AM
|
0
|
1
|
608
|
|
POST
|
As far as I can tell, your code looks fine. Here's something to look into though: Your query's where clause "1=1" will return every record in the layer (this is and of itself is fine). Your console window only shows one record, which itself appears to be fine. However, it's possible that one record somewhere in the midst of all the records returned by the query has a null geometry. Such a case could cause the problem you're seeing. In that case, you might want to add a check to see if a record has a geometry before processing it.
... View more
04-09-2025
10:54 AM
|
0
|
0
|
677
|
|
POST
|
It looks like this may be the same issue resolved in this thread: https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/adding-a-row-to-a-table-using-js-4-x/m-p/1601382/highlight/true#M86790 Is that true, or is this a different one?
... View more
04-08-2025
10:17 AM
|
1
|
1
|
444
|
|
POST
|
Aloha Noah, thanks for following up. Your example uses the Shape_Length field, so doesn't exhibit the problem, since that's a numerical attribute. The problem I'm running into appears to happen when using the Geometry function. In your example, I changed the expression to: expression: "Round(Length(Geometry($feature),\"feet\"),2)" In doing so, I was surprised to find it working. I then changed line 22 to use version 4.31, and the labels stopped appearing, although there weren't any errors in the console. It appears that perhaps this may have been fixed in 4.32. I haven't started testing with 4.32 yet, but plan to later this week or next. When I do, I'll try this issue out and see what happens.
... View more
04-08-2025
09:45 AM
|
1
|
0
|
508
|
|
POST
|
It looks like "roomEditData" is an array of objectIDs. In that case, you'd want something like this instead of what you presently have on lines 4-10: const updates = [];
roomEditData.forEach(function(oid) {
updates.push ({
attributes: {
OBJECTID: oid,
PHYSICALCAPACITY: document.getElementById ('editroomDetails-PHYSICALCAPACITY').value
}
});
}); That assumes that the OID field name for the layer is actually "OBJECTID". If it isn't, you'll need to change the field name on line 5.
... View more
04-07-2025
05:10 PM
|
2
|
1
|
1263
|
|
POST
|
I have a map service published to ArcGIS Server whose spatial reference is WGS 84 UTM Zone 6N (WKID 32606). One of the layers in the service has labeling information defined, and the labelExpressionInfo.expression is set to: Round(Length(Geometry($feature),"feet"),2). I load this layer into a map as a 2D FeatureLayer. The spatial reference of the map is Web Mercator (WKID 3857). The data being retrieved from the server is returned by ArcGIS Server projected into Web Mercator (WKID 3857). Nonetheless, labels do not show up, and the following error appears in the console: Cannot work with geometry in this spatial reference. It is different to the execution spatial reference. This should not be happening because the data queried from the service is already in the Web Mercator projection. The problem is that the API, when processing the FeatureSets returned from the server, assigns the layer's spatial reference (WKID 32606) to the data, even though the coordinates are Web Mercator. The most convenient place I've found to insert a fix for this is in the esri.views.2d.layers.features.support.FeatureSetReaderJSON module, in the "fromFeatureSet" method. The published implementation looks like this: static fromFeatureSet(a, f) {
a = q.convertFromFeatureSet(a, f.objectIdField);
return l.fromOptimizedFeatureSet(a, f)
} The "a" parameter is the FeatureSet returned from the query, still in JSON format. The "f" parameter is an object containing various settings from the layer, including the spatial reference. Basically, I clone the "f" object, and set its spatial reference to the same as the FeatureSet: static fromFeatureSet(a, f) {
var g = {};
Object.getOwnPropertyNames(f).concat(Object.getOwnPropertyNames(Object.getPrototypeOf(f))).forEach(function(h) {
if (typeof f[h] != "function")
g[h] = f[h];
});
if (a.spatialReference)
g.spatialReference = f.spatialReference.constructor.fromJSON(a.spatialReference);
f = g;
a = q.convertFromFeatureSet(a, f.objectIdField);
return l.fromOptimizedFeatureSet(a, f)
} As can be seen, I've added lines 2-9, and everything else is the same. With this fix in place, no errors occur and the labels show up properly. I was using 4.31 for this, but other versions may be affected as well.
... View more
04-07-2025
04:51 PM
|
0
|
3
|
567
|
|
POST
|
Have you considered extending the Accessor class? See also https://developers.arcgis.com/javascript/latest/implementing-accessor/
... View more
03-25-2025
07:21 PM
|
2
|
3
|
748
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 3 | 2 weeks ago | |
| 1 | 10-02-2025 01:14 PM | |
| 1 | 10-16-2025 11:13 AM | |
| 1 | 11-22-2022 04:50 PM |