packages feed

google-static-maps 0.5.0.2 → 0.5.0.3

raw patch · 4 files changed

+37/−37 lines, 4 filesdep ~JuicyPixelsdep ~basedep ~http-clientPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: JuicyPixels, base, http-client, servant, text

API changes (from Hackage documentation)

- Web.Google.Static.Maps: MapStyle :: (Maybe Feature) -> (Maybe Element) -> [MapStyleOp] -> MapStyle
+ Web.Google.Static.Maps: MapStyle :: Maybe Feature -> Maybe Element -> [MapStyleOp] -> MapStyle
- Web.Google.Static.Maps: Markers :: (Maybe MarkerStyle) -> [Location] -> Markers
+ Web.Google.Static.Maps: Markers :: Maybe MarkerStyle -> [Location] -> Markers
- Web.Google.Static.Maps: Path :: (Maybe PathStyle) -> [Location] -> Path
+ Web.Google.Static.Maps: Path :: Maybe PathStyle -> [Location] -> Path
- Web.Google.Static.Maps: data URI :: *
+ Web.Google.Static.Maps: data URI
- Web.Google.Static.Maps: data URIAuth :: *
+ Web.Google.Static.Maps: data URIAuth
- Web.Google.Static.Maps: type GoogleStaticMapsAPI = "staticmap" :> (QueryParam "key" Key :> (QueryParam "center" Center :> (QueryParam "zoom" Zoom :> (QueryParam "size" Size :> (QueryParam "scale" Scale :> (QueryParam "format" Format :> (QueryParams "style" MapStyle :> (QueryParam "maptype" MapType :> (QueryParam "language" Language :> (QueryParam "region" Region :> (QueryParams "markers" Markers :> (QueryParams "path" Path :> (QueryParam "visible" Visible :> (QueryParam "signature" Signature :> Get '[PNG] StaticmapResponse))))))))))))))
+ Web.Google.Static.Maps: type GoogleStaticMapsAPI = "staticmap" :> QueryParam "key" Key :> QueryParam "center" Center :> QueryParam "zoom" Zoom :> QueryParam "size" Size :> QueryParam "scale" Scale :> QueryParam "format" Format :> QueryParams "style" MapStyle :> QueryParam "maptype" MapType :> QueryParam "language" Language :> QueryParam "region" Region :> QueryParams "markers" Markers :> QueryParams "path" Path :> QueryParam "visible" Visible :> QueryParam "signature" Signature :> Get '[PNG] StaticmapResponse

Files

changelog.md view
@@ -1,3 +1,7 @@+# 0.5.0.3
+
+* Update dependencies for GHC 8.6.1
+
 # 0.5.0.2
 
 * Update dependencies for GHC 8.4.3
google-static-maps.cabal view
@@ -1,5 +1,5 @@ name:                google-static-maps
-version:             0.5.0.2
+version:             0.5.0.3
 synopsis:            Bindings to the Google Static Maps API
 description:         The <https://developers.google.com/maps/documentation/static-maps/intro Google Static Maps API>
                      returns a map as an image via an HTTP request. This library
@@ -26,21 +26,21 @@   hs-source-dirs:      src
   exposed-modules:     Web.Google.Static.Maps
                      , Web.Google.Maps.Common
-  build-depends:       base >= 4.7 && < 4.12
+  build-depends:       base >= 4.8 && < 4.13
                      , base64-bytestring >= 0.1.1 && < 1.1
                      , bytestring >= 0.10 && < 0.11
                      , aeson >= 0.7 && < 1.5
                      , bytedump >= 0.9 && < 1.1
                      , cryptonite >= 0.1 && < 0.26
                      , double-conversion >= 0.2 && < 2.1
-                     , http-client >= 0.1 && < 0.6
-                     , JuicyPixels >= 1.0 && < 3.3
+                     , http-client >= 0.2 && < 0.6
+                     , JuicyPixels >= 1.0 && < 3.4
                      , memory >= 0.1 && < 0.15
                      , network-uri >= 2.6 && < 2.7
-                     , servant >= 0.11 && < 0.15
+                     , servant >= 0.14.1 && < 0.15
                      , servant-client >= 0.11 && < 0.15
                      , servant-JuicyPixels >= 0.3 && < 0.4
-                     , text >= 0.1 && < 1.3
+                     , text >= 1.0 && < 1.3
                      , utf8-string >= 0.3 && < 1.1
   default-language:    Haskell2010
 
src/Web/Google/Maps/Common.hs view
@@ -10,7 +10,7 @@ -- Copyright   : (c) Mike Pilgrem 2017
 -- Maintainer  : public@pilgrem.com
 -- Stability   : experimental
--- 
+--
 -- This module has no connection with Google Inc. or its affiliates.
 module Web.Google.Maps.Common
     ( -- * Functions
@@ -26,7 +26,6 @@ 
 import Data.Aeson (FromJSON)
 import Data.Double.Conversion.Text (toFixed)
-import Data.Either (Either (..))
 import Data.Eq (Eq)
 import Data.Function (($))
 import Data.List (intersperse, map)
src/Web/Google/Static/Maps.hs view
@@ -33,8 +33,8 @@ -- > module Main (main) where
 -- >
 -- > import Data.Maybe (fromJust)
--- > import Graphics.Gloss (Display (..), display, white)   -- package gloss
--- > import Graphics.Gloss.Juicy (fromDynamicImage)         -- package gloss-juicy
+-- > import Graphics.Gloss (Display (..), display, white)  -- package gloss
+-- > import Graphics.Gloss.Juicy (fromDynamicImage)        -- package gloss-juicy
 -- > import Network.HTTP.Client (newManager)
 -- > import Network.HTTP.Client.TLS (tlsManagerSettings)
 -- > import Web.Google.Static.Maps (Center (..), Key (..), Location (..), Size (..),
@@ -42,27 +42,28 @@ -- >
 -- > main :: IO ()
 -- > main = do
--- >     putStrLn "A test of the Google Static Maps API.\nNB: The use of the \
--- >         \API services is subject to the Google Maps APIs Terms of Serivce \
--- >         \at https://developers.google.com/maps/terms.\n"
--- >     mgr <- newManager tlsManagerSettings
--- >     let apiKey = Key "<REPLACE_THIS_WITH_YOUR_ACTUAL_GOOGLE_API_KEY>"
--- >         secret = Just $ Secret "<REPLACE_THIS_WITH_YOUR_ACTUAL_GOOGLE_\
--- >             \URL_SIGNING_SECRET>"  -- If using a digital signature
--- >         center = Just $ Center (Location 42.165950 (-71.362015))
--- >         zoom   = Just $ Zoom 17
--- >         w      = 400
--- >         h      = 400
--- >         size   = Size w h
--- >     result <- staticmap mgr apiKey secret center zoom size Nothing Nothing
--- >                   [] Nothing Nothing Nothing [] [] Nothing
--- >     case result of
--- >         Right response -> do
--- >             let picture = fromJust $ fromDynamicImage response
--- >                 title   = "Test Google Static Maps API"
--- >                 window  = InWindow title (w, h) (10, 10)
--- >             display window white picture
--- >         Left err -> putStrLn $ "Error! Result:\n" ++ show err
+-- >   putStrLn $ "A test of the Google Static Maps API.\nNB: The use of " ++
+-- >     "the API services is subject to the Google Maps APIs Terms of " ++
+-- >     "Serivce at https://developers.google.com/maps/terms.\n"
+-- >   mgr <- newManager tlsManagerSettings
+-- >   let apiKey = Key "<REPLACE_THIS_WITH_YOUR_ACTUAL_GOOGLE_API_KEY>"
+-- >       -- If using a digital signature ...
+-- >       secret = Just $ Secret
+-- >         "<REPLACE_THIS_WITH_YOUR_ACTUAL_GOOGLE_URL_SIGNING_SECRET>"
+-- >       center = Just $ Center (Location 42.165950 (-71.362015))
+-- >       zoom   = Just $ Zoom 17
+-- >       w      = 400
+-- >       h      = 400
+-- >       size   = Size w h
+-- >   result <- staticmap mgr apiKey secret center zoom size Nothing Nothing
+-- >               [] Nothing Nothing Nothing [] [] Nothing
+-- >   case result of
+-- >     Right response -> do
+-- >       let picture = fromJust $ fromDynamicImage response
+-- >           title   = "Test Google Static Maps API"
+-- >           window  = InWindow title (w, h) (10, 10)
+-- >       display window white picture
+-- >     Left err -> putStrLn $ "Error! Result:\n" ++ show err
 module Web.Google.Static.Maps
        ( -- * Functions
          staticmap
@@ -112,10 +113,7 @@ import Crypto.Hash.Algorithms (SHA1)
 import Crypto.MAC.HMAC (HMAC, hmac)
 import Data.ByteArray (convert)
-import qualified Data.ByteString as B (pack, unpack)
 import Data.ByteString.Base64.URL (decode, encode)
-import qualified Data.ByteString.Lazy as L (unpack)
-import Data.ByteString.Builder (stringUtf8, toLazyByteString)
 import Data.ByteString.UTF8 as UTF8 (fromString)
 import Data.List (intersperse)
 import Data.Maybe (catMaybes)
@@ -124,15 +122,14 @@ import qualified Data.Text as T (append, concat, pack)
 import Data.Text.Encoding (decodeUtf8, encodeUtf8)
 import Data.Word (Word8)
-import Debug.Trace (trace)
 import Network.HTTP.Client (Manager)
 import Network.URI (URI (..), URIAuth (..), uriToString)
 import Servant.API ((:>), Get, QueryParam, QueryParams, safeLink,
     ToHttpApiData (..))
-import Servant.Client (BaseUrl (..), client, ClientEnv (..), ClientM,
+import Servant.Client (BaseUrl (..), client, ClientEnv (ClientEnv), ClientM,
     runClientM, ServantError)
 import Servant.JuicyPixels (PNG)
-import Servant.Utils.Links (LinkArrayElementStyle (..), linkURI')
+import Servant.Links (LinkArrayElementStyle (..), linkURI')
 import Text.Bytedump (hexString)
 import Web.Google.Maps.Common (Address (..), googleMapsApis, Key (..),
     Language (..), LatLng (..), Location (..), Region (..))