diff --git a/components/lib_components/google.map.tsx b/components/lib_components/google.map.tsx index c33d6b9..f433a8a 100644 --- a/components/lib_components/google.map.tsx +++ b/components/lib_components/google.map.tsx @@ -1,75 +1,47 @@ "use client"; -/// -import { useEffect, useRef } from "react"; -import Script from "next/script"; +import React from "react"; +import { YMaps, Map, Placemark, ZoomControl, TypeSelector, FullscreenControl } from "@pbe/react-yandex-maps"; -declare global { - interface Window { - initMap?: () => void; - google?: typeof google; - } -} - -type Props = { lat?: number; lng?: number; zoom?: number }; - -export default function GoogleMap({ - lat = 41.2628056, - lng = 69.2191111, - zoom = 17, -}: Props) { - const mapRef = useRef(null); - - useEffect(() => { - window.initMap = () => { - if (!mapRef.current || !window.google) return; - - const center = new google.maps.LatLng(lat, lng); - const map = new google.maps.Map(mapRef.current, { - center, - zoom, - mapTypeControl: true, - streetViewControl: true, - fullscreenControl: true, - zoomControl: true, - mapTypeControlOptions: { - style: google.maps.MapTypeControlStyle.DEFAULT, - position: google.maps.ControlPosition.RIGHT_BOTTOM, - }, - }); - - // ✅ Yangi marker usuli - new google.maps.marker.AdvancedMarkerElement({ - map, - position: center, - title: "Bizning manzil", - }); - - // 🧭 Qo‘shimcha koordinata oynasi - const coordDiv = document.createElement("div"); - coordDiv.style.background = "#fff"; - coordDiv.style.padding = "15px 30px"; - coordDiv.style.margin = "15px 30px"; - coordDiv.style.boxShadow = "0 2px 6px rgba(0,0,0,0.3)"; - coordDiv.innerHTML = ` -
- 41°15'46.1"N 69°13'08.8"E
- View larger map -
- `; - map.controls[google.maps.ControlPosition.TOP_LEFT].push(coordDiv); - }; - }, [lat, lng, zoom]); +export default function YandexMap() { + const location = { lat: 41.3111, lng: 69.2406 }; return ( - <> -