Skip to content

Commit

Permalink
Merge pull request #268 from performant-software/RB-custom-buffer
Browse files Browse the repository at this point in the history
Added custom buffer to PlaceMarkers
  • Loading branch information
ajolipa authored Mar 13, 2024
2 parents 941a65b + 7ae161c commit 6485b95
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
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>
);

0 comments on commit 6485b95

Please sign in to comment.