Improve inertial scrolling
Improve inertial scrolling

[This post](http://stackoverflow.com/a/3628949/362702) claims that in Apple's kinetic scrolling, "The velocity of the touch is measured at the exact moment that the finger is lifted."

I tried both this "final velocity" approach and the "max velocity" approach proposed in #2987. Both allow a stronger "fling" than the current "average velocity" approach, but "max velocity" can feel wrong if you slow down at the end of your swipe.

But because the "final velocity" approach uses just one data point it can be unstable, occasionally giving a too-large velocity from a small time delta.

Best is to stabilize that by averaging a few data points, so we're back to "average velocity" but using a shorter time period. Averaging over 50 ms instead of 100 ms gives good results, usually 4 data points on both my iPhone 4s and Chrome on my Windows laptop.

Another reason the current code has a weak fling is that the velocity was being calculated incorrectly. Because `delay` was added to the time delta, time was computed from n+1 points but distance from n points.

I also changed the default value of `inertiaThreshold` (intended to prevent unwanted additional movement if you stop dragging and then lift your finger) to `Infinity`, for two reasons:

1) A fling gesture often failed on my iPhone because the measured `delay` was higher than `inertiaThreshold` (current default 32), sometimes by hundreds of ms.
2) With the updated velocity code I don't see unwanted additional movement when I stop dragging and then lift my finger.

There is a remaining issue (with both the original and updated code). If you fling the map and try to fling it again before it stops moving, no drag events are generated for the second fling so it has no effect. I don't see this problem with e.g. Google or Apple maps. Entered as #3062.

Fixes #2987

