小编man*_*ser的帖子

TypeError:'Cursor'类型的对象没有len()

我收到此错误:

TypeError:'Cursor'类型的对象没有len()

当我尝试执行时:

reply = db['test'].find({"date":{"$gt":date_query}} ,{"date":1,"route_id":1,"loc":1,"_id":0})

length = len(reply)
Run Code Online (Sandbox Code Playgroud)

python cursor mongodb pymongo

15
推荐指数
2
解决办法
1万
查看次数

在悬停时更改标记的z索引以使其可见

我正在尝试使我当前正在盘旋的标记具有比其他标记更大的z-index,因此即使它被其他标记隐藏,当我将鼠标悬停在其上时它也将获得完全可见性.

点击任何标记我想做同样的事情.

  google.maps.event.addListener(this.marker, 'mouseover', function() {
            this.old_ZIndex = this.getZIndex(); //trying to get the current z- index
            console.log(this.old_ZIndex); //this is undefined: why?
            this.setZIndex(this.old_ZIndex + 100); //setting a higher z-index than all other  markers
            console.log("the old z index is ",this.old_ZIndex);
        });
Run Code Online (Sandbox Code Playgroud)

但是有了这个,我将无限增加z索引..还有一些其他的方式,当我悬停或点击任何其他标记时,我可以恢复..

或者有更好的方法来实现它?

google-maps google-maps-api-3

6
推荐指数
1
解决办法
8551
查看次数