diff --git a/examples/icon/src/Main.purs b/examples/icon/src/Main.purs index 21a25ce..365a3c1 100644 --- a/examples/icon/src/Main.purs +++ b/examples/icon/src/Main.purs @@ -197,6 +197,7 @@ iconLayerSpec = (R.spec' getInitialState render) {componentWillReceiveProps = re ( Icon.defaultIconProps { id = "icon" , data = map (\m -> {meteorite : m}) props.data , pickable = false + , fp64 = false , visible = true , iconAtlas = props.iconAtlas , iconMapping = props.iconMapping @@ -214,7 +215,6 @@ iconLayerSpec = (R.spec' getInitialState render) {componentWillReceiveProps = re $ R.createFactory DeckGL.deckGL $ build (merge vp) { layers: [iconLayer] - , initializer: DeckGL.initializeGL } getInitialState :: R.GetInitialState MeteoriteProps MeteoriteState eff diff --git a/src/DeckGL.js b/src/DeckGL.js index cb680a0..f72e0f9 100644 --- a/src/DeckGL.js +++ b/src/DeckGL.js @@ -1,8 +1,4 @@ var DeckGL = require('deck.gl'); -exports.initializeGL = function(gl) { - gl.enable(gl.DEPTH_TEST); - gl.depthFunc(gl.LEQUAL); -}; - +exports.defaultDeckGLProps = DeckGL.DeckGL.defaultProps; exports.deckGL = DeckGL.DeckGL; diff --git a/src/DeckGL.purs b/src/DeckGL.purs index 495ebe5..2a584d5 100644 --- a/src/DeckGL.purs +++ b/src/DeckGL.purs @@ -6,11 +6,11 @@ import WebMercator.Viewport (ViewportR) foreign import data Layer :: Type foreign import data GLInitializer :: Type -foreign import initializeGL :: GLInitializer +foreign import defaultDeckGLProps :: DeckGLProps + type MapPropsR r = ( layers :: Array Layer - , initializer :: GLInitializer | r ) diff --git a/src/DeckGL/BaseProps.purs b/src/DeckGL/BaseProps.purs index 1d663bb..9ec8191 100644 --- a/src/DeckGL/BaseProps.purs +++ b/src/DeckGL/BaseProps.purs @@ -41,6 +41,7 @@ type LightSettings = -- | - `visibility`: Controls the visibility of the layer, should use instead of conditional rendering. -- | - `opacity`: The opacity of the layer. -- | - `pickable`: Whether the layer responds to mouse picking events. +-- | - `fp64`: Whether the layer should be rendered in high-precision 64-bit mode -- | - `onHover`: Callback that gets called when hovering on an object. -- | - `onClick`: Callback for clicking on an object in a layer. -- | - `autoHighlight`: When true, the current object pointed to by the mouse on hover is highlighted with the color @@ -53,6 +54,7 @@ type BaseProps eff rest a = , visible :: Boolean , opacity :: Number , pickable :: Boolean + , fp64 :: Boolean , onHover :: EffFn1 eff (PickingInfo a) Boolean , onClick :: EffFn1 eff (PickingInfo a) Boolean , autoHighlight :: Boolean diff --git a/src/DeckGL/Layer/Icon.purs b/src/DeckGL/Layer/Icon.purs index b1e58ac..b0afeb1 100644 --- a/src/DeckGL/Layer/Icon.purs +++ b/src/DeckGL/Layer/Icon.purs @@ -37,5 +37,6 @@ type IconLayerProps d eff = BaseProps , getPosition :: IconData d -> LngLat , getSize :: IconData d -> Number , getIcon :: IconData d -> String + , getColor :: IconData d -> Array Number ) (IconData d)