Cannot read properties of undefined (reading ‘createIcon‘) ?

Cannot read properties of undefined (reading ‘createIcon’)

出现这个问题 第一时间百度 百度 真是没啥用 ,谷歌搜索 有篇文章倒是有相同的问题 ?但不能解决我的问题 本以为很难 ,但请教别人的时候 慢慢 就发现了问题所在 ,

  var marker = L.marker([this.site[i].lat, this.site[i].lng], {
              draggable: true,
              icon: mapIcon()
            }).addTo(map);

当icon 赋值是undefined 时 就会报这样的错误吧 !


版权声明:本文为qq_41425267原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。