I've got a custom widget i've developed here which is (in part) allowing the user to target a feature by selecting a name from a dropdown. I have the widget and message part configured such that it is correctly selecting the feature from the data source and in fact the feature does show as selected in the map. What I'm trying to do though is configure the map to zoom to the selected feature; however even though the action is set to zoom to, it does not do so. Not sure where I'm going wrong...
My widget manifest shows:
"publishMessages": [
"DATA_RECORDS_SELECTION_CHANGE"
]
and the actions tab shows in the widget settings. Not sure where to go from here though to get the map to honor the action. The message is configured as shown:
I can provide additional snippets but not sure what is needed.
Solved! Go to Solution.
Make sure your Map widget is listening to the same data source your widget is publishing the DATA_RECORDS_SELECTION_CHANGE message from. In Map → Actions, add trigger = record selection → action = zoom to. If it still doesn’t work, call view.goTo(selectedFeature.geometry) in your widget code as a fallback.
Make sure your Map widget is listening to the same data source your widget is publishing the DATA_RECORDS_SELECTION_CHANGE message from. In Map → Actions, add trigger = record selection → action = zoom to. If it still doesn’t work, call view.goTo(selectedFeature.geometry) in your widget code as a fallback.
so strange, confirmed that the data source is the same but yeah I could not get the map to zoom. However adding view.goTo() as a fallback works perfect. Thank you!