diff --git a/src/components/infrastructure/tollHouseMap/PointsOnMap/index.jsx b/src/components/infrastructure/tollHouseMap/PointsOnMap/index.jsx index 2cdd91c..8283bbf 100644 --- a/src/components/infrastructure/tollHouseMap/PointsOnMap/index.jsx +++ b/src/components/infrastructure/tollHouseMap/PointsOnMap/index.jsx @@ -21,26 +21,28 @@ const PointsOnMap = ({ data, isCluster }) => { const markers = useMemo(() => { return data.map(({ id, lat, lng, step }) => { - if (!lat && !lng) return - return { - openDialog(); - setSelectedId(id); - }, - }} - color={getMarkerColor(Number(status))} - />; + if (!lat && !lng) return; + return ( + { + openDialog(); + setSelectedId(id); + }, + }} + color={getMarkerColor(Number(status))} + /> + ); }); }, [data, theme]); useEffect(() => { if (data.length === 0) { // fly to Iran - map.flyTo([32.4279, 53.6880], 6, { duration: 0.7 }); + map.flyTo([32.4279, 53.688], 6, { duration: 0.7 }); return; } @@ -51,7 +53,7 @@ const PointsOnMap = ({ data, isCluster }) => { if (validPoints.length === 0) { // اگر هیچ مختصات معتبری نبود → ایران - map.flyTo([32.4279, 53.6880], 6, { duration: 0.7 }); + map.flyTo([32.4279, 53.688], 6, { duration: 0.7 }); return; } @@ -59,15 +61,13 @@ const PointsOnMap = ({ data, isCluster }) => { if (!bounds.isValid()) { // اگر bounds معتبر نبود → fallback روی ایران - map.flyTo([32.4279, 53.6880], 6, { duration: 0.7 }); + map.flyTo([32.4279, 53.688], 6, { duration: 0.7 }); return; } map.flyToBounds(bounds, { duration: 0.7 }); - }, [data]); - const createClusterCustomIcon = (cluster) => { const count = cluster.getChildCount(); return L.divIcon({