Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 1ffe9f1

Browse files
authored
Merge pull request #6 from cryogenian/converter-fix
converter fix
2 parents 3d75ee0 + a4f468d commit 1ffe9f1

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/Leaflet/Core/Converter.purs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ import Prelude
55
import Color (Color, toHexString)
66

77
import Data.Foldable (intercalate)
8+
import Data.String.Regex as RX
9+
import Data.String.Regex.Flags as RXF
10+
import Data.String.Regex.Unsafe as URX
811
import Data.URI (URIRef)
912
import Data.URI.URIRef as URIRef
10-
1113
import Leaflet.Core.Types as T
1214
import Leaflet.Util ((×), (∘))
1315

@@ -23,9 +25,17 @@ type ConvertDict =
2325
, printFillRule T.FillRule String
2426
}
2527

28+
29+
2630
converter ConvertDict
2731
converter =
28-
{ printURI: URIRef.print
32+
{ printURI: \uri →
33+
let
34+
oRx = URX.unsafeRegex "%7B" RXF.global
35+
cRx = URX.unsafeRegex "%7D" RXF.global
36+
encodedString = URIRef.print uri
37+
replaced = RX.replace oRx "{" $ RX.replace cRx "}" encodedString
38+
in replaced
2939
, mkPoint: \(a × b) → [a, b]
3040
, printColor: toHexString
3141
, convertLatLng: \{lat, lng} → [lat, lng]

0 commit comments

Comments
 (0)