首页 / 浏览问题 / WebGIS / 问题详情
找不到图层的id
22EXP 2023年05月26日
switch (obj.type) {

        case "tdt":

          map.addSource("tdtVec", {

            type: "raster",

            tiles: [

              //请求地址

              obj.url[0],

            ],

            //分辨率

            tileSize: 256,

          });

          map.addSource("tdtCva", {

            type: "raster",

            tiles: [

              //请求地址

              obj.url[1],

            ],

            //分辨率

            tileSize: 256,

          });

          map.addLayer({

            id: "tdtVec",

            type: "raster",

            source: "tdtVec",

            minzoom: 0,

            maxzoom: 22,

          });

          map.addLayer({

            id: "tdtCva",

            type: "raster",

            source: "tdtCva",

            minzoom: 0,

            maxzoom: 22,

          });

          map.moveLayer(

            "tdtVec",

            "tdtVec"

          );

          map.moveLayer(

            "tdtCva",

            "tdtCva"

          );

          this.currentUnderMap = "tdt";

          break;

        case "arcgisMap":

          map.addSource("arcgisMap", {

            type: "raster",

            tiles: [

              //请求地址

              obj.url[0],

            ],

            //分辨率

            tileSize: 256,

          });

          map.addSource("tdtCva", {

            type: "raster",

            tiles: [

              //请求地址

              obj.url[1],

            ],

            //分辨率

            tileSize: 256,

          });

          map.addLayer(

            {

              id: "arcgisMap",

              type: "raster",

              source: "arcgisMap",

              minzoom: 0,

              maxzoom: 22,

            },

            ""

          );

          map.addLayer({

            id: "tdtCva",

            type: "raster",

            source: "tdtCva",

            minzoom: 0,

            maxzoom: 22,

          });

          map.moveLayer("arcgisMap", RemotesesingConfig.rasterFlagLayer);

          map.moveLayer("tdtCva", RemotesesingConfig.rasterFlagLayer);

          this.currentUnderMap = "arcgisMap";

          break;

        case "supermapMap":

          map.addSource("supermapMap", {

            type: "raster",

            tiles: [

              //请求地址

              obj.url[0],

            ],

            //分辨率

            tileSize: 256,

          });

          map.addLayer(

            {

              id: "supermapMap",

              type: "raster",

              source: "supermapMap",

              minzoom: 0,

              maxzoom: 22,

            },

            RemotesesingConfig.rasterFlagLayer

          );

          this.currentUnderMap = "supermapMap";

          break;

        default:

          break;

      }

报错Layer with id "RoadLine2_1@GZGQ" does not exist on this map.

1个回答

您好,可以根据报错信息,排查一下是哪个地图中缺少该图层,可以在iserver中地图服务下查看图层列表。
1,865EXP 2023年05月26日
已经解决
...