एआई की मदद से तैयार की गई खास जानकारी

उदाहरण के तौर पर दिया गया पूरा सोर्स कोड देखें

एआई की मदद से खास जानकारी पाने के लिए, जगहों के बारे में खोजें. खोजने के लिए सुझाए गए कुछ शब्द:

  • आस-पास की जगहों की खास जानकारी के लिए "होटल".
  • ईवीसीएस की सुविधाओं की खास जानकारी के लिए, "ईवी चार्जिंग स्टेशन".
  • किसी जगह और समीक्षाओं की खास जानकारी के लिए, कोई भी रेस्टोरेंट या कारोबार.

TypeScript

// Define DOM elements.
const mapElement = document.querySelector('gmp-map')!;
const placeAutocomplete = document.querySelector('gmp-place-autocomplete')!;
const summaryPanel = document.getElementById('summary-panel')!;
const placeName = document.getElementById('place-name')!;
const placeAddress = document.getElementById('place-address')!;
const tabContainer = document.getElementById('tab-container')!;
const summaryContent = document.getElementById('summary-content')!;
const aiDisclosure = document.getElementById('ai-disclosure')!;
const flagContentLink = document.getElementById(
    'flag-content-link'
) as HTMLAnchorElement;

let innerMap: google.maps.Map;
let marker: google.maps.marker.AdvancedMarkerElement;

async function init(): Promise<void> {
    // Request needed libraries.
    const [{ AdvancedMarkerElement }] = await Promise.all([
        google.maps.importLibrary('marker'),
        google.maps.importLibrary('places'),
    ]);

    innerMap = mapElement.innerMap;
    innerMap.setOptions({
        mapTypeControl: false,
        streetViewControl: false,
        fullscreenControl: false,
    });

    // Bind autocomplete bounds to map bounds.
    innerMap.addListener('bounds_changed', () => {
        placeAutocomplete.locationRestriction = innerMap.getBounds()!;
    });

    // Create the marker.
    marker = new AdvancedMarkerElement({
        map: innerMap,
    });

    // Handle selection of an autocomplete result.
    placeAutocomplete.addEventListener(
        'gmp-select',
        async ({ placePrediction }) => {
            const place = placePrediction.toPlace();

            // Fetch all summary fields.
            await place.fetchFields({
                fields: [
                    'displayName',
                    'formattedAddress',
                    'location',
                    'generativeSummary',
                    'neighborhoodSummary',
                    'reviewSummary',
                    'evChargeAmenitySummary',
                ],
            });

            // Update the map viewport and position the marker.
            if (place.viewport) {
                innerMap.fitBounds(place.viewport);
            } else {
                innerMap.setCenter(place.location!);
                innerMap.setZoom(17);
            }
            marker.position = place.location;

            // Update the panel UI.
            updateSummaryPanel(place);
        }
    );
}

