I would like to trigger pop-ups to open when features are selected interactively from the map's 'Select' tool.
The Builder provides the option to 'Show pop-up upon feature selection', but as the more info button states: a "Selection made interactively from the map is excluded".
I have a custom copy of the COTS 'arcgis-map' widget that I can modify to enable this behaviour. Has anyone implemented this? In general steps, I think I need to listen for a selection change event, get the selected features, and then display the pop-ups.
First of all, be aware that the select tool is coming as a stand-alone widget in the next update which could potentially make this an OOTB option or at least make this customization easier.
The first problem I see with this idea is that there can only ever be one popup at a time. A popup can contain multiple features from multiple layers, but only one at a single location will ever be displayed at a given time. But the select tool is designed to select many features at once.
The way I would go about building a widget like this would be combining the Sketch and Features widgets from the JavaScript API. The Sketch widget would be used to draw a shape. When the shape is finished it would trigger a query that would find all the features in that area. And the query would send its results to the Features widget. The final code would be something similar to this example.
https://developers.arcgis.com/javascript/latest/sample-code/highlight-features-by-geometry/
Thanks so much for the heads up re: ExB Dev roadmap!
The pagination action bar appears on top of the pop-up window when there are multiple records clicked on the map, allowing the user to identify the number of records within the click radius and cycle through each feature's pop-up details.
There is also a fair bit of pop-up styling via custom HTML so I'm not sure the Feature widget would work for this application, but I'll look into this example! Thanks so much.
There is also the Feature (singular) widget. It does not come with all of the extras of the standard popup by default, but it is only designed for a single feature at a time. So to handle multiple features you'll need to create a loop. This is how @RobertScheitlin__GISP's Feature Panel works.
@Yuriko, did you ever make progress on developing your idea? I am running into the same need and came up with a similar idea, but if youve already done it, then I might ask to follow your path.
Hi @FaithBest ,
As you know the OOTB behaviour of an interactive mouse click on the map isn't easily replicated because of the relationship between pop-ups and selections that Jeffrey outlines above. An interactive click identifies all underlying features from all layers returned in a pagination stack enabling the selection of one feature at a time. But an interactive selection with either the Map widget select tool or stand-alone Select widget selects all features so one needs to manage how the selected features are collected, displayed and paginated through... e.g. should the current pagination index be 'highlighted' or do you de-select them all and re-select the collection one feature at a time? Figured this was a rabbit-hole for another day...
Not sure what your specific scenario is but my focus was on one primary feature layer, and I ended up using Select and List widgets together: the record selection action with the Select widget filters the List features and interactively selecting a feature within the List triggers the popup in the web map. When this app is pushed to production I could provide a link to demo... not sure this helps you at all though 😞