module GIS.Graphics.Types ( Map (..)
, projection
, title
, labelEntities
, labelledDistricts
) where
import Control.Lens
import Data.Default
import GIS.Types
data Map = Map { _projection :: Projection
, _title :: String
, _labelEntities :: Bool
, _labelledDistricts :: [([Polygon], String)]
}
projection :: Lens' Map Projection
projection f s = fmap (\x -> s { _projection = x }) (f (_projection s))
title :: Lens' Map String
title f s = fmap (\x -> s { _title = x }) (f (_title s))
labelEntities :: Lens' Map Bool
labelEntities f s = fmap (\x -> s { _labelEntities = x }) (f (_labelEntities s))
labelledDistricts :: Lens' Map [([Polygon], String)]
labelledDistricts f s = fmap (\x -> s { _labelledDistricts = x }) (f (_labelledDistricts s))
instance Default Map where
def = Map { _projection = id , _title = mempty , _labelEntities = False , _labelledDistricts = mempty }