packages feed

olwrapper 0.3.7.13 → 0.3.7.15

raw patch · 9 files changed

+52/−65 lines, 9 filesdep ~basedep ~bytestringdep ~fayPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: base, bytestring, fay, fay-jquery, fay-text, lens, mtl, snap, snap-core, snap-loader-static, snap-server, snaplet-fay, text

API changes (from Hackage documentation)

- OpenLayers.Func: setDefaultView :: Fay ()
- OpenLayers.Func: setTarget :: String -> Fay ()
+ OpenLayers: setDefaultView :: Fay ()
+ OpenLayers: setTarget :: String -> Fay ()

Files

README.md view
@@ -1,2 +1,8 @@-please read my diploma thesis 2015 (TU Vienna) Haskell OpenLayers Wrapper++the project has development status++the library is also the tutorial++for a full documentation please read my diploma thesis 2015 (TU Vienna)+fully available in summer 2015
olwrapper.cabal view
@@ -1,11 +1,15 @@ Name:           olwrapper-Version:        0.3.7.13+Version:        0.3.7.15 Synopsis:       An OpenLayers JavaScript Wrapper and Webframework with snaplet-fay-Description:    test+Description:    Haskell OpenLayers Wrapper+                the project has development status+                the library is also the tutorial+                for a full documentation please read my diploma thesis 2015 (TU Vienna)+                fully available in summer 2015 Author:         Thomas Edelmann Maintainer:     tomnobleman@gmail.com Stability:      Experimental-Category:       Web, Map, OpenLayers, Webframework, snaplet-fay, Wrapper+Category:       Web, Map, OpenLayers, Webframework, snaplet-fay Build-type:     Simple Cabal-version:  >=1.12 license:        GPL@@ -17,13 +21,17 @@     snaplets/fay/devel.cfg     snaplets/heist/templates/index.tpl     static/dummy+    snaplets/fay/src/Index.hs+    src/Application.hs+    src/Main.hs+    src/Site.hs  Flag development   Description:  Whether to build the server in development (interpreted) mode   Default:      False  library-  hs-source-dirs:      wrapper, web, src, snaplets/fay/src+  hs-source-dirs:      wrapper, web   default-language:    Haskell2010   exposed-modules:     OpenLayers@@ -36,10 +44,6 @@   other-modules:     Tutorial.OlApp     Tutorial.Traffic-    Index-    Application-    Main-    Site   other-extensions:       build-depends:            base                      >= 4 && < 4.8,@@ -54,26 +58,27 @@     snap-core                 == 0.9.6.3   ,     snap-server               == 0.9.4.5   ,     snaplet-fay               >= 0.3       ,-    snap-loader-static        == 0.9.0.2+    snap-loader-static        == 0.9.0.2   ,+    snap-loader-dynamic       == 0.10.0.2  executable olwrapper   hs-source-dirs:      src, snaplets/fay/src   main-is:             Main.hs   default-language:    Haskell2010   build-depends:   -    base                      >= 4 && < 4.8,-    bytestring                >= 0.10      ,-    lens                      == 4.4.0.2   ,-    mtl                       >= 2         ,-    text                      >= 0.11      ,-    fay                       == 0.21.2    ,-    fay-text                  == 0.3.2     ,-    fay-jquery                == 0.6.0.2   ,-    snap                      == 0.13.3.1  ,-    snap-core                 == 0.9.6.3   ,-    snap-server               == 0.9.4.5   ,-    snaplet-fay               >= 0.3       ,-    snap-loader-static        == 0.9.0.2+    base                      ,+    bytestring                ,+    lens                      ,+    mtl                       ,+    text                      ,+    fay                       ,+    fay-text                  ,+    fay-jquery                ,+    snap                      ,+    snap-core                 ,+    snap-server               ,+    snaplet-fay               ,+    snap-loader-static            if flag(development)     build-depends:  snap-loader-dynamic == 0.10.0.2
snaplets/fay/src/Index.hs view
@@ -1,23 +1,17 @@-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE RebindableSyntax  #-}-{-# LANGUAGE EmptyDataDecls    #-}-{-# OPTIONS -Wall -fno-warn-name-shadowing -fno-warn-unused-do-bind #-}- module Index where -import           Prelude          hiding (void)-import           JQuery           hiding (Element)-import           Fay.Text                (Text, fromString) import           Fay.FFI-import           OpenLayers -- include OpenLayers, to wrap the OlApp-import           OpenLayers.Internal+import           OpenLayers  addOnload :: Fay f -> Fay () addOnload = ffi "window.addEventListener(\"load\", %1)" -main :: Fay ()-main = addOnload onload+void' :: Fay f -> Fay ()+void' f = f >> return ()  onload :: Fay ()-onload = void $ do-  olwrapperLoad  -- include OpenLayers+onload = void' $ do+  olwrapperLoad  -- including OpenLayers++main :: Fay ()+main = addOnload onload
snaplets/heist/templates/index.tpl view
@@ -18,7 +18,7 @@ <html> 	<head> 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>-		<title>Haskell OpenLayers Wrapper - diploma thesis TU Vienna 2014/2015 - Geoinformation</title>+		<title>Haskell OpenLayers Wrapper - diploma thesis TU Vienna 2015 - Geoinformation</title> 		<script src="http://openlayers.org/en/v3.1.1/build/ol.js"/> 		<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"/> 		<script src="/fay/Index.js"/>
src/Main.hs view
@@ -4,7 +4,6 @@ module Main where  import           Control.Exception (SomeException, try)- import           Data.Text import           Snap.Http.Server import           Snap.Snaplet
src/Site.hs view
@@ -1,5 +1,4 @@ {-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE PackageImports #-}  module Site ( app ) where@@ -9,7 +8,6 @@ import               Snap.Snaplet.Fay import               Snap.Snaplet.Heist import               Snap.Util.FileServe-import  "base"       Prelude  ---------------------------------------------------------- import           Application
web/OlApp.hs view
@@ -4,7 +4,6 @@ -} module OlApp where -import           Prelude          hiding (void) import           OpenLayers.Func import           OpenLayers.Types import           OpenLayers.Internal@@ -13,10 +12,9 @@  -- | ID for the combination of the HTML-Element map and the OpenLayers object  targetId = "map"- -- | definition of the behaviour for OpenLayers designMap :: Fay ()-designMap = void $ do+designMap = OpenLayers.Internal.void $ do     addBaseLayer OSM     designTutorialMap 
wrapper/OpenLayers.hs view
@@ -4,12 +4,9 @@ -} module OpenLayers where -import           Prelude hiding (void)-import           OpenLayers.Func (setDefaultView, setTarget) import           OpenLayers.Internal-import           Fay.Text-import           OlApp (targetId, designMap) import           Fay.FFI+import           OlApp (targetId, designMap)  -- | Adds an default naked OpenLayers Map Object addDefaultMap :: Fay ()@@ -20,9 +17,15 @@ -} defineCode :: Fay () defineCode = ffi "olc = $(olmap)[0]"+-- | setting the target between html and OpenLayers+setTarget :: String -> Fay ()+setTarget = ffi "olc.setTarget(%1)"+-- | setting a default view for first map appearence+setDefaultView :: Fay ()+setDefaultView = ffi "olc.setView(new ol.View({center:[0,0],zoom:2}))" -- | Initialises an OpenLayers View and load the definitions from the OpenLayers Webapplication defined in "OlApp" olwrapperLoad :: Fay ()-olwrapperLoad = void $ do+olwrapperLoad = OpenLayers.Internal.void $ do     addDefaultMap     defineCode     setTarget targetId
wrapper/OpenLayers/Func.hs view
@@ -3,17 +3,7 @@ Description :  OpenLayers JavaScript and Haskell functions -} module OpenLayers.Func where---  defaut coordinates in OpenLayers 3 use EPSG:3857 aka Spherical Mercator !!!!!!!---  http://docs.openlayers.org/library/spherical_mercator.html ---  new functions with ' at end of name   :    name'    :   do/should not return Fay Objects---  the "CREATE NEW FUNCTION" always return an Object and don't have an '---  klingt komisch, is aber so---  when you use a function in a function with void it gets -> Fay a---  Fay JQuery always uses Text, i do not want this so there is always an equivalent function with ' at the end---  that takes a String as parameter (defined in the OpenLayersHtmlFunc module)-- import           Prelude hiding (void) import           JQuery import           Fay.Text hiding (head, tail, map)@@ -172,12 +162,6 @@  setZoom :: Integer -> Fay () setZoom = ffi "olc.getView().setZoom(%1)"--setTarget :: String -> Fay ()-setTarget = ffi "olc.setTarget(%1)"--setDefaultView :: Fay ()-setDefaultView = ffi "olc.setView(new ol.View({center:[0,0],zoom:2}))"  setEventToHtml :: String -> Fay Text -> Fay JQuery setEventToHtml elementId function = do