Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added custom buffer to PlaceMarkers #268

Merged
merged 11 commits into from
Mar 13, 2024
6 changes: 6 additions & 0 deletions packages/core-data/src/components/PlaceMarkers.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ import _ from 'underscore';
type Props = {
animate?: boolean,

/**
* The number of miles to buffer the GeoJSON data. (Defaults to two.)
*/
buffer?: number,

/**
* The URL of the Core Data place record.
*/
Expand Down Expand Up @@ -69,6 +74,7 @@ const PlaceMarkers = (props: Props) => {
return (
<LocationMarkers
animate={props.animate}
buffer={props.buffer}
data={data}
/>
);
Expand Down
30 changes: 29 additions & 1 deletion packages/storybook/src/core-data/PlaceMarker.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const Default = () => (
>
<PlaceMarkers
urls={[
'/core_data/places/1'
'/core_data/places/2'
]}
/>
</div>
Expand Down Expand Up @@ -61,3 +61,31 @@ export const MultiplePlaces = () => (
</Map>
</Peripleo>
);

export const LargerBuffer = () => (
<Peripleo>
<Map
style={mapStyle}
>
<Controls
position='topright'
>
<Zoom />
</Controls>
<div
style={{
width: '100%',
height: '300px'
}}
>
<PlaceMarkers
urls={[
'/core_data/places/2'
]}
buffer={20}
/>
</div>
</Map>
</Peripleo>
);