function initMap5() { const localContextMapView = new google.maps.localContext.LocalContextMapView({ element: document.getElementById("mapviewer"), placeTypePreferences: [ { type: "shopping_mall", weight: 1 }, ], maxPlaceCount: 24, directionsOptions: { origin: center }, placeChooserViewSetup: ({defaultLayoutMode}) => { if (defaultLayoutMode === 'SHEET') { return {position: 'BLOCK_END'}; } }, placeDetailsViewSetup: ({defaultLayoutMode}) => { if (defaultLayoutMode === 'SHEET') { return {layoutMode: 'INFO_WINDOW'}; } }, }); map = localContextMapView.map; // Trigger hidePlaceDetailsView() with a click event handler on the inner map. map.addListener("click", () => { localContextMapView.hidePlaceDetailsView(); }); // Set inner map options. map.setOptions({ center: center, zoom: 14, }); new google.maps.Marker({ position: center, map: map, animation: google.maps.Animation.DROP, zIndex: 30, }); }