谷歌地图 IE7 标记 setIcon

发布于 2024-12-24 17:57:55 字数 194 浏览 4 评论 0原文

我对 ie7 和标记谷歌地图的 setIcon 方法有问题。

当用于单个项目时 marker.setIcon(image) 工作正常,但是当我使用数组时 marker [i].setIcon(image) 不起作用,错误IE的对象就是有那个方法的。

有谁知道原因吗?

谢谢。

I have a problem with ie7 and method setIcon of marker google maps.

when used for a single item marker.setIcon(image) works OK, but when I use an array marker [i].setIcon(image) does not work, the error of IE is the object has that method.

Anyone know the cause?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

海拔太高太耀眼 2024-12-31 17:57:55

问题已解决,我不知道,因为但即在数组中添加名为“IndexOf”的元素...

解决方案:

       for(var ii in markers) //Cambio de color - todos a negro
        { 
            if(ii == 'indexOf')
                continue;
             markers[ii].setIcon(image);
        } 

bamnet-用于在数组中引入标记:

Google Maps JS API v3 - 简单的多标记示例

谢谢。

the problem is solved, i don't know because but ie add element with name "IndexOf" in the array...

The solution:

       for(var ii in markers) //Cambio de color - todos a negro
        { 
            if(ii == 'indexOf')
                continue;
             markers[ii].setIcon(image);
        } 

bamnet- For introduce markers in array:

Google Maps JS API v3 - Simple Multiple Marker Example

Thanks.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文