【JavaScript】Json属性提取

var elements = "";                
let properties = e.layer.feature.properties;
for (var item in properties) {
    let name = item;
    let value = properties[name];
    if (window.hideFields.indexOf(name) < 0 && value != null) {
    
        elements = elements + name + ":" + value + "<br>"
    }
}

 

posted @ 2020-10-10 13:53  咸鱼翻身  阅读(342)  评论(0编辑  收藏  举报