Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ <h1>Maps JSAPI Samples</h1>
<li><a href='/samples/ui-kit-place-details-compact/dist'>ui-kit-place-details-compact</a></li>
<li><a href='/samples/ui-kit-place-search-nearby/dist'>ui-kit-place-search-nearby</a></li>
<li><a href='/samples/ui-kit-place-search-text/dist'>ui-kit-place-search-text</a></li>
<li><a href='/samples/ui-kit-place-search-text-compact/dist'>ui-kit-place-search-text-compact</a></li>
<li><a href='/samples/weather-api-current-compact/dist'>weather-api-current-compact</a></li>
</ul>
</body>
Expand Down
13 changes: 13 additions & 0 deletions dist/samples/ui-kit-place-search-text-compact/app/.eslintsrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": [
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"rules": {
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/no-this-alias": 1,
"@typescript-eslint/no-empty-function": 1,
"@typescript-eslint/explicit-module-boundary-types": 1,
"@typescript-eslint/no-unused-vars": 1
}
}
33 changes: 33 additions & 0 deletions dist/samples/ui-kit-place-search-text-compact/app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Google Maps JavaScript Sample

This sample is generated from @googlemaps/js-samples located at
https://github.com/googlemaps-samples/js-api-samples.

## Setup

### Before starting run:

`$npm i`

### Run an example on a local web server

First `cd` to the folder for the sample to run, then:

`$npm start`

### Build an individual example

From `samples/`:

`$npm run build --workspace=sample-name/`

### Build all of the examples.

From `samples/`:
`$npm run build-all`

## Feedback

For feedback related to this sample, please open a new issue on
[GitHub](https://github.com/googlemaps-samples/js-api-samples/issues).

44 changes: 44 additions & 0 deletions dist/samples/ui-kit-place-search-text-compact/app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!--
@license
Copyright 2025 Google LLC. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
-->
<!--[START maps_ui_kit_place_search_text_compact] -->
<!DOCTYPE html>
<html>
<head>
<title>Places UI Kit: Place (text) search with Place Details Compact</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="map-container"></div>
<div class="controls">
<input type="text" class="query-input" />
<button class="search-button">Search</button>
</div>
<div class="list-container">
<gmp-place-search orientation="horizontal" selectable>
<gmp-place-all-content> </gmp-place-all-content>
<gmp-place-text-search-request></gmp-place-text-search-request>
</gmp-place-search>
<p class="warning">Looked for it, didn't find it. Let's try something else.</p>
</div>

<div id="details-container">
<gmp-place-details-compact orientation="horizontal">
<gmp-place-details-place-request></gmp-place-details-place-request>
<gmp-place-all-content></gmp-place-all-content>
</gmp-place-details-compact>
</div>

<script>
(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: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8",
v: "alpha"
});
</script>
<script type="text/JavaScript" src="app.js"></script>
</body>
</html>
<!--[END maps_ui_kit_place_search_text_compact] -->
15 changes: 15 additions & 0 deletions dist/samples/ui-kit-place-search-text-compact/app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@js-api-samples/ui-kit-place-search-text-compact",
"version": "1.0.0",
"scripts": {
"build": "tsc && bash ../jsfiddle.sh ui-kit-place-search-text-compact && bash ../app.sh ui-kit-place-search-text-compact && bash ../docs.sh ui-kit-place-search-text-compact && npm run build:vite --workspace=. && bash ../dist.sh ui-kit-place-search-text-compact",
"test": "tsc && npm run build:vite --workspace=.",
"start": "tsc && vite build --base './' && vite",
"build:vite": "vite build --base './'",
"preview": "vite preview"
},
"dependencies": {

}
}

115 changes: 115 additions & 0 deletions dist/samples/ui-kit-place-search-text-compact/app/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/*
* @license
* Copyright 2025 Google LLC. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
/* [START maps_ui_kit_place_search_text_compact] */

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

body {
display: flex;
flex-direction: column;
font-family: Arial, Helvetica, sans-serif;
}

h1 {
font-size: 16px;
text-align: center;
}

#map-container {
box-sizing: border-box;
width: 100%;
height: 100vh;
}

.warning {
color: red;
position: absolute;
top: 50px;
display: none;
}

