Unable to get value of the property '2': object is null or undefined

来源:互联网 发布:河北工商学院知乎 编辑:程序博客网 时间:2024/05/16 12:26

        在bingmap开发的过程中调用_bingLayer.clear();会报“Unable to get value of the property '2': object is null or undefined”错误,百思不得其解,后来测试发现,执行如下代码之后再调用clear()方法就会出现这样的问题。

_bingLayer.push(pin2);_bingLayer.push(pin2);

        就是添加了两个同样的pushpin对象,在clear()时就会报错了,如果你的程序报这样的错,检查一下你代码的逻辑吧,不过这也算是bingmap的一个bug吧。

原创粉丝点击