contact add to telegram bot

This commit is contained in:
nabijonovdavronbek619@gmail.com
2025-11-08 12:06:17 +05:00
parent 9f047aecb4
commit 7e37d086fd
6 changed files with 374 additions and 40 deletions

View File

@@ -14,7 +14,7 @@ declare global {
type Props = { lat?: number; lng?: number; zoom?: number };
export default function GoogleMap({
lat = 41.2628056, // rasmda korsatilgan koordinata (41°15'46.1"N 69°13'08.8"E)
lat = 41.2628056,
lng = 69.2191111,
zoom = 17,
}: Props) {
@@ -28,24 +28,24 @@ export default function GoogleMap({
const map = new google.maps.Map(mapRef.current, {
center,
zoom,
mapTypeControl: true, // 🛰 Satellite tugmasi
streetViewControl: true, // Street View tugmasi
fullscreenControl: true, // Fullscreen
zoomControl: true, // Zoom tugmalari
mapTypeControl: true,
streetViewControl: true,
fullscreenControl: true,
zoomControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DEFAULT,
position: google.maps.ControlPosition.RIGHT_BOTTOM, // Chap pastga Satellite
position: google.maps.ControlPosition.RIGHT_BOTTOM,
},
});
// 📌 Marker
new google.maps.Marker({
position: center,
// ✅ Yangi marker usuli
new google.maps.marker.AdvancedMarkerElement({
map,
position: center,
title: "Bizning manzil",
});
// 🧭 Koordinata oynasini yaratamiz
// 🧭 Qoshimcha koordinata oynasi
const coordDiv = document.createElement("div");
coordDiv.style.background = "#fff";
coordDiv.style.padding = "15px 30px";
@@ -59,19 +59,17 @@ export default function GoogleMap({
`;
map.controls[google.maps.ControlPosition.TOP_LEFT].push(coordDiv);
};
if (window.google && window.google.maps && typeof window.initMap === "function") {
window.initMap();
}
}, [lat, lng, zoom]);
return (
<>
<Script
src={`https://maps.googleapis.com/maps/api/js?key=${process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY}&callback=initMap`}
async
defer
src={`https://maps.googleapis.com/maps/api/js?key=AIzaSyARZe3FPgMT0p-CwDD-iYvpz2Mh8jkUxR0&callback=initMap&libraries=marker`}
strategy="afterInteractive"
/>
<div ref={mapRef} style={{ width: "100%", height: "600px", overflow: "hidden" }} />
<div ref={mapRef} style={{ width: "100%", height: "600px" }} />
</>
);
}