.controls {
display: flex;
gap: 10px;
padding: 20px;
margin-top: 20px;
height: 32px;
background-color: #f3f3f3;
border-radius: 20px;
position: absolute;
top: 10px;
left: 50%;
margin-left: -260px;
}

.search-button {
background-color: #4b4b4b;
color: #fff;
border: 1px solid #ccc;
border-radius: 5px;
width: 80px;
}

.query-input {
border: 1px solid #ccc;
border-radius: 5px;
flex-grow: 1;
padding: 10px;
width: 400px;
}

.list-container {
display: flex;
justify-content: center;
position: relative;
}

gmp-place-search {
width: 100%;
margin: 10px;
min-height: 414px;
display: none;
border: none;
}

gmp-place-details-compact {
width: 350px;
max-height: 800px;
margin-right: 20px;
display: none;
border: none;
}

gmp-place-details-compact::after {
content: '';
position: absolute;
bottom: -13px;
left: 50%;
transform: translateX(-50%);
width: 20px;
height: 20px;
background-color: white;
box-shadow: 2px 2px 5px 0px rgba(0,0,0,0.2);
z-index: 1;
clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
transform-origin: center center;
}

@media (prefers-color-scheme: dark) {
/* Style for Dark mode */
gmp-place-details-compact::after {
background-color: #131314;
}
}

.vAygCK-api-load-alpha-banner {
display: none;
}
/* [END maps_ui_kit_place_search_text_compact] */
17 changes: 17 additions & 0 deletions dist/samples/ui-kit-place-search-text-compact/app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"module": "esnext",
"target": "esnext",
"strict": true,
"noImplicitAny": false,
"lib": [
"es2015",
"esnext",
"es6",
"dom",
"dom.iterable"
],
"moduleResolution": "Node",
"jsx": "preserve"
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions dist/samples/ui-kit-place-search-text-compact/dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!--
@license
Copyright 2025 Google LLC. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
-->
<!--[START maps_ui_kit_place_search_text_compact] -->
<!DOCTYPE html>
<html>
<head>
<title>Places UI Kit: Place (text) search with Place Details Compact</title>
<meta charset="utf-8">
<link rel="stylesheet" crossorigin href="./assets/index-xPIYwYQR.css">
</head>
<body>
<div id="map-container"></div>
<div class="controls">
<input type="text" class="query-input" />
<button class="search-button">Search</button>
</div>
<div class="list-container">
<gmp-place-search orientation="horizontal" selectable>
<gmp-place-all-content> </gmp-place-all-content>
<gmp-place-text-search-request></gmp-place-text-search-request>
</gmp-place-search>
<p class="warning">Looked for it, didn't find it. Let's try something else.</p>
</div>

<div id="details-container">
<gmp-place-details-compact orientation="horizontal">
<gmp-place-details-place-request></gmp-place-details-place-request>
<gmp-place-all-content></gmp-place-all-content>
</gmp-place-details-compact>
</div>

<script>
(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: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8",
v: "alpha"
});
</script>
<script type="text/JavaScript" src="app.js"></script>
</body>
</html>
<!--[END maps_ui_kit_place_search_text_compact] -->
44 changes: 44 additions & 0 deletions dist/samples/ui-kit-place-search-text-compact/docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!--
@license
Copyright 2025 Google LLC. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
-->
<!--[START maps_ui_kit_place_search_text_compact] -->
<!DOCTYPE html>
<html>
<head>
<title>Places UI Kit: Place (text) search with Place Details Compact</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="map-container"></div>
<div class="controls">
<input type="text" class="query-input" />
<button class="search-button">Search</button>
</div>
<div class="list-container">
<gmp-place-search orientation="horizontal" selectable>
<gmp-place-all-content> </gmp-place-all-content>
<gmp-place-text-search-request></gmp-place-text-search-request>
</gmp-place-search>
<p class="warning">Looked for it, didn't find it. Let's try something else.</p>
</div>

<div id="details-container">
<gmp-place-details-compact orientation="horizontal">
<gmp-place-details-place-request></gmp-place-details-place-request>
<gmp-place-all-content></gmp-place-all-content>
</gmp-place-details-compact>
</div>

<script>
(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: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8",
v: "alpha"
});
</script>
<script type="text/JavaScript" src="app.js"></script>
</body>
</html>
<!--[END maps_ui_kit_place_search_text_compact] -->
Loading