createWaypointAdvancedMarkers() কল করে রুটের ওয়েপয়েন্টের জন্য মার্কার তৈরি করুন।
ডিফল্ট হিসেবে, createWaypointAdvancedMarkers() রুট লেবেল করার জন্য মার্কার তৈরি করে
'A', 'B', 'C' ইত্যাদি, প্রতিটি ওয়েপয়েন্টের জন্য। আপনি মার্কার ইনডেক্স বা সংশ্লিষ্ট
RouteLeg-এর প্রপার্টির উপর ভিত্তি করে মার্কার স্টাইল পরিবর্তন করার জন্য
বিকল্প পাস করে মার্কার আরও কাস্টমাইজ করতে পারবেন।
সম্পূর্ণ উদাহরণ সোর্স কোড দেখুন
নিম্নলিখিত কোড স্যাম্পেল থেকে কীভাবে রুটের ওয়েপয়েন্টের জন্য কাস্টম মার্কার তৈরি করতে হয় তা জানতে পারবেন।
TypeScript
let mapPolylines: google.maps.Polyline[] = []; const mapElement = document.querySelector('gmp-map')!; let innerMap: google.maps.Map; // Initialize and add the map. async function init() { // Request the needed libraries. const [{ event }] = await Promise.all([ google.maps.importLibrary('core'), google.maps.importLibrary('maps'), ]); innerMap = mapElement.innerMap; innerMap.setOptions({ mapTypeControl: false, mapId: 'DEMO_MAP_ID', }); // Call the function after the map is loaded. event.addListenerOnce(innerMap, 'idle', () => { void getDirections(); }); } async function getDirections() { // Request the needed libraries. const [{ Route }, { PinElement }] = await Promise.all([ google.maps.importLibrary('routes'), google.maps.importLibrary('marker'), ]); // Define routes request with an intermediate stop. const request: google.maps.routes.ComputeRoutesRequest = { origin: 'Parking lot, Christmas Tree Point Rd, San Francisco, CA 94131', destination: '100 Spinnaker Dr, Sausalito, CA 94965', // We're having a yummy lunch! intermediates: [{ location: '300 Finley Rd San Francisco, CA 94129' }], // But first, we golf! travelMode: 'DRIVING', fields: ['path', 'legs', 'viewport'], }; // Call computeRoutes to get the directions. const result = await Route.computeRoutes(request); if (!result.routes || result.routes.length === 0) { console.warn('No routes found'); return; } // Alter style based on marker index. function markerOptionsMaker( defaultOptions: google.maps.marker.AdvancedMarkerElementOptions, waypointMarkerDetails: google.maps.routes.WaypointMarkerDetails ) { const { index, totalMarkers } = waypointMarkerDetails; // Style the origin waypoint. if (index === 0) { return { ...defaultOptions, title: 'Origin', map: innerMap, gmpClickable: true, content: new PinElement({ glyphText: (index + 1).toString(), glyphColor: 'white', background: 'green', borderColor: 'green', scale: 1.5, }), }; } // Style all intermediate waypoints. if (!(index === 0 || index === totalMarkers - 1)) { return { ...defaultOptions, title: `Waypoint ${(index + 1).toString()}`, // Provide label for screenreaders map: innerMap, gmpClickable: true, // Make marker focusable and allow keyboard navigation content: new PinElement({ glyphText: (index + 1).toString(), glyphColor: 'white', background: 'blue', borderColor: 'blue', scale: 1.5, // Increase size for better visibilty }), }; } // Style the destination waypoint. if (index === totalMarkers - 1) { return { ...defaultOptions, title: 'Destination', map: innerMap, gmpClickable: true, content: new PinElement({ glyphText: (index + 1).toString(), glyphColor: 'white', background: 'red', borderColor: 'red', scale: 1.5, }), }; } return { ...defaultOptions, map: innerMap }; } await result.routes[0].createWaypointAdvancedMarkers(markerOptionsMaker); // Fit the map to the route. innerMap.fitBounds(result.routes[0].viewport!); innerMap.setHeading(270); // Create polylines and add them to the map. mapPolylines = result.routes[0].createPolylines(); mapPolylines.forEach((polyline) => { polyline.setMap(innerMap); }); } void init();
জাভাস্ক্রিপ্ট
let mapPolylines = []; const mapElement = document.querySelector('gmp-map'); let innerMap; // Initialize and add the map. async function init() { // Request the needed libraries. const [{ event }] = await Promise.all([ google.maps.importLibrary('core'), google.maps.importLibrary('maps'), ]); innerMap = mapElement.innerMap; innerMap.setOptions({ mapTypeControl: false, mapId: 'DEMO_MAP_ID', }); // Call the function after the map is loaded. event.addListenerOnce(innerMap, 'idle', () => { void getDirections(); }); } async function getDirections() { // Request the needed libraries. const [{ Route }, { PinElement }] = await Promise.all([ google.maps.importLibrary('routes'), google.maps.importLibrary('marker'), ]); // Define routes request with an intermediate stop. const request = { origin: 'Parking lot, Christmas Tree Point Rd, San Francisco, CA 94131', destination: '100 Spinnaker Dr, Sausalito, CA 94965', // We're having a yummy lunch! intermediates: [{ location: '300 Finley Rd San Francisco, CA 94129' }], // But first, we golf! travelMode: 'DRIVING', fields: ['path', 'legs', 'viewport'], }; // Call computeRoutes to get the directions. const result = await Route.computeRoutes(request); if (!result.routes || result.routes.length === 0) { console.warn('No routes found'); return; } // Alter style based on marker index. function markerOptionsMaker(defaultOptions, waypointMarkerDetails) { const { index, totalMarkers } = waypointMarkerDetails; // Style the origin waypoint. if (index === 0) { return { ...defaultOptions, title: 'Origin', map: innerMap, gmpClickable: true, content: new PinElement({ glyphText: (index + 1).toString(), glyphColor: 'white', background: 'green', borderColor: 'green', scale: 1.5, }), }; } // Style all intermediate waypoints. if (!(index === 0 || index === totalMarkers - 1)) { return { ...defaultOptions, title: `Waypoint ${(index + 1).toString()}`, // Provide label for screenreaders map: innerMap, gmpClickable: true, // Make marker focusable and allow keyboard navigation content: new PinElement({ glyphText: (index + 1).toString(), glyphColor: 'white', background: 'blue', borderColor: 'blue', scale: 1.5, // Increase size for better visibilty }), }; } // Style the destination waypoint. if (index === totalMarkers - 1) { return { ...defaultOptions, title: 'Destination', map: innerMap, gmpClickable: true, content: new PinElement({ glyphText: (index + 1).toString(), glyphColor: 'white', background: 'red', borderColor: 'red', scale: 1.5, }), }; } return { ...defaultOptions, map: innerMap }; } await result.routes[0].createWaypointAdvancedMarkers(markerOptionsMaker); // Fit the map to the route. innerMap.fitBounds(result.routes[0].viewport); innerMap.setHeading(270); // Create polylines and add them to the map. mapPolylines = result.routes[0].createPolylines(); mapPolylines.forEach((polyline) => { polyline.setMap(innerMap); }); } void init();
CSS
/* * Always set the map height explicitly to define the size of the div element * that contains the map. */ #map { height: 100%; } /* * Optional: Makes the sample page fill the window. */ html, body { height: 100%; margin: 0; padding: 0; }
HTML
<html>
<head>
<title>Get directions</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.447646, -122.113878" zoom="12"></gmp-map>
</body>
</html>ডিফল্ট মার্কার যোগ করা
ডিফল্ট স্টাইল ব্যবহার করে মার্কার যোগ করতে, createWaypointAdvancedMarkers()
বর্তমান ম্যাপ নির্দিষ্ট করার জন্য মার্কার বিকল্প পাস করুন, যেমন নিম্নলিখিত কোড স্নিপেটে দেখানো হয়েছে।
// Create markers using default style. const markers = await result.routes[0].createWaypointAdvancedMarkers({ map: innerMap });
কাস্টম স্টাইল সহ মার্কার যোগ করা
কাস্টম স্টাইল ব্যবহার করে মার্কার যোগ করতে, createWaypointAdvancedMarkers()
কাস্টম স্টাইল প্রপার্টি সহ মার্কার বিকল্প পাস করুন। আপনি এই ধরনের স্টাইল প্রয়োগ করলে,
সব মার্কার একই স্টাইলে দেখানো হয়। নিচের কোড স্নিপেট থেকে কাস্টম স্টাইল সহ মার্কার
তৈরি করার পদ্ধতি জানতে পারবেন।
// Create markers with a custom style. const markerOptions = { map: innerMap, content: new PinElement({ scale: 1.5, background: '#8C0DD1', borderColor: '#6D0AA5', glyphColor: '#6D0AA5', }).element } const markers = await result.routes[0].createWaypointAdvancedMarkers(markerOptions);
আলাদা আলাদা মার্কারের জন্য কাস্টম স্টাইল প্রয়োগ করা
আলাদা আলাদা মার্কারের জন্য কাস্টম স্টাইল প্রয়োগ করতে, createWaypointAdvancedMarkers()
-এ একটি ফাংশন পাস করুন, যাতে মার্কার ইনডেক্স বা RouteLeg প্রপার্টির ভিত্তিতে মার্কার স্টাইল বিকল্প সেট করা যায়।
নিচে দেওয়া কোড স্নিপেটে মার্কার তৈরি করার একটি ফাংশন দেখানো হয়েছে এবং মার্কার ইনডেক্সের
উপর ভিত্তি করে সেগুলিকে স্টাইল করা হয়েছে:
TypeScript
// Alter style based on marker index. function markerOptionsMaker( defaultOptions: google.maps.marker.AdvancedMarkerElementOptions, waypointMarkerDetails: google.maps.routes.WaypointMarkerDetails ) { const { index, totalMarkers } = waypointMarkerDetails; // Style the origin waypoint. if (index === 0) { return { ...defaultOptions, title: 'Origin', map: innerMap, gmpClickable: true, content: new PinElement({ glyphText: (index + 1).toString(), glyphColor: 'white', background: 'green', borderColor: 'green', scale: 1.5, }), }; } // Style all intermediate waypoints. if (!(index === 0 || index === totalMarkers - 1)) { return { ...defaultOptions, title: `Waypoint ${(index + 1).toString()}`, // Provide label for screenreaders map: innerMap, gmpClickable: true, // Make marker focusable and allow keyboard navigation content: new PinElement({ glyphText: (index + 1).toString(), glyphColor: 'white', background: 'blue', borderColor: 'blue', scale: 1.5, // Increase size for better visibilty }), }; } // Style the destination waypoint. if (index === totalMarkers - 1) { return { ...defaultOptions, title: 'Destination', map: innerMap, gmpClickable: true, content: new PinElement({ glyphText: (index + 1).toString(), glyphColor: 'white', background: 'red', borderColor: 'red', scale: 1.5, }), }; } return { ...defaultOptions, map: innerMap }; } await result.routes[0].createWaypointAdvancedMarkers(markerOptionsMaker);
জাভাস্ক্রিপ্ট
// Alter style based on marker index. function markerOptionsMaker(defaultOptions, waypointMarkerDetails) { const { index, totalMarkers } = waypointMarkerDetails; // Style the origin waypoint. if (index === 0) { return { ...defaultOptions, title: 'Origin', map: innerMap, gmpClickable: true, content: new PinElement({ glyphText: (index + 1).toString(), glyphColor: 'white', background: 'green', borderColor: 'green', scale: 1.5, }), }; } // Style all intermediate waypoints. if (!(index === 0 || index === totalMarkers - 1)) { return { ...defaultOptions, title: `Waypoint ${(index + 1).toString()}`, // Provide label for screenreaders map: innerMap, gmpClickable: true, // Make marker focusable and allow keyboard navigation content: new PinElement({ glyphText: (index + 1).toString(), glyphColor: 'white', background: 'blue', borderColor: 'blue', scale: 1.5, // Increase size for better visibilty }), }; } // Style the destination waypoint. if (index === totalMarkers - 1) { return { ...defaultOptions, title: 'Destination', map: innerMap, gmpClickable: true, content: new PinElement({ glyphText: (index + 1).toString(), glyphColor: 'white', background: 'red', borderColor: 'red', scale: 1.5, }), }; } return { ...defaultOptions, map: innerMap }; } await result.routes[0].createWaypointAdvancedMarkers(markerOptionsMaker);
মার্কার অ্যাক্সেসযোগ্য করে তোলা
আপনি নিম্নলিখিত উপায়ে মার্কার অ্যাক্সেসিবিলিটি উন্নত করতে পারবেন:
- একটি শীর্ষক দিন: মার্কারের জন্য লেবেল দিতে, মার্কার বিকল্পে
titleপ্রপার্টিকে সেট করুন। এই লেবেলটি স্ক্রিন রিডার ও সহায়ক প্রযুক্তি ব্যবহার করে। - ইন্টারমিডিয়েট ওয়েপয়েন্ট আলাদা করে চিহ্নিত করা:
createWaypointAdvancedMarkers()-এ স্টাইল ফাংশন পাস করার সময়,WaypointMarkerDetailsথেকেindexএবংtotalMarkersপ্যারামিটার ব্যবহার করে ইন্টারমিডিয়েট ওয়েপয়েন্টকে অনন্য, বর্ণনামূলক শীর্ষক ও লেবেল (যেমন,Waypoint ${(index + 1).toString()}) অ্যাসাইন করুন যাতে স্ক্রিন রিডার ব্যবহারকারীরা সেগুলিকে গন্তব্য ও সোর্স থেকে আলাদা করে চিনতে পারেন। - কীবোর্ড নেভিগেশন ও ক্লিক ইভেন্ট চালু করুন: মার্কার বিকল্পে
gmpClickable: trueসেট করে ইন্ট্যার্যাক্টিভ মার্কারকে কীবোর্ডের (Tab ও তীরচিহ্ন কী ব্যবহার করে) মাধ্যমে ফোকাস করার উপযুক্ত করে তুলুন এবং কীবোর্ড ও মাউস ইনপুটের উত্তর দেওয়ার উপযুক্ত করে তুলুন। - মার্কারের সাইজ বাড়ানো:
scaleপ্রপার্টিকে চালু করুনPinElement(যেমন,scale: 1.5) যাতে মার্কারের সাথে ইন্টার্যাক্ট করার জন্য প্রয়োজনীয় নির্ভুলতা কমানো যায়, বিশেষ করে টাচস্ক্রিন ডিভাইসে। ডিফল্ট মার্কার WCAG AA ন্যূনতম সাইজ স্ট্যান্ডার্ড মেনে চলে এবং স্কেল বাড়ালে তা WCAG AAA টার্গেট সাইজ স্ট্যান্ডার্ড মেনে চলতে সাহায্য করে। - কালার কনট্রাস্ট বজায় রাখুন:
PinElementরঙ কাস্টমাইজ করার সময়,glyphColorওbackgroundভ্যালু যথেষ্ট কনট্রাস্ট সহ বেছে নিন যাতে ওয়েপয়েন্ট লেবেল সহজে পড়া যায়।
অ্যাক্সেসিবিলিটির জন্য কীভাবে মার্কার স্টাইল করতে হয় তা নিম্নলিখিত কোড স্নিপেট থেকে জানতে পারবেন। এতে স্ক্রিন রিডারের জন্য লেবেল প্রদান করার
title আছে; মধ্যবর্তী ওয়েপয়েন্ট আলাদা করতে, শীর্ষকটি ইন্ডেক্স ব্যবহার
করে। কীবোর্ড নেভিগেশন ও ক্লিক ইভেন্ট চালু করতে gmpClickable প্রপার্টিকে
true হিসেবে সেট করা হয়েছে এবং মার্কারের সাথে ইন্টার্যাক্ট করা সহজ করতে scale
মান বাড়ানো হয়েছে।
TypeScript
// Style all intermediate waypoints. if (!(index === 0 || index === totalMarkers - 1)) { return { ...defaultOptions, title: `Waypoint ${(index + 1).toString()}`, // Provide label for screenreaders map: innerMap, gmpClickable: true, // Make marker focusable and allow keyboard navigation content: new PinElement({ glyphText: (index + 1).toString(), glyphColor: 'white', background: 'blue', borderColor: 'blue', scale: 1.5, // Increase size for better visibilty }), }; }
জাভাস্ক্রিপ্ট
// Style all intermediate waypoints. if (!(index === 0 || index === totalMarkers - 1)) { return { ...defaultOptions, title: `Waypoint ${(index + 1).toString()}`, // Provide label for screenreaders map: innerMap, gmpClickable: true, // Make marker focusable and allow keyboard navigation content: new PinElement({ glyphText: (index + 1).toString(), glyphColor: 'white', background: 'blue', borderColor: 'blue', scale: 1.5, // Increase size for better visibilty }), }; }
আরও বিবরণের জন্য, দেখুন মার্কার ক্লিক করা ও অ্যাক্সেস করা যায় এমন করে তুলুন।
সম্পূর্ণ উদাহরণ দেখুন
TypeScript
let mapPolylines: google.maps.Polyline[] = []; const mapElement = document.querySelector('gmp-map')!; let innerMap: google.maps.Map; // Initialize and add the map. async function init() { // Request the needed libraries. const [{ event }] = await Promise.all([ google.maps.importLibrary('core'), google.maps.importLibrary('maps'), ]); innerMap = mapElement.innerMap; innerMap.setOptions({ mapTypeControl: false, mapId: 'DEMO_MAP_ID', }); // Call the function after the map is loaded. event.addListenerOnce(innerMap, 'idle', () => { void getDirections(); }); } async function getDirections() { // Request the needed libraries. const [{ Route }, { PinElement }] = await Promise.all([ google.maps.importLibrary('routes'), google.maps.importLibrary('marker'), ]); // Define routes request with an intermediate stop. const request: google.maps.routes.ComputeRoutesRequest = { origin: 'Parking lot, Christmas Tree Point Rd, San Francisco, CA 94131', destination: '100 Spinnaker Dr, Sausalito, CA 94965', // We're having a yummy lunch! intermediates: [{ location: '300 Finley Rd San Francisco, CA 94129' }], // But first, we golf! travelMode: 'DRIVING', fields: ['path', 'legs', 'viewport'], }; // Call computeRoutes to get the directions. const result = await Route.computeRoutes(request); if (!result.routes || result.routes.length === 0) { console.warn('No routes found'); return; } // Alter style based on marker index. function markerOptionsMaker( defaultOptions: google.maps.marker.AdvancedMarkerElementOptions, waypointMarkerDetails: google.maps.routes.WaypointMarkerDetails ) { const { index, totalMarkers } = waypointMarkerDetails; // Style the origin waypoint. if (index === 0) { return { ...defaultOptions, title: 'Origin', map: innerMap, gmpClickable: true, content: new PinElement({ glyphText: (index + 1).toString(), glyphColor: 'white', background: 'green', borderColor: 'green', scale: 1.5, }), }; } // Style all intermediate waypoints. if (!(index === 0 || index === totalMarkers - 1)) { return { ...defaultOptions, title: `Waypoint ${(index + 1).toString()}`, // Provide label for screenreaders map: innerMap, gmpClickable: true, // Make marker focusable and allow keyboard navigation content: new PinElement({ glyphText: (index + 1).toString(), glyphColor: 'white', background: 'blue', borderColor: 'blue', scale: 1.5, // Increase size for better visibilty }), }; } // Style the destination waypoint. if (index === totalMarkers - 1) { return { ...defaultOptions, title: 'Destination', map: innerMap, gmpClickable: true, content: new PinElement({ glyphText: (index + 1).toString(), glyphColor: 'white', background: 'red', borderColor: 'red', scale: 1.5, }), }; } return { ...defaultOptions, map: innerMap }; } await result.routes[0].createWaypointAdvancedMarkers(markerOptionsMaker); // Fit the map to the route. innerMap.fitBounds(result.routes[0].viewport!); innerMap.setHeading(270); // Create polylines and add them to the map. mapPolylines = result.routes[0].createPolylines(); mapPolylines.forEach((polyline) => { polyline.setMap(innerMap); }); } void init();
জাভাস্ক্রিপ্ট
let mapPolylines = []; const mapElement = document.querySelector('gmp-map'); let innerMap; // Initialize and add the map. async function init() { // Request the needed libraries. const [{ event }] = await Promise.all([ google.maps.importLibrary('core'), google.maps.importLibrary('maps'), ]); innerMap = mapElement.innerMap; innerMap.setOptions({ mapTypeControl: false, mapId: 'DEMO_MAP_ID', }); // Call the function after the map is loaded. event.addListenerOnce(innerMap, 'idle', () => { void getDirections(); }); } async function getDirections() { // Request the needed libraries. const [{ Route }, { PinElement }] = await Promise.all([ google.maps.importLibrary('routes'), google.maps.importLibrary('marker'), ]); // Define routes request with an intermediate stop. const request = { origin: 'Parking lot, Christmas Tree Point Rd, San Francisco, CA 94131', destination: '100 Spinnaker Dr, Sausalito, CA 94965', // We're having a yummy lunch! intermediates: [{ location: '300 Finley Rd San Francisco, CA 94129' }], // But first, we golf! travelMode: 'DRIVING', fields: ['path', 'legs', 'viewport'], }; // Call computeRoutes to get the directions. const result = await Route.computeRoutes(request); if (!result.routes || result.routes.length === 0) { console.warn('No routes found'); return; } // Alter style based on marker index. function markerOptionsMaker(defaultOptions, waypointMarkerDetails) { const { index, totalMarkers } = waypointMarkerDetails; // Style the origin waypoint. if (index === 0) { return { ...defaultOptions, title: 'Origin', map: innerMap, gmpClickable: true, content: new PinElement({ glyphText: (index + 1).toString(), glyphColor: 'white', background: 'green', borderColor: 'green', scale: 1.5, }), }; } // Style all intermediate waypoints. if (!(index === 0 || index === totalMarkers - 1)) { return { ...defaultOptions, title: `Waypoint ${(index + 1).toString()}`, // Provide label for screenreaders map: innerMap, gmpClickable: true, // Make marker focusable and allow keyboard navigation content: new PinElement({ glyphText: (index + 1).toString(), glyphColor: 'white', background: 'blue', borderColor: 'blue', scale: 1.5, // Increase size for better visibilty }), }; } // Style the destination waypoint. if (index === totalMarkers - 1) { return { ...defaultOptions, title: 'Destination', map: innerMap, gmpClickable: true, content: new PinElement({ glyphText: (index + 1).toString(), glyphColor: 'white', background: 'red', borderColor: 'red', scale: 1.5, }), }; } return { ...defaultOptions, map: innerMap }; } await result.routes[0].createWaypointAdvancedMarkers(markerOptionsMaker); // Fit the map to the route. innerMap.fitBounds(result.routes[0].viewport); innerMap.setHeading(270); // Create polylines and add them to the map. mapPolylines = result.routes[0].createPolylines(); mapPolylines.forEach((polyline) => { polyline.setMap(innerMap); }); } void init();
CSS
/* * Always set the map height explicitly to define the size of the div element * that contains the map. */ #map { height: 100%; } /* * Optional: Makes the sample page fill the window. */ html, body { height: 100%; margin: 0; padding: 0; }
HTML
<html>
<head>
<title>Get directions</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.447646, -122.113878" zoom="12"></gmp-map>
</body>
</html>