function updateSummaryPanel(place: google.maps.places.Place) {
    // Reset UI
    summaryPanel.classList.remove('hidden');
    tabContainer.innerHTML = ''; // innerHTML is OK here since we're clearing known child elements.
    summaryContent.textContent = '';
    aiDisclosure.textContent = '';

    placeName.textContent = place.displayName || '';
    placeAddress.textContent = place.formattedAddress || '';

    let firstTabActivated = false;

    /**
     * Safe Helper: Accepts either a text string or a DOM Node (like a div or DocumentFragment).
     */
    const createTab = (
        label: string,
        content: string | Node,
        disclosure: string | null,
        flagUrl: string | null
    ) => {
        const btn = document.createElement('button');
        btn.className = 'tab-button';
        btn.textContent = label;

        btn.onclick = () => {
            // Do nothing if the tab is already active.
            if (btn.classList.contains('active')) {
                return;
            }

            // Manage the active class state.
            document.querySelectorAll('.tab-button').forEach((b) => {
                b.classList.remove('active');
            });
            btn.classList.add('active');

            if (typeof content === 'string') {
                summaryContent.textContent = content;
            } else {
                summaryContent.replaceChildren(content.cloneNode(true));
            }

            // Set the disclosure text.
            aiDisclosure.textContent = disclosure || 'AI-generated content.';

            // Add the content flag URI.
            if (flagUrl) {
                flagContentLink.href = flagUrl;
                flagContentLink.textContent = 'Report an issue';
            }
        };

        tabContainer.appendChild(btn);

        // Auto-select the first available summary.
        if (!firstTabActivated) {
            btn.click();
            firstTabActivated = true;
        }
    };

    // --- 1. Generative Summary (Place) ---
    if (place.generativeSummary?.overview) {
        createTab(
            'Overview',
            place.generativeSummary.overview,
            place.generativeSummary.disclosureText,
            place.generativeSummary.flagContentURI
        );
    }

    // --- 2. Review Summary ---
    if (place.reviewSummary?.text) {
        createTab(
            'Reviews',
            place.reviewSummary.text,
            place.reviewSummary.disclosureText,
            place.reviewSummary.flagContentURI
        );
    }

    // --- 3. Neighborhood Summary ---
    if (place.neighborhoodSummary?.overview?.content) {
        createTab(
            'Neighborhood',
            place.neighborhoodSummary.overview.content,
            place.neighborhoodSummary.disclosureText,
            place.neighborhoodSummary.flagContentURI
        );
    }

    // --- 4. EV Amenity Summary (uses content blocks)) ---
    if (place.evChargeAmenitySummary) {
        const evSummary = place.evChargeAmenitySummary;
        const evContainer = document.createDocumentFragment();

        // Helper to build a safe DOM section for EV categories.
        const createSection = (title: string, text: string) => {
            const wrapper = document.createElement('div');
            wrapper.style.marginBottom = '15px'; // Or use a CSS class

            const titleEl = document.createElement('strong');
            titleEl.textContent = title;

            const textEl = document.createElement('div');
            textEl.textContent = text;

            wrapper.appendChild(titleEl);
            wrapper.appendChild(textEl);
            return wrapper;
        };

        // Check and append each potential section
        if (evSummary.overview?.content) {
            evContainer.appendChild(
                createSection('Overview', evSummary.overview.content)
            );
        }
        if (evSummary.coffee?.content) {
            evContainer.appendChild(
                createSection('Coffee', evSummary.coffee.content)
            );
        }
        if (evSummary.restaurant?.content) {
            evContainer.appendChild(
                createSection('Food', evSummary.restaurant.content)
            );
        }
        if (evSummary.store?.content) {
            evContainer.appendChild(
                createSection('Shopping', evSummary.store.content)
            );
        }

        // Only add the tab if the container has children
        if (evContainer.hasChildNodes()) {
            createTab(
                'EV Amenities',
                evContainer, // Passing a Node instead of string
                evSummary.disclosureText,
                evSummary.flagContentURI
            );
        }
    }

    // Safely handle the empty state.
    if (!firstTabActivated) {
        const msg = document.createElement('em');
        msg.textContent =
            'No AI summaries are available for this specific location.';
        summaryContent.replaceChildren(msg);
        aiDisclosure.textContent = '';
    }
}

void init();

JavaScript

// Define DOM elements.
const mapElement = document.querySelector('gmp-map');
const placeAutocomplete = document.querySelector('gmp-place-autocomplete');
const summaryPanel = document.getElementById('summary-panel');
const placeName = document.getElementById('place-name');
const placeAddress = document.getElementById('place-address');
const tabContainer = document.getElementById('tab-container');
const summaryContent = document.getElementById('summary-content');
const aiDisclosure = document.getElementById('ai-disclosure');
const flagContentLink = document.getElementById('flag-content-link');

let innerMap;
let marker;

