fix: still allow other parameters other than enc:
That way we can still style individual paths Signed-off-by: boldtrn <boldtrn@gmail.com>
This commit is contained in:
parent
eae747a8a4
commit
30f2f7a40f
1 changed files with 3 additions and 2 deletions
|
|
@ -162,8 +162,9 @@ const extractPathsFromQuery = (query, transformer) => {
|
|||
providedPath.includes('enc:') &&
|
||||
PATH_PATTERN.test(decodeURIComponent(providedPath))
|
||||
) {
|
||||
const encodedPaths = providedPath.replace('enc:', '');
|
||||
const coords = polyline.decode(encodedPaths).map(([lat, lng]) => [lng, lat]);
|
||||
// +4 because enc: are 4 characters, everything after enc: is considered to be part of the polyline
|
||||
const encIndex = providedPath.indexOf('enc:') + 4;
|
||||
const coords = polyline.decode(providedPath.substring(encIndex)).map(([lat, lng]) => [lng, lat]);
|
||||
paths.push(coords);
|
||||
} else {
|
||||
// Iterate through paths, parse and validate them
|
||||
|
|
|
|||
Loading…
Reference in a new issue