Javascript OpenLayers before zoom event listener

前端 未结 5 1933
醉酒成梦
醉酒成梦 2021-02-09 03:46

I am trying to set up OpenLayers to not display the vector layer just before a zoom starts and make it reappear after a zoom ends. I have the zoom ends part already established

5条回答
  •  抹茶落季
    2021-02-09 03:48

    "movestart" handles "zoomstart". To detect if the zoomstart, try:

     map.events.register("movestart",map, function(e) {
            if(e.zoomChanged)
            {
            //zoom start code here
            }
    
        });
    

提交回复
热议问题