Permalink
Browse files

Merge commit '9bc03463203b3148058ee12db009c28ae431d865'

  • Loading branch information...
TomMD committed Nov 30, 2011
2 parents fcab8b7 + 9bc0346 commit 77e191bd138075b74b0e8336b175aac502782882
Showing with 7 additions and 6 deletions.
  1. +6 −5 Data/GPS/Gps2HtmlReport/DrawOsm.hs
  2. +1 −1 gps2htmlReport.cabal
@@ -4,7 +4,10 @@ module Data.GPS.Gps2HtmlReport.DrawOsm where
import Prelude
import Data.GPS
import Graphics.Transform.Magick.Types hiding (Image, minimum, maximum)
-import Network.Curl.Download
+import Network.HTTP.Enumerator
+import qualified Data.ByteString as B
+import qualified Data.ByteString.Lazy as L
+import Control.Monad
import Data.Bits
import Graphics.GD
import Data.Maybe
@@ -111,10 +114,8 @@ rectangle x' y' = Rectangle {width=256, height=256, x = x'*256, y = y'*256}
-- | Takes the URL of a given OSM tile and uses curl to download it
downloadFile :: String -> IO Image
downloadFile url = do
- response <- openURI url
- case response of
- Left err -> error err
- Right img -> loadPngByteString img
+ response <- liftM (B.concat . L.toChunks) (simpleHttp url)
+ loadPngByteString response
-- | Takes the boundaries of the OSM tiles covering the
-- the 'Trail', uses 'placeTile' to download the tile
View
@@ -19,5 +19,5 @@ Executable gps2htmlReport
Main-is: Data/GPS/Gps2HtmlReport/Main.hs
library
- Build-Depends: base >= 4 && < 5, html, gps >= 0.8.1, time, cairo, Chart, random, data-accessor, colour, xsd, filepath, directory, process, gd, bytestring, download-curl, hsmagick, cmdargs
+ Build-Depends: base >= 4 && < 5, html, gps >= 0.8.4, time, cairo, Chart, random, data-accessor, colour, xsd >= 0.3.5, filepath, directory, process, gd, bytestring, http-enumerator, hsmagick, cmdargs
Exposed-Modules: Data.GPS.Gps2HtmlReport.HTMLGenerator, Data.GPS.Gps2HtmlReport.JourneyStats, Data.GPS.Gps2HtmlReport.JourneyCharts, Data.GPS.Gps2HtmlReport.DrawOsm

0 comments on commit 77e191b

Please sign in to comment.