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 buffer prop to placemarker #263

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/core-data/src/components/PlaceMarker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import { LocationMarker } from '@performant-software/geospatial';
import React, { useCallback, useEffect, useState } from 'react';

type Props = {
/**
* The number of miles to buffer the GeoJSON data. (Defaults to 2.)
*/
buffer?: number,

/**
* The URL of the Core Data place record.
*/
Expand Down Expand Up @@ -52,6 +57,7 @@ const PlaceMarker = (props: Props) => {
return (
<LocationMarker
data={place}
buffer={props.buffer}
/>
);
};
Expand Down
25 changes: 25 additions & 0 deletions packages/storybook/src/core-data/PlaceMarker.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,28 @@ export const Default = () => (
</Map>
</Peripleo>
);

export const LargerBuffer = () => (
<Peripleo>
<Map
style={mapStyle}
>
<Controls
position='topright'
>
<Zoom />
</Controls>
<div
style={{
width: '100%',
height: '300px'
}}
>
<PlaceMarker
url={PLACE_URL}
buffer={20}
/>
</div>
</Map>
</Peripleo>
);