Skip to content

Commit

Permalink
add button to directly open iD
Browse files Browse the repository at this point in the history
  • Loading branch information
k-yle committed Nov 4, 2024
1 parent 534df54 commit 8e69621
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions client/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ const LeftSide = memo<{ onSelect(selected: (string | number)[]): void }>(
);
LeftSide.displayName = 'LeftSide';

const LazyPopup: React.FC<{ feature: OsmPatchFeature }> = ({ feature }) => {
const LazyPopup: React.FC<{
feature: OsmPatchFeature;
lat: number;
lng: number;
}> = ({ feature, lat, lng }) => {
// @ts-expect-error -- unofficial field
const nzgbRef: string = feature.__hack__.ref;
// @ts-expect-error -- unofficial field
Expand Down Expand Up @@ -158,7 +162,13 @@ const LazyPopup: React.FC<{ feature: OsmPatchFeature }> = ({ feature }) => {
{feature.id}
</Link>
) : (
<span className="red">Not in OSM</span>
<Link
href={`https://kyle.kiwi/iD/#map=18/${lat}/${lng}`}
target="_blank"
rel="noreferrer"
>
<span className="red">Not in OSM</span>
</Link>
)}
<pre>
{Object.entries(feature.properties)
Expand Down Expand Up @@ -265,7 +275,7 @@ export const Home: React.FC = () => {
return (
<Marker key={feature.id} position={[lat, lng]}>
<Popup>
<LazyPopup feature={feature} />
<LazyPopup feature={feature} lat={lat} lng={lng} />
</Popup>
</Marker>
);
Expand Down

0 comments on commit 8e69621

Please sign in to comment.