We have an app that we built with Web App Builder along with some custom LayerList and Swipe widgets. One of the requirements we got this morning is that instead of showing a popup with a Hyperlinked URL when a user clicks on a feature in the web map, the customer just wants to skip the popup behavior altogether and click on features to open the URL.
I found a GeoNet Post by jai siva which gives me some good starting code:
However, since this is going to be in a custom Web App Builder App, I'm having trouble finding the best place to drop the code. I've tried at init.js, simpleLoader.js and jimu.js/MapManager.js but haven't had any luck. Any ideas on the best place and/or way to accomplish this?
John,
The MapManager.js would be the likely place to put this. In the _show2DWebMap function and inside the mapDeferred.then function handler.
sorry, which part should go where?
John,
Do you really need to add the FeatureLayer manually or is it already part of your web map?
It's not currently, but can already be part of the map. I just need to suppress the popup and instead create a functionality where when a user clicks on a feature, it grabs the url from the 'url' column in the attribute table for that feature, then opens a browser window to that url.
So just add lines 14 - 21 to the _show2DWebMap function and inside the mapDeferred.then function handler. Also you will need to add "esri/layers/FeatureLayer", to the define array.
Hi John,
Did you end up resolving this? I'm currently trying to do the same thing - any advice?