1

I register a mouse up event with an open layers map and the event gets fired when I do a mouse up, but the map keeps moving with the mouse. For some reason registering this event caused the map to keep panning after I do a mouse up.

Here is the function:

var refreshCities = function(evt) { 
                       console.log("refreshing cities list"); 
                    };

Here is the event registration:

CitiesDisplay.events.register("mouseup", null, refreshCities);

After I saw this problem I tested the other types of events ("mousedown", "click", ...) but they don't have the same problem. I haven't found anything else online in solving this problem. Thank you for any help.

4

1 回答 1

0

我解决了这个问题。我需要注册这种类型的事件:“moveend”。以下是注册中将更改的内容:

CitiesDisplay.events.register("moveend", null, refreshCities);

现在一切似乎都正常工作。这个链接对我帮助最大:http ://dev.openlayers.org/docs/files/OpenLayers/Layer-js.html#OpenLayers.Layer.events

于 2014-01-09T22:58:07.863 回答