code: function(min, max) {
      return function limitVisibleX(params) {
        // Calculate the zoom value that makes the specified range fully visible.
        var maxZoom = max - min;
  
        // Clamp zoom to the maximum value.
        if (params.zoom > maxZoom) {
          params.zoom = maxZoom;
        }
  
        // Bound X such that the image is visible up to the range edges.
        var minX = min + 0.5 * params.zoom;
        var maxX = max - 0.5 * params.zoom;
        params.x = clamp(params.x, minX, maxX);
  
        return params;
      };
    }
docs: Returns a view limiter that constrains the values of the x parameter that
  are inside the viewport.
  @param {number} min The minimum x value.
  @param {number} max The maximum x value.
  @return {FlatViewLimiter}