Skip to content

Commit 81855f0

Browse files
authored
Add start and end comments for routes example HTML (#791)
* Add start and end comments for routes example HTML * Fix typo in destinationAutocompleteSelection variable * Fix typo in destinationAutocomplete variable name
1 parent 79d2e1a commit 81855f0

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

samples/routes-compute-routes/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Copyright 2025 Google LLC. All Rights Reserved.
55
SPDX-License-Identifier: Apache-2.0
66
-->
7+
<!-- [START maps_routes_compute_routes] -->
78
<html>
89

910
<head>
@@ -306,4 +307,5 @@ <h3>Fields</h3>
306307
<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)) })
307308
({ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8", v: "beta" });</script>
308309
</body>
309-
</html>
310+
</html>
311+
<!-- [END maps_routes_compute_routes] -->

samples/routes-compute-routes/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const originAutocompleteSelection: PlaceAutocompleteSelection = {
1717
predictionText: null,
1818
location: null,
1919
};
20-
const destinationAUtocompleteSelection: PlaceAutocompleteSelection = {
20+
const destinationAutocompleteSelection: PlaceAutocompleteSelection = {
2121
predictionText: null,
2222
location: null,
2323
};
@@ -118,7 +118,7 @@ async function init() {
118118
},
119119
destination: {
120120
location: buildComputeRoutesLocation(
121-
destinationAUtocompleteSelection,
121+
destinationAutocompleteSelection,
122122
formData.get('destination_location'),
123123
formData.get('heading_dest'),
124124
travelMode,
@@ -491,7 +491,7 @@ async function init() {
491491

492492
[
493493
[originAutocomplete, originAutocompleteSelection],
494-
[destinationAutocomplete, destinationAUtocompleteSelection],
494+
[destinationAutocomplete, destinationAutocompleteSelection],
495495
].forEach(([autocomplete, autocompleteData]) => {
496496
autocomplete.addEventListener(
497497
'gmp-select',

0 commit comments

Comments
 (0)