forked from Transparency/kgroad-frontend2
updated navbar, fixed map
This commit is contained in:
1 parent
981c5863ee
commit
6508bc0258
11 files changed
+80
-54
No files matched your search
@@ -40,9 +40,7 @@ interface IHomeMapProps {
|
||||
reports: IData[];
|
||||
}
|
||||
|
||||
const HomeMap: React.FC<IHomeMapProps> = ({
|
||||
reports,
|
||||
}: IHomeMapProps) => {
|
||||
const HomeMap: React.FC<IHomeMapProps> = ({ reports }: IHomeMapProps) => {
|
||||
const { display_location, latLng } = useMapStore();
|
||||
const [position, setPosition] = useState<ILatLng>({
|
||||
lat: 42.8746,
|
||||
@@ -95,10 +93,7 @@ const HomeMap: React.FC<IHomeMapProps> = ({
|
||||
lng: 74.606,
|
||||
};
|
||||
|
||||
if (
|
||||
latLng.lat === defPosition.lat &&
|
||||
latLng.lng === defPosition.lng
|
||||
)
|
||||
if (latLng.lat === defPosition.lat && latLng.lng === defPosition.lng)
|
||||
return null;
|
||||
|
||||
return (
|
||||
@@ -112,7 +107,7 @@ const HomeMap: React.FC<IHomeMapProps> = ({
|
||||
<MapContainer
|
||||
center={position}
|
||||
zoom={14}
|
||||
scrollWheelZoom={false}
|
||||
scrollWheelZoom={true}
|
||||
className="home-map"
|
||||
>
|
||||
<TileLayer
|
||||
@@ -144,14 +139,10 @@ const HomeMap: React.FC<IHomeMapProps> = ({
|
||||
<Marker
|
||||
key={marker.id}
|
||||
icon={icons[report.category]}
|
||||
position={
|
||||
[+marker.latitude, +marker.longitude] as LatLngTuple
|
||||
}
|
||||
position={[+marker.latitude, +marker.longitude] as LatLngTuple}
|
||||
>
|
||||
<Popup>
|
||||
<Link href={`/report/${report?.id}`}>
|
||||
{marker.address}
|
||||
</Link>
|
||||
<Link href={`/report/${report?.id}`}>{marker.address}</Link>
|
||||
</Popup>
|
||||
</Marker>
|
||||
))
|
||||
|
||||
Reference in new issue
Block a user