async function init() {
    // Request needed libraries.
    const [{ AdvancedMarkerElement }] = await Promise.all([
        google.maps.importLibrary('marker'),
        google.maps.importLibrary('places'),
    ]);

    innerMap = mapElement.innerMap;
    innerMap.setOptions({
        mapTypeControl: false,
        streetViewControl: false,
        fullscreenControl: false,
    });

    // Bind autocomplete bounds to map bounds.
    innerMap.addListener('bounds_changed', () => {
        placeAutocomplete.locationRestriction = innerMap.getBounds();
    });

    // Create the marker.
    marker = new AdvancedMarkerElement({
        map: innerMap,
    });

    // Handle selection of an autocomplete result.
    placeAutocomplete.addEventListener(
        'gmp-select',
        async ({ placePrediction }) => {
            const place = placePrediction.toPlace();

            // Fetch all summary fields.
            await place.fetchFields({
                fields: [
                    'displayName',
                    'formattedAddress',
                    'location',
                    'generativeSummary',
                    'neighborhoodSummary',
                    'reviewSummary',
                    'evChargeAmenitySummary',
                ],
            });

            // Update the map viewport and position the marker.
            if (place.viewport) {
                innerMap.fitBounds(place.viewport);
            } else {
                innerMap.setCenter(place.location);
                innerMap.setZoom(17);
            }
            marker.position = place.location;

            // Update the panel UI.
            updateSummaryPanel(place);
        }
    );
}

function updateSummaryPanel(place) {
    // Reset UI
    summaryPanel.classList.remove('hidden');
    tabContainer.innerHTML = ''; // innerHTML is OK here since we're clearing known child elements.
    summaryContent.textContent = '';
    aiDisclosure.textContent = '';

    placeName.textContent = place.displayName || '';
    placeAddress.textContent = place.formattedAddress || '';

    let firstTabActivated = false;

    /**
     * Safe Helper: Accepts either a text string or a DOM Node (like a div or DocumentFragment).
     */
    const createTab = (label, content, disclosure, flagUrl) => {
        const btn = document.createElement('button');
        btn.className = 'tab-button';
        btn.textContent = label;

        btn.onclick = () => {
            // Do nothing if the tab is already active.
            if (btn.classList.contains('active')) {
                return;
            }

            // Manage the active class state.
            document.querySelectorAll('.tab-button').forEach((b) => {
                b.classList.remove('active');
            });
            btn.classList.add('active');

            if (typeof content === 'string') {
                summaryContent.textContent = content;
            } else {
                summaryContent.replaceChildren(content.cloneNode(true));
            }

            // Set the disclosure text.
            aiDisclosure.textContent = disclosure || 'AI-generated content.';

            // Add the content flag URI.
            if (flagUrl) {
                flagContentLink.href = flagUrl;
                flagContentLink.textContent = 'Report an issue';
            }
        };

        tabContainer.appendChild(btn);

        // Auto-select the first available summary.
        if (!firstTabActivated) {
            btn.click();
            firstTabActivated = true;
        }
    };

    // --- 1. Generative Summary (Place) ---
    if (place.generativeSummary?.overview) {
        createTab(
            'Overview',
            place.generativeSummary.overview,
            place.generativeSummary.disclosureText,
            place.generativeSummary.flagContentURI
        );
    }

    // --- 2. Review Summary ---
    if (place.reviewSummary?.text) {
        createTab(
            'Reviews',
            place.reviewSummary.text,
            place.reviewSummary.disclosureText,
            place.reviewSummary.flagContentURI
        );
    }

    // --- 3. Neighborhood Summary ---
    if (place.neighborhoodSummary?.overview?.content) {
        createTab(
            'Neighborhood',
            place.neighborhoodSummary.overview.content,
            place.neighborhoodSummary.disclosureText,
            place.neighborhoodSummary.flagContentURI
        );
    }

    // --- 4. EV Amenity Summary (uses content blocks)) ---
    if (place.evChargeAmenitySummary) {
        const evSummary = place.evChargeAmenitySummary;
        const evContainer = document.createDocumentFragment();

        // Helper to build a safe DOM section for EV categories.
        const createSection = (title, text) => {
            const wrapper = document.createElement('div');
            wrapper.style.marginBottom = '15px'; // Or use a CSS class

            const titleEl = document.createElement('strong');
            titleEl.textContent = title;

            const textEl = document.createElement('div');
            textEl.textContent = text;

            wrapper.appendChild(titleEl);
            wrapper.appendChild(textEl);
            return wrapper;
        };

        // Check and append each potential section
        if (evSummary.overview?.content) {
            evContainer.appendChild(
                createSection('Overview', evSummary.overview.content)
            );
        }
        if (evSummary.coffee?.content) {
            evContainer.appendChild(
                createSection('Coffee', evSummary.coffee.content)
            );
        }
        if (evSummary.restaurant?.content) {
            evContainer.appendChild(
                createSection('Food', evSummary.restaurant.content)
            );
        }
        if (evSummary.store?.content) {
            evContainer.appendChild(
                createSection('Shopping', evSummary.store.content)
            );
        }

        // Only add the tab if the container has children
        if (evContainer.hasChildNodes()) {
            createTab(
                'EV Amenities',
                evContainer, // Passing a Node instead of string
                evSummary.disclosureText,
                evSummary.flagContentURI
            );
        }
    }

    // Safely handle the empty state.
    if (!firstTabActivated) {
        const msg = document.createElement('em');
        msg.textContent =
            'No AI summaries are available for this specific location.';
        summaryContent.replaceChildren(msg);
        aiDisclosure.textContent = '';
    }
}

