Google地图V3中的奇怪游标行为 [英] Strange Cursor Behavior in Google Maps V3

查看:216
本文介绍了Google地图V3中的奇怪游标行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在从远程服务器请求信息时,尝试将Google地图中的光标更改为等待光标。这是来自国际服务器的天气信息,有时可能需要很长时间才能返回,所以我想让用户知道发生了什么。

I am trying to change my cursor in google maps to the "wait" cursor while I request information from remote servers. This is weather information from international servers and it can sometimes take a long time to return, so I want the user to know that something is going on.

用户点击标记或边界框,然后我进行以下调用获取数据:

A user clicks on either a marker or a bounding box and then I make the following call to get the data:

map.setOptions({draggableCursor: "wait"});
$.ajax({
    type:"GET",
    dateType:"html",
    url:url,
    cache:false,
    success:function(response){openInfoWindow(response, 1);},
    error:function() 
        {
        map.setOptions({draggableCursor: null});
        displayMessage("badGet",0);
        }
});;

function openInfoWindow(request, ignoreStatus)
{
map.setOptions({draggableCursor: null});
infoWindow = new InfoBox({maxWidth: 0, position: center, disableAutoPan: true});
}

我在openInfoWindow中做的第一件事是map.setOptions({draggableCursor: null}),所以光标应该回到正常的游标。之后我打开一个带有结果的信息窗口。

The first thing that I do in openInfoWindow is map.setOptions({draggableCursor: null}), so the cursor should go back to a normal cursor. After that I open an infoWindow with the results.

这里是我觉得很奇怪的:

Here's what I find to be very strange:

1 )如果我将光标停留在标记上或边界框内,它不会切换到等待光标。如果我将它移出标记或移出边界框,它的功能如预期。

1) If I leave the cursor over the marker or within the bounding box, it never switches to the wait cursor. If I move it off of the marker or outside of the bounding box, it functions as expected.

2)如果光标位于infoWindow出现的位置,光标切换到等待光标,但不会切换回正常光标,直到我将光标移动到infoWindow之外。

2) If the cursor is positioned over the location where the infoWindow appears, the cursor switches to the wait cursor, but doesn't switch back to the normal cursor until I move the cursor outside of the infoWindow.

3)当光标不在对于点击的对象或infoWindow的位置,它不会从等待更改为正常,直到光标移动。

3) When the cursor is not over the clicked object or the location of the infoWindow, it doesn't change from "wait" to normal until the cursor is moved.

我怀疑有一些基本的我缺少关于如何/当光标更新时。

I suspect that there's something basic that I'm missing with regards to how/when the cursor gets updated. Any enlightenment would be appreciated.

请注意,您可以在 http://www.geoffschultz.org/weather_map_2.php ,选择天气图表/ BBC在岸预测和许多其他地方。

Note that you can see this behavior at http://www.geoffschultz.org/weather_map_2.php by selecting Weather Charts/BBC In-shore Forecast and lots of other places.

- Geoff

-- Geoff

推荐答案

我也必须拖曳或点选,让光标在

I also had to drag or click to get the cursor to change back after

map.setOptions({draggableCursor:null});

map.setOptions({draggableCursor:''});

这篇关于Google地图V3中的奇怪游标行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