Uncaught TypeError: ctlLayers.addOverLay is not a function

Uncaught TypeError: ctlLayers.addOverLay is not a function

我正在尝试在我的 index.php 中插入一个 ajax 脚本,我在其中调用传单方法 (addOverlay) ctlLayers.addOverLay(lyrEagleNests , "Eagle Nests") 但是我得到这个错误:

    Uncaught TypeError: ctlLayers.addOverLay is not a function
    at Object.success (djbasin_client.php:358)
    at u (jquery-3.3.1.min.js:2)
    at Object.fireWith [as resolveWith] (jquery-3.3.1.min.js:2)
    at k (jquery-3.3.1.min.js:2)
    at XMLHttpRequest.<anonymous> (jquery-3.3.1.min.js:2)
success @ djbasin_client.php:358
u @ jquery-3.3.1.min.js:2
fireWith @ jquery-3.3.1.min.js:2
k @ jquery-3.3.1.min.js:2
(anonymous) @ jquery-3.3.1.min.js:2
load (async)
send @ jquery-3.3.1.min.js:2
ajax @ jquery-3.3.1.min.js:2
(anonymous) @ djbasin_client.php:354
l @ jquery-3.3.1.min.js:2
c @ jquery-3.3.1.min.js:2
setTimeout (async)
(anonymous) @ jquery-3.3.1.min.js:2
u @ jquery-3.3.1.min.js:2
fireWith @ jquery-3.3.1.min.js:2
fire @ jquery-3.3.1.min.js:2
u @ jquery-3.3.1.min.js:2
fireWith @ jquery-3.3.1.min.js:2
ready @ jquery-3.3.1.min.js:2
_ @ jquery-3.3.1.min.js:2

下面我也上传脚本:

               $.ajax({url:'load_baea.php',
                    success:function(response){
                        jsnEagles = JSON.parse(response);
                        lyrEagleNests = L.geoJSON(jsnEagles, {pointToLayer:returnEagleMarker, filter:filterEagle}).addTo(mymap);
                        ctlLayers.addOverLay(lyrEagleNests, "Eagle Nests")
                        arEagleIDs.sort(function(a,b){return a-b});
                        $("#txtFindEagle").autocomplete({
                        source:arEagleIDs
                });

这里有一些关于该方法的图片:

你要写addOverlay小写L:

$.ajax({url:'load_baea.php',
                    success:function(response){
                        jsnEagles = JSON.parse(response);
                        lyrEagleNests = L.geoJSON(jsnEagles, {pointToLayer:returnEagleMarker, filter:filterEagle}).addTo(mymap);
                        ctlLayers.addOverlay(lyrEagleNests, "Eagle Nests")
                        arEagleIDs.sort(function(a,b){return a-b});
                        $("#txtFindEagle").autocomplete({
                        source:arEagleIDs
                });