void init();

सीएसएस

/* Reuse existing map height */
gmp-map {
    height: 100%;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Existing Autocomplete Card Style */
.place-autocomplete-card {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
    margin: 10px;
    padding: 2px;
    font-family: Roboto, sans-serif;
    font-size: 1rem;
}

gmp-place-autocomplete {
    width: 330px;
}

/* New: Summary Panel Styles */
.summary-card {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
    margin: 10px;
    padding: 0; /* Padding handled by children */
    font-family: Roboto, sans-serif;
    width: 350px;
    max-height: 80vh; /* Prevent overflow on small screens */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none;
}

#place-header {
    padding: 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

#place-header h2 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
}

#place-address {
    margin: 0;
    color: #555;
    font-size: 0.9rem;
}

/* Tab Navigation */
.tab-container {
    display: flex;
    border-bottom: 1px solid #ddd;
    background-color: #fff;
}

.tab-button {
    flex: 1;
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-weight: 500;
    color: #555;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    background-color: #f1f1f1;
}

.tab-button.active {
    font-weight: bold;
    border-bottom: 3px solid #000000;
}

.tab-button.active:hover {
    background-color: #ffffff;
    cursor: default;
}

/* Content Area */
.content-area {
    padding: 15px;
    line-height: 1.5;
    font-size: 0.95rem;
    color: #333;
}

.disclosure-footer {
    font-size: 0.75rem;
    color: #666;
    padding: 10px 15px;
    border-top: 1px solid #eee;
    font-style: italic;
}

.flag-content-link {
    font-size: 0.75rem;
    color: #666;
    padding: 10px 15px;
    border-top: 1px solid #eee;
}

एचटीएमएल

<html>
    <head>
        <title>AI Place Summaries</title>
        <link rel="stylesheet" type="text/css" href="./style.css" />
        <script type="module" src="./index.js"></script>
        <script>
            // prettier-ignore
            (g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})({
                key: "GOOGLE_MAPS_API_KEY"
            });
        </script>
    </head>
    <body>
        <gmp-map center="37.80, -122.425" zoom="14" map-id="DEMO_MAP_ID">
            <!-- Search Input Card -->
            <div
                class="place-autocomplete-card"
                slot="control-inline-start-block-start">
                <gmp-place-autocomplete
                    placeholder="Find places with AI summaries"></gmp-place-autocomplete>
            </div>

            <!-- Summary text panel (initially hidden) -->
            <div
                id="summary-panel"
                class="summary-card hidden"
                slot="control-inline-end-block-start">
                <div id="place-header">
                    <h2 id="place-name"></h2>
                    <p id="place-address"></p>
                </div>

                <!-- Tabs for toggling summary types -->
                <div class="tab-container" id="tab-container"></div>

                <!-- Content display area -->
                <div id="summary-content" class="content-area"></div>

                <!-- Legal/AI Disclosure -->
                <div id="ai-disclosure" class="disclosure-footer"></div>

                <!-- Flag content link -->
                <a id="flag-content-link" class="flag-content-link"></a>
            </div>
        </gmp-map>
    </body>
</html>

