diff --git a/example/map-halogen/src/Main.purs b/example/map-halogen/src/Main.purs index bd8babb..75f5242 100644 --- a/example/map-halogen/src/Main.purs +++ b/example/map-halogen/src/Main.purs @@ -66,7 +66,7 @@ ui = pure next eval (HandleMapUpdate msg next) = do case msg of - OnChangeViewport vp -> liftEff $ log $ show vp + OnViewportChange vp -> liftEff $ log $ show vp OnClick info -> liftEff $ log $ show info.lngLat pure next diff --git a/example/map-halogen/src/MapComponent.purs b/example/map-halogen/src/MapComponent.purs index 7a3952f..9d06af8 100644 --- a/example/map-halogen/src/MapComponent.purs +++ b/example/map-halogen/src/MapComponent.purs @@ -43,7 +43,7 @@ data MapQuery a | HandleMessages Messages a data MapMessages - = OnChangeViewport Viewport + = OnViewportChange Viewport | OnClick ClickInfo mapComponent :: forall eff m. MonadAff (dom :: DOM, avar :: AVAR | eff) m => H.Component HH.HTML MapQuery MapProps MapMessages m @@ -154,8 +154,8 @@ mapClass = R.createClass spec pure $ R.createFactory MapGL.mapGL $ MapGL.mkProps viewport - { onChangeViewport: mkEffFn1 $ \newVp -> do - launchAff_ $ Bus.write (PublicMsg $ OnChangeViewport newVp) messages + { onViewportChange: mkEffFn1 $ \newVp -> do + launchAff_ $ Bus.write (PublicMsg $ OnViewportChange newVp) messages void $ R.transformState this _{viewport = newVp} , onClick: mkEffFn1 $ \info -> do launchAff_ $ Bus.write (PublicMsg $ OnClick info) messages diff --git a/example/map/src/Main.purs b/example/map/src/Main.purs index 43751fa..9daa173 100644 --- a/example/map/src/Main.purs +++ b/example/map/src/Main.purs @@ -36,7 +36,7 @@ mapSpec = R.spec' (const initialViewport) render render this = R.readState this <#> \vp -> R.createFactory MapGL.mapGL $ MapGL.mkProps vp - { onChangeViewport: mkEffFn1 $ \newVp -> do + { onViewportChange: mkEffFn1 $ \newVp -> do log $ "Changed Viewport: " <> show newVp void $ R.writeState this newVp , onClick: mkEffFn1 $ \info -> do diff --git a/src/MapGL.purs b/src/MapGL.purs index 2d3004a..eb0b82a 100644 --- a/src/MapGL.purs +++ b/src/MapGL.purs @@ -2,7 +2,7 @@ module MapGL ( Viewport(..) , ViewportR , LngLat - , OnChangeViewport + , OnViewportChange , ClickInfo , OnClickMap , MapProps @@ -70,7 +70,7 @@ instance showLngLat :: Show LngLat where show = genericShow -- | A handler to be run whenever the viewport changes -type OnChangeViewport eff = EffFn1 eff Viewport Unit +type OnViewportChange eff = EffFn1 eff Viewport Unit -- | The type exposed by the picking engine (abbreviated). -- | - `latLng`: The latitude and longitude of the point picked. @@ -82,7 +82,7 @@ type ClickInfo = type OnClickMap eff = EffFn1 eff ClickInfo Unit type MapPropsR eff r = - ( onChangeViewport :: OnChangeViewport eff + ( onViewportChange :: OnViewportChange eff , onClick :: OnClickMap eff , mapStyle :: String , mapboxApiAccessToken :: String