首頁 / 浏覽問題 / WebGIS / 問題詳情
iserver11i,leaflet,報錯L.supermap.GetLayersLegendInfoParameters is not a constructor
4EXP 2025年04月24日
// 發起請求,獲取圖例

      var getLayersLegendInfoParams = new L.supermap.GetLayersLegendInfoParameters({

        // bbox 或 layers 參數必須至少設置一(yī / yì /yí)個(gè)參數

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

        layers: "show:" + layers,

        width: 18,

        height: 18

      })

官網示例代碼,在(zài)本地(dì / de)運行顯示

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

include-leaflet.js和(hé / huò)include-web.js都引了(le/liǎo)

1個(gè)回答

您運行程序後,在(zài)“網絡”中查看include-leaflet.js中是(shì)否有GetLayersLegendInfoParameters方法,需要(yào / yāo)iClient for Leaflet是(shì)11.1.1及以(yǐ)上(shàng)版本
1,191EXP 2025年04月24日
...