Hi,
I using ArcGIS_Runtime_SDK_Qt_Windows_100_14_1 sdk. Im using Qt Creator 7.0.2 Based on Qt 6.2.3 (MSVC 2019, 64 bit) and Kits Qt 5.15.2 (Android Clang Multi -Abi and MinGW 64-bit ) .
When I want to query two layers in an identify query ( mapView.identifyLayersWithMaxResults) , feature disappears. This event happens in some cases. As a result of the query identifyLayersResults lenght is 0 and I am not getting any error.How can I solve this problem ?
Below is the video taken during Identify:
All the codes used are as follows:
KgmMapObject.qml
import QtQuick 2.6
import QtQuick.Controls 2.2
import Esri.ArcGISRuntime 100.14
Rectangle {
id: appWindowObj
clip: true
property string msgText: ""
MapView {
id:mainViewObj
anchors.fill: parent
attributionTextVisible:false
// set focus to enable keyboard navigation
Component.onCompleted: {
forceActiveFocus();
}
Map {
Basemap {
WebTiledLayer {
templateUrl: "http://.../wmts/.../gm_grid/{level}/{col}/{row}.png"
}
}
FeatureLayer {
ServiceFeatureTable {
url: "https://.../arcgis/rest/services/.../FeatureServer/0"
}
}
FeatureLayer {
ServiceFeatureTable {
url: "https://.../arcgis/rest/services/.../FeatureServer/1"
}
}
ViewpointCenter {
Point {
x: 3894007.968960
y: 4749476.7008
spatialReference: SpatialReference { wkid: 3857 }
}
targetScale: 7000000
}
}
onMouseClicked: {
const screenX = mouse.x;
const screenY = mouse.y;
const tolerance = 12;
const returnPopups = false;
const maxResults = 1;
mainViewObj.identifyLayersWithMaxResults(screenX, screenY, tolerance, returnPopups, maxResults);
}
// handle the identify results
onIdentifyLayersStatusChanged: {
if (identifyLayersStatus !== Enums.TaskStatusCompleted)
return;
msgText = "";
const results = mainViewObj.identifyLayersResults;
for (let i = 0; i < results.length; i++) {
const result = results[i];
const count = geoElementsCountFromResult(result);
const layerName = result.layerContent.name;
msgText += "%1 : %2".arg(layerName).arg(count);
// add new line character if not the final element in array
if (i !== results.length)
msgText += "\n";
}
if (msgText.length > 0)
msgDialog.open();
}
onErrorChanged: {
if (error)
{
console.log("error:", error.message, error.additionalMessage)
msgText=error.message+" "+error.additionalMessage;
msgDialog.open();
}
}
}
function geoElementsCountFromResult(layerObjResult) {
const tempResults = [layerObjResult];
let count = 0;
let index = 0;
while (index < tempResults.length) {
const identifyResult = tempResults[index];
count += identifyResult.geoElements.length;if (identifyResult.sublayerResults.length > 0) {
tempResults.push(identifyResult.sublayerResults[index]);
}
index += 1;
}
return count;
}
Dialog {
id: msgDialog
modal: true
x: Math.round(parent.width - width) / 2
y: Math.round(parent.height - height) / 2
standardButtons: Dialog.Ok
property alias text : textLabel.text
Text {
id: textLabel
text: msgText
}
}
}
main.qml
import QtQuick 2.12
import QtQuick.Controls 2.12
ApplicationWindow {
id: window
width: 360
height: 520
visible: true
KgmMapObject{
id: kgmMapObj
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
visible: true
}
}
The content of one of the FeatureServices used is below as an image:

