Skip to content

Commit

Permalink
fix: use alpha versions
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-heppner-ibigroup committed Oct 24, 2023
1 parent f52f435 commit 8e11fa3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/stops-overlay/src/StopsOverlay.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ const Example = ({
minZoom = 15,
setLocation = action("setLocation"),
setViewedStop = action("setViewedStop"),
stops = mockStops
stops = mockStops,
highlightedStop = "8338"
}: StopProps & { mapCenter?: [number, number] }) => {
return (
<StopsOverlay
minZoom={minZoom}
setLocation={setLocation}
setViewedStop={setViewedStop}
stops={stops}
highlightedStop={highlightedStop}
visible
/>
);
Expand Down
21 changes: 20 additions & 1 deletion packages/stops-overlay/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ type Props = {
* An optional id to override the active stop with
*/
activeStop?: string;
/**
* An optional id to highlight a stop on the map
*/
highlightedStop?: string;
/**
* The list of stops to create stop markers for.
*/
Expand Down Expand Up @@ -51,6 +55,7 @@ const StopsOverlay = (props: Props): JSX.Element => {
const {
activeStop,
color,
highlightedStop,
minZoom,
refreshStops,
setLocation,
Expand Down Expand Up @@ -127,7 +132,8 @@ const StopsOverlay = (props: Props): JSX.Element => {
type: "Feature",
properties: {
...stop,
flex: isGeoJsonFlex(stop?.geometries?.geoJson)
flex: isGeoJsonFlex(stop?.geometries?.geoJson),
highlighted: stop.id === highlightedStop
},
geometry: { type: "Point", coordinates: [stop.lon, stop.lat] }
}))
Expand Down Expand Up @@ -157,6 +163,19 @@ const StopsOverlay = (props: Props): JSX.Element => {
}}
type="circle"
/>
<Layer
id="higlightedStop"
filter={["==", "highlighted", true]}
paint={{
"circle-color": color || "#ff0000",
"circle-opacity": 1,
"circle-radius": 10,
// TODO: Use tinycolor to generate outline with appropriate contrast.
"circle-stroke-color": color ? "#fff" : "#333",
"circle-stroke-width": 2
}}
type="circle"
/>
<Layer
filter={["==", "flex", true]}
id="flex-stops"
Expand Down

0 comments on commit 8e11fa3

Please sign in to comment.