This is my code, my problem is I cant configure it out , when the zoom level is below 5 it doesnt work, and when the zoom level is above 5 it works well.
layerView.queryFeatures(threatQuery).then((response) => {
const { geometry, attributes } = response.features[0];
const threatGeometry = ThreatPin({
active: true,
attributes: attributes,
geometry: geometry,
});
setActiveThreat({
highlighted: threatGeometry,
threatId: threatId,
});
mapDiv.current.activeThreat = {
highlighted: threatGeometry,
threatId: threatId,
};
mapDiv.current.center = geometry.centroid
? [geometry.centroid.longitude, geometry.centroid.latitude]
: [geometry.longitude, geometry.latitude];
mapDiv.current.graphics.add(threatGeometry);
});