एआई की मदद से जनरेट की गई खास जानकारी, किसी जगह या इलाके के बारे में खास जानकारी होती है. इसमें किसी जगह, उसके आस-पास के इलाके, और उससे जुड़ी समीक्षाओं के बारे में अहम जानकारी मिलती है. एआई की मदद से मिलने वाले जवाब तीन तरह के होते हैं:

  • जगह की खास जानकारी: किसी जगह के आईडी के बारे में 100 वर्णों में दी गई खास जानकारी. इसमें अलग-अलग तरह के डेटा को इकट्ठा करके, किसी जगह के बारे में खास जानकारी दी जाती है.

  • किसी जगह के बारे में खास जानकारी: किसी जगह के बारे में जनरेट की गई खास जानकारी. यह जानकारी, सिर्फ़ उपयोगकर्ताओं की समीक्षाओं पर आधारित होती है.

  • इलाके की खास जानकारी: किसी जगह के आस-पास के इलाके के बारे में जनरेट की गई खास जानकारी. इसमें आस-पास की लोकप्रिय जगहों के बारे में ज़्यादा जानकारी दी जाती है. इलाके की खास जानकारी, इनमें से किसी एक तरह की हो सकती है:

    • आस-पास की जगहों की खास जानकारी: premise, street_address, और हाउसिंग और लॉजिंग कैटगरी में मौजूद सभी तरह की जगहों के आस-पास मौजूद लोकप्रिय जगहों की खास जानकारी.

    • इलेक्ट्रिक वाहन चार्जिंग स्टेशन पर मिलने वाली सुविधाओं की खास जानकारी: electric_vehicle_charging_station टाइप वाली जगहों के आस-पास मौजूद लोकप्रिय जगहों की खास जानकारी.

एआई की मदद से जनरेट की गई खास जानकारी पाना

एआई की मदद से तैयार की गई खास जानकारी को वापस पाने और दिखाने के लिए, यह तरीका अपनाएं:

  1. Places लाइब्रेरी लोड करें.

    const { Place } = await google.maps.importLibrary("places");
  2. Place इंस्टेंस पाएं. नीचे दिए गए स्निपेट में, जगह के आईडी से Place इंस्टेंस बनाने का तरीका बताया गया है:

    const place = new Place("ChIJaYaXFTqq3oARNy537Kb_W_c");
  3. place.fetchFields() को किए गए अपने कॉल में, उन फ़ील्ड के बारे में बताएं जिनका इस्तेमाल आपको खास जानकारी के लिए करना है. यहां दिए गए स्निपेट में, खास जानकारी वाले सभी फ़ील्ड का अनुरोध किया गया है:

    await place.fetchFields({
      fields: [
        'generativeSummary',
        'neighborhoodSummary',
        'reviewSummary',
        'evChargeAmenitySummary'
        // Include other fields as needed.
      ]
    });
              
  4. खास जानकारी वाला डेटा पाने के लिए, generativeSummary, neighborhoodSummary, reviewSummary, और evChargeAmenitySummary प्रॉपर्टी को ऐक्सेस करें. यहां दिए गए स्निपेट में, generativeSummary से खास जानकारी पाने का तरीका बताया गया है.

    const summaryText = place.generativeSummary.overview;
            

सभी जगहों के लिए, एआई की मदद से खास जानकारी जनरेट करने की सुविधा उपलब्ध नहीं है. इसलिए, उपयोगकर्ताओं को जानकारी दिखाने से पहले, पक्का करें कि आपके पास ज़रूरी डेटा मौजूद हो. यहां दिए गए स्निपेट में, generativeSummary की जांच करने के लिए, if स्टेटमेंट का इस्तेमाल किया गया है:

if (place.generativeSummary) {
  overviewText = place.generativeSummary.overview;
} else {
  overviewText = 'No summary is available.';
}
    

इसके अलावा, खास जानकारी की मौजूदगी की जांच करने के लिए, नल्लिश ऑपरेटर का इस्तेमाल करें:

const overviewText = place.generativeSummary.overview ?? 'No summary is available.';
    

ज़रूरी एट्रिब्यूशन दिखाना

