Wicket icon indicating copy to clipboard operation
Wicket copied to clipboard

wkt.read is sensitive to spaces

Open Portur opened this issue 5 years ago • 1 comments

This works wicket.read('{"coordinates": [[[30, 10], [10, 20], [20, 40], [40, 40], [30, 10]]], "type": "Polygon"}');

This does not work wicket.read('{"coordinates" : [[[30, 10], [10, 20], [20, 40], [40, 40], [30, 10]]], "type" : "Polygon"}');

The difference being a space after coordinates in the second example.

Here is a quick fix wicket.read(JSON.stringify(JSON.parse('{"coordinates" : [[[30, 10], [10, 20], [20, 40], [40, 40], [30, 10]]], "type" : "Polygon"}')));

Portur avatar Apr 16 '20 18:04 Portur

@Portur thanks for this report! I look forward to a pull request with a test and fix.

arthur-e avatar Apr 16 '20 18:04 arthur-e