I am trying to get the graphics & objectid of a point on the map and am using the identifyTask. I am following this example. This is my code
this.map.on("click", function (e) {
_this.map.graphics.clear();
identifyTask = new IdentifyTask("https://server/arcgis/rest/services/MUNICIPALITY_BUNDLE/ZK_KATASTAR_NA_ZELENILO/MapServer");
identifyParams = new IdentifyParameters();
identifyParams.tolerance = 3;
identifyParams.returnGeometry = true;
identifyParams.layerIds = [0, 2];
identifyParams.layerOption = IdentifyParameters.LAYER_OPTION_ALL;
identifyParams.width = _this.map.width;
identifyParams.height = _this.map.height;
identifyParams.geometry = e.mapPoint;
identifyParams.mapExtent = _this.map.extent;
console.log("identifyParams", identifyParams);
identifyTask.execute(identifyParams, function (idResults) {
console.log("test", idResults);
});
});idResults returns an empty array and I am unsure as to why.

Any ideas or pointers as to what I am doing wrong?