I use Web AppBuilder (Develper Edtion) 2.17, Launchpad Theme, on 3D Scenes (ArcGIS API for javascript 4.16).
Regularly mouse left click on a feaature opens feature default popup.
I don't want to change this, but how can I enable/disable an option that left click (or right click) on a feature will open my custom widget on that feature e.g. if I want to supply the user with query options on that feature?
Solved! Go to Solution.
How to redirect the left click to not open the regular popup
I thought that was pretty clear from my previous reply. The link I provided shows how to prevent the standard popup from appearing.
As far as making your popup show instead you just simply add a view click listener.
Setting it back to the default popup is as simple as undoing what you did to prevent it.
Dear Robert Scheitlin, GISP, no one has referred frm 3 Oct... Can you help, please?
Michael,
https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#popup
WAB 3D uses JS API 4.x so you just need to search the JS API space to find your answers sometimes.
https://community.esri.com/thread/223665-webscene-how-to-prevent-the-identify-on-click-on-the-scene
But I don't want to block or replace the default popup... I want that left-click on feature will still open the default popup, but that right-click on feature will open my custom-widget (or custom-popup) on that feature.
Michael,
You are going to find very little info on adding a right click event to WAB as it is a very poor workflow choice. There is no right click on mobile, Apple is not a big supporter of right click, actually Windows is the main platform that uses right click. The few threads I have seen about adding right click to WAB normally they change their mind for a alternate workflow. But if that is your choice then the answer is just add a view click listener and check the button property of the event.
https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#event-click
Thank you very much, Robert, for this very important insight!
So I have to use the left click, and have to be able to "choose" by some button, which popup will be opened, the default popup, or my special popup (or custom-widget).
How should I program this "switch" which will be opened by the left click?
That is completely up to you as the developer. Maybe a button in a widget or something.
I'll make it clear what I ask: How to redirect the left click to not open the regular popup but my custom widget (and how to set it back to the regular popup, after I opened the custom widget)
How to redirect the left click to not open the regular popup
I thought that was pretty clear from my previous reply. The link I provided shows how to prevent the standard popup from appearing.
As far as making your popup show instead you just simply add a view click listener.
Setting it back to the default popup is as simple as undoing what you did to prevent it.