Fixed bugs on polyline editing regarding edge cases
Fixed bugs on polyline editing regarding edge cases

This commit fixes couple bugs. One of them is polylines (or polygons)
can be  reduced to a single point by clicking on markers to remove
them. Second, if an edge point is clicked for a polyline (not
applicable to polygons since they are a circular linked list) code
produces a js error since previous or next might not be present.

elkingtonmcb/Leaflet,jmutua2015/Leaflet,Neorth/Leaflet,w8r/Leaflet,lancevalour/leaflet-rails,iamjonbradley/Leaflet,wrrnwng/Leaflet,iZucken/Leaflet,bolshoibooze/Leaflet,tbassett44/Leaflet,akrzyzanowskino/TeamSE,psicomante/Leaflet,yohanboniface/Leaflet,prashen/Leaflet,AP-whitehat/Leaflet,2gis/Leaflet,lizardtechblog/Leaflet,gabrielpconceicao/frontend-asset-leaflet,akrzyzanowskino/TeamSE,akauppi/Leaflet,fredericksilva/Leaflet,grahamthompson/Leaflet,sisou/Leaflet,olafurr/Leaflet,CorainChicago/Leaflet,Leaflet/Leaflet,frogcat/Leaflet,bbecquet/Leaflet,pzdz/Leaflet,devjoseluis/Leaflet,Ossehoht/Leaflet,jasonoverland/Leaflet,msokk/Leaflet,che603000/Leaflet,wpf500/Leaflet,RyanHickman/Leaflet,twoubt/Leaflet,nathancahill/Leaflet,srdavis/leaflet-template,iZucken/Leaflet,caiiiycuk/Leaflet,geoloep/Leaflet,jmutua2015/Leaflet,jblarsen/Leaflet,nkovacs/Leaflet,bolshoibooze/Leaflet,bbecquet/Leaflet,nkovacs/Leaflet,bolshoibooze/Leaflet,grahamthompson/Leaflet,webmechanicx/Leaflet,akauppi/Leaflet,sellonen/Leaflet,tomnod/Leaflet,nathancahill/Leaflet,caiiiycuk/Leaflet,MuellerMatthew/Leaflet,alex2wong/Leaflet,cmulders/Leaflet,MuellerMatthew/Leaflet,jasonoverland/Leaflet,sambernet/Leaflet,frogcat/Leaflet,patrickarlt/Leaflet,msiadak/Leaflet,devjoseluis/Leaflet,Trufi/Leaflet,elfalem/Leaflet,Jakobud/Leaflet,RLRR/Leaflet,mediasuitenz/Leaflet,Jakobud/Leaflet,iamjonbradley/Leaflet,nikhildhamsaniya/Leaflet,devjoseluis/Leaflet,davojta/Leaflet,cartant/Leaflet,mbrukman/Leaflet,starsolaris/Leaflet,kjell/Leaflet,davidjb/Leaflet,tyrasd/Leaflet,mediasuitenz/Leaflet,brunocasanova/frontend-asset-leaflet,pzdz/Leaflet,olafurr/Leaflet,pzdz/Leaflet,RLRR/Leaflet,javimolla/Leaflet,sambernet/Leaflet,Ubisense/Leaflet,sisou/Leaflet,akrzyzanowskino/TeamSE,nycitt/Leaflet,Ubisense/Leaflet,lee101/Leaflet,billybonz1/Leaflet,litnerdy/Leaflet,tsantacruz/RotationalMarker,RyanHickman/Leaflet,twoubt/Leaflet,starsolaris/Leaflet,AndBicScadMedia/Leaflet,andrewmartini/Leaflet,jblarsen/Leaflet,Srikanth4/Leaflet,mbrukman/Leaflet,taraszerebecki/Leaflet,eriksjaastad/Leaflet,Srikanth4/Leaflet,2gis/Leaflet,litnerdy/Leaflet,klaftertief/Leaflet,CorainChicago/Leaflet,mourner/Leaflet,geoloep/Leaflet,geoloep/Leaflet,bbecquet/Leaflet,kjell/Leaflet,huangsong/Leaflet,starsolaris/Leaflet,mediasuitenz/Leaflet,elfalem/Leaflet,msokk/Leaflet,iZucken/Leaflet,rlugojr/Leaflet,thalesfsp/Leaflet,rlugojr/Leaflet,jasonoverland/Leaflet,AndBicScadMedia/Leaflet,cmulders/Leaflet,fab1an/Leaflet,javimolla/Leaflet,Neorth/Leaflet,davojta/Leaflet,brunocasanova/frontend-asset-leaflet,Fil/Leaflet,jmutua2015/Leaflet,w8r/Leaflet,scaddenp/Leaflet,kumy/Leaflet,billybonz1/Leaflet,DrillingInfo/Leaflet,Trufi/Leaflet,pakro/Leaflet,Srikanth4/Leaflet,nycitt/Leaflet,juliensoret/Leaflet,davidlukerice/Leaflet,Andrey-Pavlov/Leaflet,perliedman/Leaflet,mstahv/Leaflet,tbassett44/Leaflet,fredericksilva/Leaflet,fillerwriter/Leaflet,codeator/Leaflet,stefanocudini/Leaflet,nvoron23/Leaflet,codeator/Leaflet,huangsong/Leaflet,tsantacruz/RotationalMarker,snkashis/Leaflet,dhootha/Leaflet,andrewmartini/Leaflet,Ubisense/Leaflet,gabrielpconceicao/frontend-asset-leaflet,scaddenp/Leaflet,DrillingInfo/Leaflet,jblarsen/Leaflet,msokk/Leaflet,waeltken/Leaflet,Leaflet/Leaflet,yohanboniface/Leaflet,nikhildhamsaniya/Leaflet,AndBicScadMedia/Leaflet,elkingtonmcb/Leaflet,tormi/Leaflet,davidlukerice/Leaflet,psicomante/Leaflet,frafra/ProntoSoccorsoLiguria,moklick/Leaflet,CorainChicago/Leaflet,codeator/Leaflet,frogcat/Leaflet,Fil/Leaflet,nycitt/Leaflet,dhootha/Leaflet,lee101/Leaflet,CapeSepias/Leaflet,hyperknot/Leaflet,alex2wong/Leaflet,tomnod/Leaflet,Mark-Wood/Leaflet,ismyrnow/Leaflet,huangsong/Leaflet,juliensoret/Leaflet,Mark-Wood/Leaflet,psicomante/Leaflet,twoubt/Leaflet,wrrnwng/Leaflet,mourner/Leaflet,Jakobud/Leaflet,kumy/Leaflet,Trufi/Leaflet,cartant/Leaflet,RobertoMalatesta/Leaflet,sambernet/Leaflet,litnerdy/Leaflet,mbrukman/Leaflet,mstahv/Leaflet,azimux/Leaflet,fillerwriter/Leaflet,axyjo/leaflet-rails,olafurr/Leaflet,sisou/Leaflet,webmechanicx/Leaflet,davojta/Leaflet,akauppi/Leaflet,tormi/Leaflet,tbassett44/Leaflet,Andrey-Pavlov/Leaflet,stefanocudini/Leaflet,frafra/ProntoSoccorsoLiguria,RLRR/Leaflet,prashen/Leaflet,wancharle/Leaflet,AP-whitehat/Leaflet,rlugojr/Leaflet,beni55/Leaflet,caiiiycuk/Leaflet,hyperknot/Leaflet,prashen/Leaflet,nvoron23/Leaflet,CapeSepias/Leaflet,gabrielpconceicao/frontend-asset-leaflet,scaddenp/Leaflet,w8r/Leaflet,fillerwriter/Leaflet,sellonen/Leaflet,Neorth/Leaflet,thalesfsp/Leaflet,brah/Leaflet,elfalem/Leaflet,Leaflet/Leaflet,grahamthompson/Leaflet,beni55/Leaflet,CapeSepias/Leaflet,beni55/Leaflet,klaftertief/Leaflet,tsantacruz/RotationalMarker,wpf500/Leaflet,cartant/Leaflet,nathancahill/Leaflet,msiadak/Leaflet,Ossehoht/Leaflet,thalesfsp/Leaflet,brah/Leaflet,stefanocudini/Leaflet,davidlukerice/Leaflet,Andrey-Pavlov/Leaflet,waeltken/Leaflet,RyanHickman/Leaflet,northerneyes/Leaflet,AP-whitehat/Leaflet,cmulders/Leaflet,wancharle/Leaflet,alex2wong/Leaflet,iOffice/Leaflet,Fil/Leaflet,patrickarlt/Leaflet,danzel/Leaflet,RobertoMalatesta/Leaflet,taraszerebecki/Leaflet,billybonz1/Leaflet,andrewmartini/Leaflet,tomnod/Leaflet,wancharle/Leaflet,2gis/Leaflet,eriksjaastad/Leaflet,pakro/Leaflet,nikhildhamsaniya/Leaflet,iOffice/Leaflet,webmechanicx/Leaflet,fredericksilva/Leaflet,MuellerMatthew/Leaflet,klaftertief/Leaflet,yohanboniface/Leaflet,fab1an/Leaflet,fab1an/Leaflet,wrrnwng/Leaflet,pakro/Leaflet,mstahv/Leaflet,brunocasanova/frontend-asset-leaflet,taraszerebecki/Leaflet,wpf500/Leaflet,javimolla/Leaflet,lee101/Leaflet,waeltken/Leaflet,northerneyes/Leaflet,sellonen/Leaflet,iamjonbradley/Leaflet,snkashis/Leaflet,tormi/Leaflet,mourner/Leaflet,hyperknot/Leaflet,snkashis/Leaflet,RobertoMalatesta/Leaflet,che603000/Leaflet,kumy/Leaflet,iOffice/Leaflet,brah/Leaflet,msiadak/Leaflet,eriksjaastad/Leaflet,CloudMade/Leaflet,jaropolk2/Leaflet,Ossehoht/Leaflet,dhootha/Leaflet,elkingtonmcb/Leaflet