Invoking the pop up click event is pretty easy with arcgis js api 4.15, for instance you simply define it.
i.e. like below:
fl = new FeatureLayer({
source: gras,
objectIdField: "ObjectID",
geometryType: "polygon",
fields: [{
name: "ObjectID",
alias: "ObjectID",
type: "oid"
}, {
name: "id",
alias: "id",
type: "string"
}, {
name: "place",
alias: "place",
type: "string"
}, {
name: "url",
alias: "url",
type: "string"
}, {
name: "grid_value",
alias: "grid_value",
type: "double"
}],
renderer: renderer,
popupEnabled: true, <------------------------ here
popupTemplate: popuptemp <---------------------- here
});
Problem is... I am wondering if anyone has insight within how to handle changing this to a right click event within the API?
(i.e. documentation is lacking https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html)
Out of the box event is it triggers when the layer is clicked on, I would like to change or customize this to take the event on right click instead..
Another attempted logic via their documentation, not sure what to do with the nested open logic - or how to call it from there.
view.popuptemp.autoOpenEnabled = false;
view.on("click", function(event) {
if (event.which==3) {
alert('Right mouse button pressed');
break;
}
view.popuptemp.open({
// Set the popup
});
});