nl_tokens: Fit the extent on the map . Can be used to zoom to a layer for instance . @param { Object } state Current state . @param { Object } action Action to handle .
pl_tokens: function fitExtent ( state , action ) { const extent = action . extent ; const resolution = getResolutionForExtent ( extent , <mask> . size , action . projection ) ; const zoom = getZoomForResolution ( resolution , action . projection ) ; const center = [ ( extent [ 0 ] + extent [ 2 ] ) / 2 , ( extent [ 1 ] + extent [ 3 ] ) / 2 ] ; return Object . assign ( { } , state , { center , zoom } ) ; }