आपके ऐप्लिकेशन में एआई की मदद से जनरेट की गई सभी खास जानकारी के साथ, Google की नीतियों और स्टैंडर्ड के मुताबिक सही एट्रिब्यूशन होना चाहिए. ज़्यादा जानकारी के लिए, Maps JavaScript API के लिए नीतियां और एट्रिब्यूशन देखें.

जगह की खास जानकारी

जगह की खास जानकारी, किसी जगह के आईडी के हिसाब से दी गई 100 वर्णों की खास जानकारी होती है. इससे किसी जगह की खास जानकारी मिलती है. जगहों की खास जानकारी में, किसी जगह पर खरीदारी के लिए उपलब्ध लोकप्रिय खाने-पीने की चीज़ों, सेवाओं या सामान को हाइलाइट किया जा सकता है:

  • "फ़ोरम शॉप्स में मौजूद रेस्टोरेंट, जहां कैज़ुअल माहौल में पारंपरिक इटैलियन पकवान परोसे जाते हैं."

  • "स्टाइलिश सैलून, जहां बाल काटने और कलर करने के साथ-साथ ब्लोआउट की सुविधा भी मिलती है."

  • "बड़ा स्टोर, जहां कई विक्रेता अलग-अलग तरह के विंटेज सजावट का सामान, फ़र्नीचर, और कपड़े बेचते हैं."

जगह की खास जानकारी, इस्तेमाल किए जा सकने वाले टाइप में दिखाए गए जगह के टाइप के लिए उपलब्ध है. ये टाइप, संस्कृति, मनोरंजन और आनंद, खान-पान, खरीदारी, सेवाएं, और खेल-कूद कैटगरी के लिए उपलब्ध हैं.

दिलचस्पी वाली जगहों की खास जानकारी, इन भाषाओं और इलाकों में उपलब्ध है:

भाषा क्षेत्र
अंग्रेज़ी

भारत

अमेरिका

किसी जगह की खास जानकारी पाने का अनुरोध करना

जनरेटिव एआई की मदद से किसी जगह की खास जानकारी पाने के लिए, fetchFields() को कॉल करते समय generativeSummary फ़ील्ड शामिल करें:

await place.fetchFields({
    fields: [
        'generativeSummary',
        // Include other fields as needed.
    ],
});
    

जगह की खास जानकारी पाने के लिए, generativeSummary प्रॉपर्टी का इस्तेमाल करें. यहां दिया गया स्निपेट, generativeSummary से खास जानकारी और डिसक्लोज़र का टेक्स्ट हासिल करता है:

if (place.generativeSummary) {
    console.log("Place Overview:", place.generativeSummary.overview);
    console.log("Disclosure:", place.generativeSummary.disclosureText);
}
    

समीक्षाओं की खास जानकारी

समीक्षाओं की खास जानकारी, सिर्फ़ उपयोगकर्ताओं की समीक्षाओं के आधार पर जनरेट की जाती है. किसी जगह के बारे में खास जानकारी, उपयोगकर्ताओं की समीक्षाओं के मुख्य एलिमेंट को जोड़कर बनाई जाती है. जैसे, जगह की विशेषताएं और समीक्षक की भावनाएं. इससे उपयोगकर्ताओं को अहम जानकारी मिलती है और वे सोच-समझकर फ़ैसले ले पाते हैं.

उदाहरण के लिए, सैन फ़्रांसिस्को में मौजूद फ़ेरी बिल्डिंग की समीक्षाओं की खास जानकारी में, खाने-पीने और खरीदारी से लेकर नज़ारों और माहौल तक की जानकारी शामिल होती है:

"यहां आने वाले लोगों का कहना है कि इस ऐतिहासिक लैंडमार्क पर कई तरह की दुकानें, रेस्टोरेंट, और किसानों का बाज़ार है. साथ ही, कई लोगों ने खाड़ी और शहर के नज़ारों की तारीफ़ की है. साथ ही, वे यहां के खुशनुमा माहौल, अन्य जगहों तक जाने के लिए फ़ेरी की सुविधा, और स्थानीय कारोबारों का आनंद लेने के अवसर को भी हाइलाइट करते हैं."