alex2wong/Leaflet,brah/Leaflet,nikhildhamsaniya/Leaflet,codeator/Leaflet,twoubt/Leaflet,davojta/Leaflet,geoloep/Leaflet,jasonoverland/Leaflet,nathancahill/Leaflet,Andrey-Pavlov/Leaflet,snkashis/Leaflet,starsolaris/Leaflet,brah/Leaflet,stefanocudini/Leaflet,jblarsen/Leaflet,wrrnwng/Leaflet,javimolla/Leaflet,MuellerMatthew/Leaflet,fredericksilva/Leaflet,klaftertief/Leaflet,jmutua2015/Leaflet,CapeSepias/Leaflet,CorainChicago/Leaflet,mourner/Leaflet,jblarsen/Leaflet,thalesfsp/Leaflet,scaddenp/Leaflet,beni55/Leaflet,wpf500/Leaflet,Neorth/Leaflet,akrzyzanowskino/TeamSE,grahamthompson/Leaflet,jmutua2015/Leaflet,psicomante/Leaflet,litnerdy/Leaflet,mbrukman/Leaflet,snkashis/Leaflet,tsantacruz/RotationalMarker,Ubisense/Leaflet,cartant/Leaflet,fab1an/Leaflet,DrillingInfo/Leaflet,webmechanicx/Leaflet,klaftertief/Leaflet,pzdz/Leaflet,Fil/Leaflet,akauppi/Leaflet,2gis/Leaflet,brah/Leaflet,huangsong/Leaflet,AndBicScadMedia/Leaflet,2gis/Leaflet,bolshoibooze/Leaflet,fab1an/Leaflet,Jakobud/Leaflet,olafurr/Leaflet,waeltken/Leaflet,tbassett44/Leaflet,w8r/Leaflet,klaftertief/Leaflet,msokk/Leaflet,elkingtonmcb/Leaflet,kumy/Leaflet,davidlukerice/Leaflet,wpf500/Leaflet,eriksjaastad/Leaflet,jblarsen/Leaflet,RyanHickman/Leaflet,starsolaris/Leaflet,litnerdy/Leaflet,taraszerebecki/Leaflet,Fil/Leaflet,Neorth/Leaflet,Ossehoht/Leaflet,iZucken/Leaflet,Ubisense/Leaflet,wrrnwng/Leaflet,AndBicScadMedia/Leaflet,cmulders/Leaflet,iamjonbradley/Leaflet,rlugojr/Leaflet,alex2wong/Leaflet,tsantacruz/RotationalMarker,CapeSepias/Leaflet,pzdz/Leaflet,Trufi/Leaflet,iZucken/Leaflet,iamjonbradley/Leaflet,huangsong/Leaflet,caiiiycuk/Leaflet,frogcat/Leaflet,sambernet/Leaflet,andrewmartini/Leaflet,starsolaris/Leaflet,litnerdy/Leaflet,dhootha/Leaflet,kjell/Leaflet,bolshoibooze/Leaflet,elfalem/Leaflet,thalesfsp/Leaflet,AP-whitehat/Leaflet,juliensoret/Leaflet,mediasuitenz/Leaflet,frogcat/Leaflet,lee101/Leaflet,huangsong/Leaflet,northerneyes/Leaflet,CorainChicago/Leaflet,beni55/Leaflet,yohanboniface/Leaflet,psicomante/Leaflet,scaddenp/Leaflet,msiadak/Leaflet,Jakobud/Leaflet,cmulders/Leaflet,bbecquet/Leaflet,kumy/Leaflet,fillerwriter/Leaflet,Trufi/Leaflet,devjoseluis/Leaflet,akrzyzanowskino/TeamSE,DrillingInfo/Leaflet,kumy/Leaflet,fredericksilva/Leaflet,akrzyzanowskino/TeamSE,mstahv/Leaflet,grahamthompson/Leaflet,caiiiycuk/Leaflet,Ossehoht/Leaflet,RLRR/Leaflet,rlugojr/Leaflet,RLRR/Leaflet,lee101/Leaflet,taraszerebecki/Leaflet,mbrukman/Leaflet,msokk/Leaflet,msiadak/Leaflet,bbecquet/Leaflet,tomnod/Leaflet,nycitt/Leaflet,elkingtonmcb/Leaflet,RobertoMalatesta/Leaflet,stefanocudini/Leaflet,mourner/Leaflet,Leaflet/Leaflet,CorainChicago/Leaflet,alex2wong/Leaflet,mourner/Leaflet,billybonz1/Leaflet,jmutua2015/Leaflet,olafurr/Leaflet,dhootha/Leaflet,wancharle/Leaflet,davidlukerice/Leaflet,Ossehoht/Leaflet,Jakobud/Leaflet,beni55/Leaflet,mediasuitenz/Leaflet,cmulders/Leaflet,nycitt/Leaflet,msiadak/Leaflet,CapeSepias/Leaflet,grahamthompson/Leaflet,twoubt/Leaflet,MuellerMatthew/Leaflet,taraszerebecki/Leaflet,iOffice/Leaflet,sellonen/Leaflet,RobertoMalatesta/Leaflet,mstahv/Leaflet,billybonz1/Leaflet,wrrnwng/Leaflet,rlugojr/Leaflet,Trufi/Leaflet,nikhildhamsaniya/Leaflet,tomnod/Leaflet,nikhildhamsaniya/Leaflet,pakro/Leaflet,Leaflet/Leaflet,codeator/Leaflet,hyperknot/Leaflet,iamjonbradley/Leaflet,bbecquet/Leaflet,tsantacruz/RotationalMarker,Leaflet/Leaflet,pakro/Leaflet,dhootha/Leaflet,wancharle/Leaflet,Fil/Leaflet,andrewmartini/Leaflet,snkashis/Leaflet,cartant/Leaflet,akauppi/Leaflet,RLRR/Leaflet,w8r/Leaflet,devjoseluis/Leaflet,davidlukerice/Leaflet,jasonoverland/Leaflet,stefanocudini/Leaflet,webmechanicx/Leaflet,sisou/Leaflet,andrewmartini/Leaflet,sambernet/Leaflet,RyanHickman/Leaflet,nvoron23/Leaflet,Srikanth4/Leaflet,bolshoibooze/Leaflet,prashen/Leaflet,fab1an/Leaflet,geoloep/Leaflet,elkingtonmcb/Leaflet,fredericksilva/Leaflet,yohanboniface/Leaflet,mbrukman/Leaflet,cartant/Leaflet,mediasuitenz/Leaflet,msokk/Leaflet,iOffice/Leaflet,2gis/Leaflet,davojta/Leaflet,w8r/Leaflet,wancharle/Leaflet,waeltken/Leaflet,MuellerMatthew/Leaflet,javimolla/Leaflet,elfalem/Leaflet,nathancahill/Leaflet,Srikanth4/Leaflet,Neorth/Leaflet,tormi/Leaflet,AndBicScadMedia/Leaflet,tbassett44/Leaflet,prashen/Leaflet,pakro/Leaflet,tormi/Leaflet,yohanboniface/Leaflet,Andrey-Pavlov/Leaflet,codeator/Leaflet,northerneyes/Leaflet,nvoron23/Leaflet,waeltken/Leaflet,Ubisense/Leaflet,scaddenp/Leaflet,iOffice/Leaflet,sambernet/Leaflet,tbassett44/Leaflet,hyperknot/Leaflet,thalesfsp/Leaflet,sisou/Leaflet,jasonoverland/Leaflet,sellonen/Leaflet,eriksjaastad/Leaflet,juliensoret/Leaflet,kjell/Leaflet,wpf500/Leaflet,AP-whitehat/Leaflet,devjoseluis/Leaflet,mstahv/Leaflet,webmechanicx/Leaflet,iZucken/Leaflet,fillerwriter/Leaflet,geoloep/Leaflet,akauppi/Leaflet,nycitt/Leaflet,davojta/Leaflet,sellonen/Leaflet,billybonz1/Leaflet,RyanHickman/Leaflet,frogcat/Leaflet,RobertoMalatesta/Leaflet,prashen/Leaflet,AP-whitehat/Leaflet,tomnod/Leaflet,Andrey-Pavlov/Leaflet,hyperknot/Leaflet,olafurr/Leaflet,caiiiycuk/Leaflet,tormi/Leaflet,lee101/Leaflet,elfalem/Leaflet,nathancahill/Leaflet,pzdz/Leaflet,javimolla/Leaflet,sisou/Leaflet,eriksjaastad/Leaflet,twoubt/Leaflet,fillerwriter/Leaflet,Srikanth4/Leaflet,psicomante/Leaflet