Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
polyline-encoded
Advanced tools
This Leaflet plugin extends the Leaflet API with functions to encode en decode Google maps polyline encoding. It is just a convenient way to use the algorithm from http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/ in Leaflet.
Utility methods | |
---|---|
L.PolylineUtil.encode(latlngs) | Encode an array of L.LatLng objects. |
L.PolylineUtil.decode(encoded) | Decode the string encoded to an array of L.LatLng objects. |
Extensions for L.Polyline | |
L.Polyline.fromEncoded(encoded [, options]) | Construct a L.Polyline from a string, with optional options object. |
L.Polyline.encodePath() | Return an encoded string for the current Polyline. |
Extensions for L.Polygon | |
L.Polygon.fromEncoded(encoded [, options]) | Construct a L.Polygon from a string, with optional options object. |
L.Polygon.encodePath() | Return an encoded string for the current Polygon. |
After loading leaflet.js
, src/Polyline.encoded.js
should be included.
var latlngs = [
new L.LatLng(38.5, -120.5),
new L.LatLng(40.7, -120.95),
new L.LatLng(43.252, -126.453)
];
var polyline = new L.Polyline(latlngs);
//prints "_p~iF~cn~U_ulLn{vA_mqNvxq`@" to the console
console.log(polyline.encodePath());
var encoded = "_p~iF~cn~U_ulLn{vA_mqNvxq`@";
var polyline = L.Polyline.fromEncoded(encoded);
// prints an array of 3 LatLng objects.
console.log(polyline.getLatLngs());
FAQs
Encoding and decoding of Google's polyline encoding format
The npm package polyline-encoded receives a total of 6,500 weekly downloads. As such, polyline-encoded popularity was classified as popular.
We found that polyline-encoded demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.