दिलचस्पी वाली जगहों के बारे में खास जानकारी, इन भाषाओं और देशों/इलाकों में उपलब्ध है:

भाषा क्षेत्र
अंग्रेज़ी अर्जेंटीना, बोलिविया, ब्राज़ील, चिली, कोलंबिया, कोस्टा रिका, डॉमिनिकन रिपब्लिक, इक्वाडोर, ग्वाटेमाला, भारत, जापान, मेक्सिको, पराग्वे, पेरू, यूनाइटेड किंगडम, अमेरिका, उरुग्वे, वेनेज़ुएला
जापानी जापान
पॉर्चुगीज़ ब्राज़ील
स्पैनिश अर्जेंटीना, बोलिविया, चिली, कोलंबिया, कोस्टा रिका, डॉमिनिकन रिपब्लिक, इक्वाडोर, ग्वाटेमाला, मेक्सिको, पराग्वे, पेरू, अमेरिका, उरुग्वे, वेनेज़ुएला

समीक्षा की खास जानकारी का अनुरोध करना

किसी जगह के बारे में खास जानकारी पाने का अनुरोध करने के लिए, fetchFields() को कॉल करते समय reviewSummary फ़ील्ड शामिल करें:

await place.fetchFields({
    fields: [
        'reviewSummary',
        // Include other fields as needed.
    ],
});
  

समीक्षाओं की खास जानकारी पाने के लिए, reviewSummary प्रॉपर्टी का इस्तेमाल करें. समीक्षाओं की खास जानकारी पाने के लिए, reviewSummary.text प्रॉपर्टी को ऐक्सेस करें. यहां दिया गया स्निपेट, reviewSummary से टेक्स्ट को वापस लाता है.

if (place.reviewSummary) {
    console.log("Place Review Summary:", place.reviewSummary.text);
}
  

इलाके की खास जानकारी

इलाके की खास जानकारी, किसी जगह के आस-पास के इलाके के लिए जनरेट की जाती है. किसी इलाके की खास जानकारी से, उस जगह के बारे में ज़्यादा जानकारी मिलती है. इसमें आस-पास की दिलचस्प जगहों की जानकारी भी शामिल होती है. इससे उपयोगकर्ताओं को यह तय करने में मदद मिलती है कि उन्हें कहां जाना चाहिए और वहां पहुंचने के बाद क्या करना चाहिए. उदाहरण के लिए, किसी नए शहर में जाने पर, किसी होटल के आस-पास के इलाके की खास जानकारी देखी जा सकती है. इससे आपको उस इलाके के बारे में ज़्यादा जानने में मदद मिलेगी:

  • "सैन फ़्रांसिस्को का यह चहल-पहल भरा इलाका, नॉर्थ बीच और चाइनाटाउन को जोड़ता है. यह फ़ाइनेंशियल डिस्ट्रिक्ट के उत्तर-पश्चिम में स्थित है. यहां साहित्य से जुड़ी मशहूर जगहें, अनोखी सांस्कृतिक जगहें, और अलग-अलग तरह के रेस्टोरेंट हैं. यहां की मशहूर जगहों में, सिटी लाइट्स बुकस्टोर, केबल कार म्यूज़ियम, और चाइनाटाउन की चहल-पहल वाली सड़कें शामिल हैं."

अगर आपको इलेक्ट्रिक वाहन चार्ज करना है, तो इलेक्ट्रिक वाहन चार्जिंग स्टेशन की खास जानकारी देखी जा सकती है. इससे आपको आस-पास के इलाके के बारे में ज़्यादा जानकारी मिलेगी:

  • "इस इलाके में नौ मिनट की पैदल दूरी पर, खाने-पीने के कई विकल्प मौजूद हैं. इनमें Starbucks, Sushi Jin, और Safeway शामिल हैं."

इलाके की जानकारी के साथ-साथ, जवाब में Place इंस्टेंस की सूची भी शामिल होती है. इसमें, जानकारी में बताए गए जगहों के इंस्टेंस शामिल होते हैं. हर जगह के बारे में ज़्यादा जानकारी पाने के लिए, इन Place इंस्टेंस पर fetchFields() को कॉल करें.

