Hi Jared,
Thanks for the reply. Im pretty new to this so am learning on the way so any help would be appreciated. I feel like I might be missing a connection as in the previous version it has connections (line110 on sample) but cant seem to get connections working with onIdentifyLayerStatusChanged.
Here is some of my code, the map url has been taken on purpose. The app works just cant seen to get the map to zoom once the feature has been clicked.
Cheers, Eric
contentItem: Rectangle{
anchors.top:header.bottom
MapView {
id: mapView
anchors.fill: parent
viewInsets.bottom: attributeView.height / scaleFactor
locationDisplay {
positionSource: PositionSource {}
}
Map {
initUrl: "deleted on purpose"
onOperationalLayersChanged: {
for (var i = 0; operationalLayers.count; i++) {
if (operationalLayers.get(i).name === "ESCAD Incidents") {
featureLayer = operationalLayers.get(i)
featureLayer.refreshInterval = 5000
featureLayer.selectionColor = "#02253A"
//featureTable = featureLayer.featureTable
break
}
}
}
}
onMouseClicked: {
attributeView.height = 0;
featureLayer.clearSelection()
identifyLayer(featureLayer, mouse.x, mouse.y, 15, false)
relatedFeaturesModel.clear();
}
onIdentifyLayerStatusChanged: {
if (identifyLayerStatus === Enums.TaskStatusCompleted) {
if (identifyLayerResult.geoElements.length > 0) {
//Retrieve Feature
var feature = identifyLayerResult.geoElements [0]
//select feature
featureLayer.selectFeature(feature)
//Get information from layer
var masterIncidentNumber = feature.attributes.attributeValue("master_Incident_Number")
var incidentType = feature.attributes.attributeValue("Incident_Type")
var MINDetails = feature.attributes.attributeValue("MIN_Details")
var CrossStreet = feature.attributes.attributeValue("Cross_Street")
var location = feature.attributes.attributeValue("location")
var commandChannel = feature.attributes.attributeValue("Command_Channel")
var tacChannel = feature.attributes.attributeValue("Primary_TAC_Channel")
var longitude = feature.attributes.attributeValue("longitude")
var latitude = feature.attributes.attributeValue("latitude")
console.log("masterIncidentNumber", masterIncidentNumber )
console.log("location", location)
console.log("Incident Type", incidentType)
console.log("MIN_ID", MINDetails)
console.log("Cross Street", CrossStreet)
console.log("Command_Channel", commandChannel)
console.log("Primary_TAC_Channel", tacChannel)
var listElement = {
"masterIncidentNumber" : masterIncidentNumber,
"location" : location,
"incidentType" : incidentType,
"MIN_ID" : MINDetails,
"crossStreet" : CrossStreet,
"Command_Channel" : commandChannel,
"Primary_TAC_Channel" : tacChannel,
"longitude" : longitude,
"latitude" : latitude
};
relatedFeaturesModel.append(listElement);
//zoom in not working
mapView.setViewpointGeometryAndPadding(feature.geometry, 30);
}
attributeView.height = 200 * scaleFactor
}
}
Rectangle {
id: attributeView
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom