|
POST
|
Perhaps it's related to the issue described in this post.
... View more
09-23-2024
10:45 AM
|
0
|
0
|
1381
|
|
POST
|
On line 21, instead of: query.where = "1=1"; I think you need this instead: query.where = roomsUseLayer.definitionExpression; Or better yet, you could remove line 21 altogether, because according to the documentation for createQuery, the "where" setting should already be set according to the definitionExpression. Setting it to "1=1" would overwrite that and return all features in the layer.
... View more
09-16-2024
01:47 PM
|
1
|
2
|
2096
|
|
POST
|
On line 25 of your 4.x code you have this to zoom to the feature: view.goTo (geometry); If you want to make the layer visible after zooming, you can change that line to the following: view.goTo(geometry).then(function() {
floorOutline.visible = true;
});
... View more
09-16-2024
10:17 AM
|
1
|
6
|
2113
|
|
POST
|
If you're just wanting to show a particular set of features at any given time, and know the objectID values of that set, then using definitionExpression would be one way to do so: function hideLayerFeatures(featureLayer) {
featureLayer.definitionExpression = "1=0";
}
function showLayerFeatures(featureLayer, ids) {
if (Array.isArray(ids))
featureLayer.definitionExpression = featureLayer.objectIdField + " IN(" + ids.join(",") + ")";
else if (typeof ids == "number")
featureLayer.definitionExpression = featureLayer.objectIdField + " = " + ids.toString();
}
... View more
09-13-2024
10:16 AM
|
1
|
8
|
2174
|
|
POST
|
If you examine the contents of the request to generate the printout, does it appear to be sending the graphics (i.e from app.theView.graphics) as JSON, or is it sending a screenshot of them? It seems to me this problem could occur if it's doing the latter.
... View more
09-04-2024
04:13 PM
|
1
|
1
|
2163
|
|
POST
|
You can create a FeatureLayer object from the REST endpoint URL, and get the information from its fields collection after it loads: const featureLayer = new FeatureLayer({
url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0"
});
featureLayer.when(function() {
featureLayer.fields.forEach(function(field) {
console.info(field.name + " ( type: " + field.type + ", alias: " + field.alias + " )");
});
});
featureLayer.load();
... View more
09-04-2024
03:44 PM
|
0
|
1
|
864
|
|
POST
|
This "should" be handled by the scalePreserved property of the PrintTemplate, in which case line 44 of your 4.x code should probably be set to true.
... View more
09-04-2024
01:03 PM
|
0
|
3
|
2185
|
|
POST
|
This is an old thread, but it's still Google's first result for "arcgis server stops immediately", so I ended up here today. In our case, if we started the ArcGIS Server service from the Windows services console, it would act as if it started, and its status would be "Running". However, clicking refresh immediately after would show it was no longer running. There was nothing useful in the Event Viewer, and the only indication anything was happening at all was the creation of an empty log file in C:\Program Files\ArcGIS\Server\usr\logs\[server_name]\server. To make a long story short, this one turned out to be a file system permissions issue. We use a domain account to run the service, and among other things, it's granted certain permissions on the "arcgisserver" folder. Evidently, somebody inadvertently removed that account's permissions and this situation was the result. After adding the permissions back, the service is operating normally.
... View more
08-29-2024
12:06 PM
|
0
|
0
|
1587
|
|
POST
|
The MapImageLayer class doesn't expose an initialExtent property, but the value can still be retrieved from its sourceJSON property. See line 7 below, which also uses Extent.fromJSON: var mapImageLayer = new MapImageLayer({
url: "URL_DU_MAP_IMAGE_LAYER"
});
mapImageLayer.load().then(function() {
// Obtenir l'étendue initiale du MapImageLayer
var initialExtent = Extent.fromJSON(mapImageLayer.sourceJSON.initialExtent);
console.log("Étendue initiale du MapImageLayer : ", initialExtent);
// Créer la vue de la carte en utilisant l'étendue initiale
var map = new Map({
basemap: "streets",
layers: [mapImageLayer]
});
var view = new MapView({
container: "viewDiv", // ID de l'élément HTML où la carte sera affichée
map: map,
extent: initialExtent
});
}).catch(function(error) {
console.error("Erreur lors du chargement du MapImageLayer : ", error);
});
... View more
08-28-2024
10:20 AM
|
0
|
1
|
819
|
|
POST
|
It seems the simplest thing to do, at least to accomplish this visually, would be to use a SimpleFillSymbol with your resultSymbol instead of a PictureMarkerSymbol. Would that not accomplish what you're trying to do?
... View more
08-26-2024
10:43 AM
|
0
|
1
|
740
|
|
POST
|
Yes, it's the same kind of deal. You could easily combine this with the previous one: const measurement = new Measurement();
measurement.watch("viewModel.activeViewModel.tool", function(tool) {
if (tool?._manipulatorLayer) {
tool._manipulatorLayer.graphics.on("before-add", function(evt) {
if (evt.item.symbol.type == "simple-marker")
evt.item.symbol = new SimpleMarkerSymbol(); //set a custom marker symbol for the vertex here
});
}
});
... View more
08-23-2024
04:17 PM
|
1
|
0
|
1243
|
|
POST
|
I don't believe there's a documented way to do this. The following solution works, but uses undocumented features, and therefore may not work in a future version of the SDK. so use at your own risk: const measurement = new Measurement();
measurement.watch("viewModel.activeViewModel.tool", function(tool) {
if (tool?._measurementLayer) {
tool._measurementLayer.graphics.on("before-add", function(evt) {
if (measurement.activeTool == "distance") {
if (evt.item.symbol.type == "cim")
evt.item.symbol = new SimpleLineSymbol(); //set a custom line symbol here
} else if (measurement.activeTool == "area") {
if (evt.item.symbol.type == "simple-fill")
evt.item.symbol = new SimpleFillSymbol(); //set a custom fill symbol here
else if (evt.item.symbol.type == "simple-line")
evt.item.symbol = new SimpleLineSymbol(); //set a custom line symbol for the outline here
}
});
}
});
... View more
08-23-2024
12:06 PM
|
1
|
3
|
1255
|
|
POST
|
Thank you @KristianEkenes, I didn't know about queryAggregates, but it's a game-changer for this problem. However, there are a couple subtleties about this approach that have to be taken into account, one of which I think should be classified as a bug. I've revised my "checkCluster" function below, which produces accurate results now: function checkCluster(view, graphic) {
return new Promise(function(resolve, reject) {
view.whenLayerView(graphic.layer).then(function(layerView) {
layerView.queryAggregates().then(function(featureSet) {
var aggregateIDs = [];
featureSet.features.forEach(function(feature, index) {
// if (feature.attributes.cluster_count === 1)
// console.warn("Aggregate feature with OID " + feature.getObjectId() + " has cluster count of 1; this shouldn't be possible...");
if ((feature.attributes.cluster_count > 1) && (view.extent.intersects(feature.geometry)))
aggregateIDs.push(feature.getObjectId());
});
if (aggregateIDs.length === 0)
resolve({graphic:graphic, isCluster:false});
else {
var query = layerView.createQuery();
query.aggregateIds = aggregateIDs;
layerView.queryFeatures(query).then(function(featureSet2) {
for (var x = 0; x < featureSet2.features.length; x++) {
if (featureSet2.features[x].getObjectId() == graphic.getObjectId()) {
resolve({graphic:graphic, isCluster:true});
return;
}
}
resolve({graphic:graphic, isCluster:false});
}, reject);
}
}, reject);
}, reject);
});
} The two subtleties are addressed on line 11. One is that queryAggregates, as documented, doesn't support spatial queries. This is fine in and of itself...just something to be aware of. The second condition in line 11 is used to filter only results that intersect the View, but that may not be necessary depending on your needs. The other issue is addressed by the first condition, and also further highlighted by lines 8 and 9, which are commented out. The queryAggregates function can (and does) return features with a cluster_count of 1 (one). I don't think this should be possible. Here is a quote from the FeatureReductionCluster documentation (all emphasis is found in the original): "This documentation refers to two kinds of features: aggregate features and individual features. Aggregate features represent clusters. Clusters always represent two or more features. There's no such thing as clusters with a count of one. If a feature does not belong to a cluster, it is considered an individual feature." I don't think the documentation there could really be any clearer. If "there's no such thing as clusters with a count of one", then I don't think queryAggregates should be returning features with a cluster_count of one. It definitely threw me for a loop as I was revising my function.
... View more
08-13-2024
01:04 PM
|
0
|
0
|
1214
|
|
POST
|
If you don't want a given layer to appear in the Legend, you can set its legendEnabled property to false.
... View more
08-12-2024
11:10 AM
|
0
|
0
|
492
|
|
POST
|
As of now, yes, but that could change at any time. See this message.
... View more
08-12-2024
10:34 AM
|
0
|
1
|
2150
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-09-2025 09:35 AM | |
| 2 | 12-09-2025 09:06 AM | |
| 1 | 11-26-2025 12:29 PM | |
| 3 | 11-26-2025 09:11 AM | |
| 1 | 10-02-2025 01:14 PM |