function inView(layerState, viewState) {
  if (!layerState.visible) {
    return false;
  }
  const resolution = viewState.resolution;
  if (
    resolution < layerState.minResolution ||
    resolution >= layerState.maxResolution
  ) {
    return false;
  }
  const zoom = viewState.zoom;
  return zoom > layerState.minZoom && zoom <= layerState.maxZoom;
}
Return `true` if the layer is visible and if the provided view state
has resolution and zoom levels that are in range of the layer's min/max.
@param {State} layerState Layer state.
@param {import("../View.js").State} viewState View state.
@return {boolean} The layer is visible at the given view state.