为什么这不起作用,openlayer,javascipt

时间:2019-06-17 09:36:29

标签: openlayers

我对openlayer和javascipt有一个探查。为什么cayxanh_getsource()不被识别为函数?

function showPopup(evt){
    var view = map.getView();

    var coordinate = evt.coordinate;
    var source =  cay_xanh.getSource();
    var url = source.getGetFeatureInfoUrl(evt.coordinate, 
    view.getResolution(), view.getProjection(), {'INFO_FORMAT': 
    'application/json', 'FEATURE_COUNT': 5});

    if (url) {
    $.ajax({
    url: url,
    type: 'GET',
        dataType: 'json',
        success: function(data) {
        console.log(data);    
         console.log(JSON.stringify(data));
         var json = JSON.parse(JSON.stringify(data));

                      }
                 });
            }//end if(url)
      }//end ifelse

0 个答案:

没有答案