एआई की मदद से, किसी इलाके की खास जानकारी दो तरह से मिलती है:

  • आस-पास की जगहों की खास जानकारी: premise, street_address, और हाउसिंग और लॉजिंग कैटगरी में मौजूद सभी तरह की जगहों के आस-पास की लोकप्रिय जगहों की खास जानकारी.

  • इलेक्ट्रिक वाहन चार्जिंग स्टेशन पर मिलने वाली सुविधाओं की खास जानकारी: electric_vehicle_charging_station टाइप वाली जगहों के लिए, आस-पास मौजूद लोकप्रिय जगहों की खास जानकारी.

किसी जगह की खास जानकारी, इन भाषाओं और देशों/इलाकों में उपलब्ध है:

भाषा क्षेत्र
अंग्रेज़ी अमेरिका

किसी इलाके की खास जानकारी पाने का अनुरोध करना

premise, street_address, और हाउसिंग और लॉजिंग कैटगरी में मौजूद सभी तरह की जगहों के लिए, आस-पास की जगहों की खास जानकारी का अनुरोध किया जा सकता है. आस-पास की जगहों की खास जानकारी पाने के लिए, fetchFields() को कॉल करते समय neighborhoodSummary फ़ील्ड शामिल करें:

await place.fetchFields({
    fields: [
        'neighborhoodSummary',
        // Include other fields as needed.
    ],
});
  

आस-पड़ोस की खास जानकारी पाने के लिए, neighborhoodSummary प्रॉपर्टी का इस्तेमाल करें. आस-पास की जगहों की खास जानकारी पाने के लिए, neighborhoodSummary.content प्रॉपर्टी को ऐक्सेस करें.

यहां दिया गया स्निपेट, neighborhoodSummary का कॉन्टेंट हासिल करता है:

if (place.neighborhoodSummary) {
    console.log("Place Neighborhood Summary:", place.neighborhoodSummary.overview.content);
}
  

इलेक्ट्रिक वाहन चार्जिंग स्टेशन की सुविधा की खास जानकारी का अनुरोध करना

electric_vehicle_charging_station टाइप वाली जगहों के लिए, इलेक्ट्रिक वाहन चार्जिंग स्टेशन की सुविधा की खास जानकारी का अनुरोध किया जा सकता है. ईवीसीएस की सुविधाओं की खास जानकारी में, चार तरह की खास जानकारी मिलती है: overview, coffee, restaurant, और store. इस वजह से, डेटा स्ट्रक्चर ऑब्जेक्ट का एक कलेक्शन होता है. इसमें हर ऑब्जेक्ट में खास जानकारी होती है. इलेक्ट्रिक वाहन चार्जिंग स्टेशन की सुविधा की खास जानकारी का अनुरोध करने के लिए, fetchFields() को कॉल करते समय evChargeAmenitySummary फ़ील्ड शामिल करें:

await place.fetchFields({
    fields: [
        'evChargeAmenitySummary',
        // Include other fields as needed.
    ],
});
  

इलेक्ट्रिक वाहन चार्जिंग स्टेशन की सुविधाओं की खास जानकारी पाने के लिए, evChargeAmenitySummary प्रॉपर्टी का इस्तेमाल करें. खास जानकारी से टेक्स्ट पाने के लिए, evChargeAmenitySummary.overview, evChargeAmenitySummary.coffee, evChargeAmenitySummary.restaurant, और evChargeAmenitySummary.store प्रॉपर्टी की content प्रॉपर्टी को ऐक्सेस करें.

यहां दिया गया स्निपेट, evChargeAmenitySummary का कॉन्टेंट हासिल करता है:

// overview, coffee, restaurant, store.
if (place.evChargeAmenitySummary) {
    console.log("Place EVCS Amenity Summary:", place.evChargeAmenitySummary.overview.content);
    console.log("Coffee:", place.evChargeAmenitySummary.coffee.content);
    console.log("Restaurants:", place.evChargeAmenitySummary.restaurant.content);
    console.log("Stores:", place.evChargeAmenitySummary.store.content);
}