brambow / elements

Themeable React components for map-based web applications
https://cartolab-gis.github.io/elements/
MIT License
69 stars 11 forks source link

feat: add intercept prop to <Home /> #39

Closed tannerjt closed 4 years ago

tannerjt commented 4 years ago

I added an intercept prop that accepts either:

A: an intercept function <Home intercept={(map) => { }) />

B: an array with an intercept function [0] and Falsey Boolean [1] <Home intercept={[(map) => { }, False]} />

Here, A and B have the same result. The Boolean determines if the standard zoomTo logic is run. I have an example where we instead pass in a function that uses the flyTo function.

C: an array with an intercept function [0] and Truty Boolean [1] <Home intercept={[(map) => { }, True]} />

C will run the standard zoomTo logic and the function just acts as a callback.

All intercept functions will return the map object.