Future of Leaflet

Future of Leaflet

What's in store for Leaflet in future? What's new in the next release? A talk by the creator of the library.

6d07e6d95a43357254698ce9723350e6?s=128

Vladimir Agafonkin

September 09, 2014
Tweet

Transcript

  1. Future of Vladimir Agafonkin 09.09.14

  2. None
  3. None
  4. None
  5. next version: 1.0

  6. since the first release 3.5 years ago the biggest update

  7. sometime 
 next month hopefully

  8. born against ! all odds

  9. no way you could do that

  10. You’re wasting time

  11. build an OPENLAYERS wrapper

  12. born as a protest against bloat, clutter and complexity

  13. top priorities: simplicity performance

  14. 1.0

  15. evolution not revolution

  16. animations & usability

  17. fractional zoom: map.setZoom(12.67)

  18. ballistic panning

  19. better tile loading (less flickering)

  20. better panning inertia

  21. fixed gaps during zoom on Safari for Mac

  22. smoother zoom on iOS Safari

  23. popup fade out animation

  24. vectors 2.0

  25. Use SVG & Canvas on the same map

  26. put vectors in custom panes

  27. huge SVG layers performance boost: adding ~3x faster, takes ~2.5

    less memory
  28. huge Canvas layers performance boost: partial redraws, faster mouse events

  29. Canvas layers now retina-enabled

  30. solved all problems with MultiPolygon & MultiPolyline: no longer inherited

    from FeatureGroup
  31. Polyline & Polygon Centroids

  32. TileLayer

  33. TileLayer split into GridLayer & TileLayer

  34. GridLayer is the new TileLayer.Canvas

  35. var tiles = L.tileLayer.canvas(); ! tiles.drawTile = function(canvas, tile, zoom)

    { var ctx = canvas.getContext('2d'); … // draw something }; old way
  36. var tiles = L.gridLayer(); ! tiles.createTile = function(coords) { var

    tile = document.createElement('canvas'), ctx = canvas.getContext('2d'); … // do anything }; new way
  37. Projections

  38. No hardcoded projection hacks, all centralized in CRS

  39. CRS defines everything: how tiles wrap, what are the bounds,

    distance measure, etc.
  40. Proj4Leaflet FTW Thanks, Per!

  41. Layers

  42. all layers now inherited from Layer class less code, more

    consistency, good for plugins
  43. Custom Pane Management

  44. map.createPane(‘foobar’); ! L.tileLayer(url, {pane: ‘foobar’});

  45. other performance improvements

  46. LatLng construction 8x faster

  47. faster Layer construction

  48. huge FeatureGroup performance boost due to better event propagation mechanism

  49. much better memory footprint for DOM & Leaflet events

  50. obj.off(event, listener) 2x faster

  51. …and many other bugfixes and improvements

  52. best of all? it got smaller!

  53. Uncompressed: 208.75 KB (-6798 bytes) Compressed: 116.91 KB (-5696 bytes)

    Gzipped: 31.71 KB (-1062 bytes) stable vs master
  54. so why does it take so long?

  55. None
  56. None
  57. Leaflet 0.7.3 is so good

  58. Mapbox GL JS

  59. None
  60. incredibly complex technology and tons of code

  61. to experiment, blow minds and create amazing map interactions

  62. Leaflet will remain the go-to mapping library: dead simple, easy

    to use, works on all platforms, 
 tons of plugins, huge community, everyone knows it
  63. Leaflet & Mapbox GL benefit from each other

  64. None
  65. thank you