back icon in new address
This commit is contained in:
@@ -28,6 +28,7 @@ interface CustomMapProps {
|
||||
onClick?: (event: L.LeafletMouseEvent) => void;
|
||||
searchEnabled?: boolean
|
||||
markerActive?: boolean
|
||||
onMapReady?: (map: L.Map) => void;
|
||||
}
|
||||
|
||||
// Component to handle map events and position updates
|
||||
@@ -114,6 +115,7 @@ const CustomMap: React.FC<CustomMapProps> = ({
|
||||
onClick,
|
||||
markerActive = true,
|
||||
searchEnabled = true,
|
||||
onMapReady,
|
||||
}) => {
|
||||
const [selectedPosition, setSelectedPosition] = useState<[number, number] | null>(null);
|
||||
const [mapInstance, setMapInstance] = useState<L.Map | null>(null);
|
||||
@@ -136,6 +138,13 @@ const CustomMap: React.FC<CustomMapProps> = ({
|
||||
checkTiles();
|
||||
}, [mapInstance]);
|
||||
|
||||
// Notify parent when map is ready
|
||||
useEffect(() => {
|
||||
if (mapInstance && onMapReady) {
|
||||
onMapReady(mapInstance);
|
||||
}
|
||||
}, [mapInstance, onMapReady]);
|
||||
|
||||
// Initialize default icon on client side only
|
||||
useEffect(() => {
|
||||
// Dynamic import of Leaflet on the client side
|
||||
|
||||
Reference in New Issue
Block a user