You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've realized that the library only has support to encode geojson feature LineString, but neither always a region is converted to a single LineString (sometimes it is a MultilineString).
It would be great if there is also a solution for these cases
The text was updated successfully, but these errors were encountered:
polyline encoding doesn't support MultiLineStrings, and the documentation for the library says it only supports encoding LineStrings from GeoJSON.
So the only thing this library could do is support MultiLineStrings in polyline.fromGeoJSON by returning an array of string encoded polylines. To ensure backwards compatibility for regular LineStrings it would just return the single string not an array of length 1.
That said if you're using fromGeoJSON you could just inspect your GeoJSON before hand and if it's a MultiLineString then pull out each LineString and iterate them through to polyline.encode.
in case anyone else comes across this looking for MultiLineString or other GeoJSON type support: geojson-polyline worked as a drop-in replacement in my situation (though it also adds some streaming-related dependencies that I do not prefer).
I've realized that the library only has support to encode geojson feature LineString, but neither always a region is converted to a single LineString (sometimes it is a MultilineString).
It would be great if there is also a solution for these cases
The text was updated successfully, but these errors were encountered: