首页 > 解决方案 > 是否有可能上传旋转图像并使用开放层 6 中的静态图像源以错误的分辨率或范围渲染

问题描述

我努力了

scaling : 327.805670381418,327.805670381418
rotation : -0.1310210334156003
transformation : 7179251.8557908312,6022627.228704552

// center of image from affine
const translationX = transformation.getTranslation()[0];
const translationY = transformation.getTranslation()[1];
extent = transformExtent([translationX - (xScale * this.imageData.width / 2),
        translationY - (yScale * this.imageData.height / 2),
        translationX + (xScale * this.imageData.width / 2),
        translationY + (yScale * this.imageData.height / 2)],
        get('EPSG:3857'), get('EPSG:4326'));
const imageProjection = this.returnRotateProjection(
        viewProjection,
        fromLonLat([transformation.getTranslation()[0], transformation.getTranslation()[1]], 'EPSG:4326'),
        transformation.getRotation(),
        extent
      );
const imgSource = new Static({
        url: this.imgURL,
        projection: imageProjection,
        imageExtent: extent,
        imageSize: [this.imageData.width, this.imageData.height],
        imageLoadFunction : (image) => {
          image.getImage().src = this.imgURL;
          if (image.resolution === undefined) {
            image.resolution = (image.extent[3] - image.extent[1]) / image.image_.height;
          }
          image.state = 2; // ImageState.LOADED;
          image.unlistenImage_();
          image.changed();
        }
      });

标签: gisopenlayersrasteropenlayers-6angular-openlayers

解决方案


推荐阅读