Merge 1bd11424b9 into d4a5cc6074
This commit is contained in:
commit
600307f240
2 changed files with 3 additions and 6 deletions
|
|
@ -158,10 +158,7 @@ const extractPathsFromQuery = (query, transformer) => {
|
|||
// Iterate through paths, parse and validate them
|
||||
for (const providedPath of providedPaths) {
|
||||
// Logic for pushing coords to path when path includes google polyline
|
||||
if (
|
||||
providedPath.includes('enc:') &&
|
||||
PATH_PATTERN.test(decodeURIComponent(providedPath))
|
||||
) {
|
||||
if (providedPath.includes('enc:') && PATH_PATTERN.test(providedPath)) {
|
||||
// +4 because 'enc:' is 4 characters, everything after 'enc:' is considered to be part of the polyline
|
||||
const encIndex = providedPath.indexOf('enc:') + 4;
|
||||
const coords = polyline
|
||||
|
|
@ -427,7 +424,7 @@ const drawMarkers = async (ctx, markers, z) => {
|
|||
* @param {number} z Map zoom level.
|
||||
*/
|
||||
const drawPath = (ctx, path, query, pathQuery, z) => {
|
||||
const splitPaths = decodeURIComponent(pathQuery).split('|');
|
||||
const splitPaths = pathQuery.split('|');
|
||||
|
||||
if (!path || path.length < 2) {
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ describe('Static endpoints', function () {
|
|||
200,
|
||||
2,
|
||||
/image\/png/,
|
||||
'?path=' + decodeURIComponent('enc:{{biGwvyGoUi@s_A|{@'),
|
||||
'?path=' + encodeURIComponent('enc:{{biGwvyGoUi@s_A|{@'),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue