首页 / 浏览问题 / WebGIS / 问题详情
iserver11i,leaflet,报错L.supermap.GetLayersLegendInfoParameters is not a constructor
4EXP 2025年04月24日
// 发起请求,获取图例

      var getLayersLegendInfoParams = new L.supermap.GetLayersLegendInfoParameters({

        // bbox 或 layers 参数必须至少设置一个参数

        // bbox: "114.59,37.76,119.51,42.31",

        layers: "show:" + layers,

        width: 18,

        height: 18

      })

官网示例代码,在本地运行显示

  Uncaught TypeError: L.supermap.GetLayersLegendInfoParameters is not a constructor

include-leaflet.js和include-web.js都引了

1个回答

您运行程序后,在“网络”中查看include-leaflet.js中是否有GetLayersLegendInfoParameters方法,需要iClient for Leaflet是11.1.1及以上版本
1,276EXP 2025年04月24日
...