9

According to LeafLet documentation PolyLine has a "smoothFactor" parameter : http://leafletjs.com/reference.html#polyline which allows polyline simplification to improve performance. Does anyone know what is the range (e.g. min and max values) and if you noticed a performance improvement using it? I tried different values like 0.1, 1, 5, 10, 100, and did not notice a change in zoom/panning performance at all.

eagle2
  • 91
  • 1
  • 3

2 Answers2

6

Here is a demo: "example of leaflets built-in Simplification - Polyline_smoothFactor"

nauti
  • 1,396
  • 3
  • 16
  • 37
3

The default value is 1. Larger numbers will improve performance and smooth polygon shapes. In my experience I ran about 10,000 shapes using smoothFactor=3. The performance improvement was barely noticeable (1/4 of a second faster loading time) but the shapes (polygons) were way too simplistic, turning almost every shape into triangles and squares.

elmaroto10
  • 516
  • 4
  • 12