Reputation: 1145
My map has multiple regions. If a certain region is selected I restrict all avalaible layers to an extent of a selected region by setting "extent" property like so: allLayers.forEach(l => l.setExtent(extent))
. Whenever I unselect a region I want to see the whole map again. How do I reset the extent of the layers whose extent I changed before?
Upvotes: 1
Views: 610
Reputation: 1145
Figured it out. allLayers.forEach(l => l.setExtent(undefined)).
Had to pass undefined so typescript doesn't yell at me, empty braces are supposed to work too.
Upvotes: 1