leaflet中地图交互事件(map interaction events)的触发顺序


地图交互事件(map interaction events)有以下类型:
"preclick", "click", "dblclick", "mouseover", "mousemove", "mousedown", "mouseup", "mouseout", "keypress", "contextmenu"

//dblclick触发过程,click后又触发了一次mousemove
mouseover->mousemove->mousedown->mouseup->preclick->click->mousemove
                    ->mousedown->mouseup->preclick->click->dblclick->mousemove->mouseout

//contextmenu触发过程,没有preclick
mouseover->mousemove->mousedown->mouseup->contextmenu->mousemove->mouseout

//keypress触发过程,map需要获取焦点(need to be focused),点击map可获取焦点

测试用例:http://jsrun.net/xpqKp

转载自:https://blog.csdn.net/u014711094/article/details/78897025

You may also like...