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.