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

Commit

Permalink
Merge pull request #6 from cryogenian/converter-fix
Browse files Browse the repository at this point in the history
converter fix
  • Loading branch information
cryogenian authored Oct 17, 2017
2 parents 3d75ee0 + a4f468d commit 1ffe9f1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Leaflet/Core/Converter.purs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import Prelude
import Color (Color, toHexString)

import Data.Foldable (intercalate)
import Data.String.Regex as RX
import Data.String.Regex.Flags as RXF
import Data.String.Regex.Unsafe as URX
import Data.URI (URIRef)
import Data.URI.URIRef as URIRef

import Leaflet.Core.Types as T
import Leaflet.Util ((×), (∘))

Expand All @@ -23,9 +25,17 @@ type ConvertDict =
, printFillRule T.FillRule String
}



converter ConvertDict
converter =
{ printURI: URIRef.print
{ printURI: \uri →
let
oRx = URX.unsafeRegex "%7B" RXF.global
cRx = URX.unsafeRegex "%7D" RXF.global
encodedString = URIRef.print uri
replaced = RX.replace oRx "{" $ RX.replace cRx "}" encodedString
in replaced
, mkPoint: \(a × b) → [a, b]
, printColor: toHexString
, convertLatLng: \{lat, lng} → [lat, lng]
Expand Down

0 comments on commit 1ffe9f1

Please sign in to comment.