mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-04-01 00:19:45 +02:00
fix map marker icon
This commit is contained in:
parent
615e19ba9e
commit
6d1ce1df91
@ -30,7 +30,7 @@ export const UserDnsIdentityIcon = ({ pubkey, onlyIcon }: { pubkey: string; only
|
||||
}
|
||||
return (
|
||||
<Text as="span" whiteSpace="nowrap">
|
||||
{metadata.nip05.startsWith("_@")?metadata.nip05.substr(2):metadata.nip05} {renderIcon()}
|
||||
{metadata.nip05.startsWith("_@") ? metadata.nip05.substr(2) : metadata.nip05} {renderIcon()}
|
||||
</Text>
|
||||
);
|
||||
};
|
||||
|
@ -17,6 +17,9 @@ import TimelineActionAndStatus from "../../components/timeline-page/timeline-act
|
||||
import { NostrEvent } from "../../types/nostr-event";
|
||||
import MapTimeline from "./timeline";
|
||||
|
||||
import iconUrl from "./marker-icon.svg";
|
||||
const pinIcon = L.icon({ iconUrl, iconSize: [32, 32], iconAnchor: [16, 32] });
|
||||
|
||||
function getPrecision(zoom: number) {
|
||||
if (zoom <= 4) return 1;
|
||||
if (zoom <= 8) return 2;
|
||||
@ -46,7 +49,7 @@ function useEventMarkers(events: NostrEvent[], map?: L.Map, onClick?: (event: No
|
||||
const geohash = getEventGeohash(event);
|
||||
if (!geohash) continue;
|
||||
|
||||
const marker = markers.current[event.id] || L.marker([0, 0]);
|
||||
const marker = markers.current[event.id] || L.marker([0, 0], { icon: pinIcon });
|
||||
|
||||
const latLng = ngeohash.decode(geohash);
|
||||
marker.setLatLng([latLng.latitude, latLng.longitude]);
|
||||
|
3
src/views/map/marker-icon.svg
Normal file
3
src/views/map/marker-icon.svg
Normal file
@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
||||
<path d="M12 20.8995L16.9497 15.9497C19.6834 13.2161 19.6834 8.78392 16.9497 6.05025C14.2161 3.31658 9.78392 3.31658 7.05025 6.05025C4.31658 8.78392 4.31658 13.2161 7.05025 15.9497L12 20.8995ZM12 23.7279L5.63604 17.364C2.12132 13.8492 2.12132 8.15076 5.63604 4.63604C9.15076 1.12132 14.8492 1.12132 18.364 4.63604C21.8787 8.15076 21.8787 13.8492 18.364 17.364L12 23.7279ZM12 13C13.1046 13 14 12.1046 14 11C14 9.89543 13.1046 9 12 9C10.8954 9 10 9.89543 10 11C10 12.1046 10.8954 13 12 13ZM12 15C9.79086 15 8 13.2091 8 11C8 8.79086 9.79086 7 12 7C14.2091 7 16 8.79086 16 11C16 13.2091 14.2091 15 12 15Z"></path>
|
||||
</svg>
|
After Width: | Height: | Size: 679 B |
@ -66,7 +66,7 @@ const MetadataForm = ({ defaultValues, onSubmit }: MetadataFormProps) => {
|
||||
}, [defaultValues]);
|
||||
|
||||
return (
|
||||
<Flex direction="column" pb="4" px={["2",0]}>
|
||||
<Flex direction="column" pb="4" px={["2", 0]}>
|
||||
<form onSubmit={handleSubmit(onSubmit)}>
|
||||
<Flex direction="column" gap="2" pt="4">
|
||||
<Flex gap="2">
|
||||
|
Loading…
x
Reference in New Issue
Block a user