arcgis调用gp服务加载栅格图层

arcgis调用gp服务加载栅格图层_第1张图片

async resultrender(val) {
      let that = this;
      //通过接口获取tif文件路径
      let resdatas = await getTifUrlByName({ name: val.title });
      const Geoprocessor = await arcgisPackage.Geoprocessor;
      let gp = new Geoprocessor(resdatas.data.data.mapId);
      var params = {
        inputPath: resdatas.data.data.tifPath,
      };
      gp.submitJob(params)
        .then((res) => {
          gp.waitForJobCompletion(res.jobId).then(() => {
            //直接获取拿取layer
            let layers = gp.getResultMapImageLayer(res.jobId);
            layers.then((layer) => {
              //结果集
              this.$message.success("已成功加载图层");
              this.map.add(layer);
              this.NowLayers = layer;
              that.tableDatas.td = [];
              that.tableDatas.td = [
                ...that.dealEvaluationResults(
                  JSON.parse(resdatas.data.data.result)
                ),
              ];
            });
          });
        })
        .catch((err) => {
          console.log(err);
        });
    },

你可能感兴趣的:(前端arcgis)