Placemark Releases New Polyline Library

Polylines are an efficient way to represent line geometries. You provide a geometry, and out comes a scrambled string of letters and numbers that encodes the geometry in just a few characters. Polylines are helpful when you want to efficiently transfer geometry information between services. The Mapbox Static Images API, for example, can overlay complex geometries from Polylines, which wouldn’t be possible otherwise because the request-URL length is limited.

Placemark has released a new Polyline JavaScript library, allowing developers to encode or decode coordinate arrays and GeoJSON objects. It does pretty much the same as existing Polyline utilities from Mapbox or Google. Still, Placemark’s solution is a modernised implementation that includes TypeScript types and a neat autogenerated documentation site; it supports ESM and UMD imports and standardises longitude-latitude order.