diff --git a/dist/index.html b/dist/index.html index d8e13271d..37cbb7ab5 100644 --- a/dist/index.html +++ b/dist/index.html @@ -101,6 +101,7 @@

Maps JSAPI Samples

  • hiding-features
  • infowindow-simple
  • js-api-loader-map
  • +
  • layer-bicycling
  • layer-data-event
  • layer-data-quakes-red
  • layer-data-quakes-simple
  • diff --git a/dist/samples/layer-bicycling/app/.eslintsrc.json b/dist/samples/layer-bicycling/app/.eslintsrc.json new file mode 100644 index 000000000..4c44dab04 --- /dev/null +++ b/dist/samples/layer-bicycling/app/.eslintsrc.json @@ -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 + } +} diff --git a/dist/samples/layer-bicycling/app/README.md b/dist/samples/layer-bicycling/app/README.md new file mode 100644 index 000000000..25c38bc11 --- /dev/null +++ b/dist/samples/layer-bicycling/app/README.md @@ -0,0 +1,41 @@ +# Google Maps JavaScript Sample + +## layer-bicycling + +Bicycling layer sample. + +## Setup + +### Before starting run: + +`npm i` + +### Run an example on a local web server + +`cd samples/layer-bicycling` +`npm start` + +### Build an individual example + +`cd samples/layer-bicycling` +`npm run build` + +From 'samples': + +`npm run build --workspace=layer-bicycling/` + +### Build all of the examples. + +From 'samples': + +`npm run build-all` + +### Run lint to check for problems + +`cd samples/layer-bicycling` +`npx eslint index.ts` + +## Feedback + +For feedback related to this sample, please open a new issue on +[GitHub](https://github.com/googlemaps-samples/js-api-samples/issues). diff --git a/dist/samples/layer-bicycling/app/index.html b/dist/samples/layer-bicycling/app/index.html new file mode 100644 index 000000000..c154bd45e --- /dev/null +++ b/dist/samples/layer-bicycling/app/index.html @@ -0,0 +1,28 @@ + + + + + + Bicycle Layer + + + + + + + + + + diff --git a/dist/samples/layer-bicycling/app/index.ts b/dist/samples/layer-bicycling/app/index.ts new file mode 100644 index 000000000..04d08b5d7 --- /dev/null +++ b/dist/samples/layer-bicycling/app/index.ts @@ -0,0 +1,20 @@ +/** + * @license + * Copyright 2026 Google LLC. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +// [START maps_layer_bicycling] +async function init(): Promise { + const { BicyclingLayer } = await google.maps.importLibrary('maps'); + + const mapElement = document.querySelector('gmp-map')!; + const innerMap = mapElement.innerMap; + + const bikeLayer = new BicyclingLayer(); + + bikeLayer.setMap(innerMap); +} + +void init(); +// [END maps_layer_bicycling] diff --git a/dist/samples/layer-bicycling/app/package.json b/dist/samples/layer-bicycling/app/package.json new file mode 100644 index 000000000..d9f99667c --- /dev/null +++ b/dist/samples/layer-bicycling/app/package.json @@ -0,0 +1,12 @@ +{ + "name": "@js-api-samples/layer-bicycling", + "version": "1.0.0", + "scripts": { + "build": "bash ../build-single.sh", + "test": "tsc && npm run build:vite --workspace=.", + "start": "tsc && vite build --config ../../vite.config.js --base './' && vite --config ../../vite.config.js", + "build:vite": "vite build --config ../../vite.config.js --base './'", + "preview": "vite preview --config ../../vite.config.js" + }, + "author": "Google LLC" +} diff --git a/dist/samples/layer-bicycling/app/style.css b/dist/samples/layer-bicycling/app/style.css new file mode 100644 index 000000000..574dd8eae --- /dev/null +++ b/dist/samples/layer-bicycling/app/style.css @@ -0,0 +1,17 @@ +/** + * @license + * Copyright 2026 Google LLC. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +/* [START maps_layer_bicycling] */ +/* + * Optional: Makes the sample page fill the window. + */ +html, +body { + height: 100%; + margin: 0; + padding: 0; +} + +/* [END maps_layer_bicycling] */ diff --git a/dist/samples/layer-bicycling/app/tsconfig.json b/dist/samples/layer-bicycling/app/tsconfig.json new file mode 100644 index 000000000..976bcc6ef --- /dev/null +++ b/dist/samples/layer-bicycling/app/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "rootDir": "." + }, + "include": ["./*.ts"] +} diff --git a/dist/samples/layer-bicycling/dist/assets/index-549u98Rk.css b/dist/samples/layer-bicycling/dist/assets/index-549u98Rk.css new file mode 100644 index 000000000..37abb1c40 --- /dev/null +++ b/dist/samples/layer-bicycling/dist/assets/index-549u98Rk.css @@ -0,0 +1 @@ +html,body{height:100%;margin:0;padding:0} diff --git a/dist/samples/layer-bicycling/dist/assets/index-DlYepHWl.js b/dist/samples/layer-bicycling/dist/assets/index-DlYepHWl.js new file mode 100644 index 000000000..92b6efc32 --- /dev/null +++ b/dist/samples/layer-bicycling/dist/assets/index-DlYepHWl.js @@ -0,0 +1 @@ +(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();async function e(){let{BicyclingLayer:e}=await google.maps.importLibrary(`maps`),t=document.querySelector(`gmp-map`).innerMap;new e().setMap(t)}e(); \ No newline at end of file diff --git a/dist/samples/layer-bicycling/dist/index.html b/dist/samples/layer-bicycling/dist/index.html new file mode 100644 index 000000000..8f42c6c10 --- /dev/null +++ b/dist/samples/layer-bicycling/dist/index.html @@ -0,0 +1,28 @@ + + + + + + Bicycle Layer + + + + + + + + + + diff --git a/dist/samples/layer-bicycling/docs/index.html b/dist/samples/layer-bicycling/docs/index.html new file mode 100644 index 000000000..c154bd45e --- /dev/null +++ b/dist/samples/layer-bicycling/docs/index.html @@ -0,0 +1,28 @@ + + + + + + Bicycle Layer + + + + + + + + + + diff --git a/dist/samples/layer-bicycling/docs/index.js b/dist/samples/layer-bicycling/docs/index.js new file mode 100644 index 000000000..85d7f4a22 --- /dev/null +++ b/dist/samples/layer-bicycling/docs/index.js @@ -0,0 +1,21 @@ +'use strict'; +/** + * @license + * Copyright 2026 Google LLC. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +// [START maps_layer_bicycling] +async function init() { + const { BicyclingLayer } = await google.maps.importLibrary('maps'); + + const mapElement = document.querySelector('gmp-map'); + const innerMap = mapElement.innerMap; + + const bikeLayer = new BicyclingLayer(); + + bikeLayer.setMap(innerMap); +} + +void init(); +// [END maps_layer_bicycling] diff --git a/dist/samples/layer-bicycling/docs/index.ts b/dist/samples/layer-bicycling/docs/index.ts new file mode 100644 index 000000000..04d08b5d7 --- /dev/null +++ b/dist/samples/layer-bicycling/docs/index.ts @@ -0,0 +1,20 @@ +/** + * @license + * Copyright 2026 Google LLC. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +// [START maps_layer_bicycling] +async function init(): Promise { + const { BicyclingLayer } = await google.maps.importLibrary('maps'); + + const mapElement = document.querySelector('gmp-map')!; + const innerMap = mapElement.innerMap; + + const bikeLayer = new BicyclingLayer(); + + bikeLayer.setMap(innerMap); +} + +void init(); +// [END maps_layer_bicycling] diff --git a/dist/samples/layer-bicycling/docs/style.css b/dist/samples/layer-bicycling/docs/style.css new file mode 100644 index 000000000..574dd8eae --- /dev/null +++ b/dist/samples/layer-bicycling/docs/style.css @@ -0,0 +1,17 @@ +/** + * @license + * Copyright 2026 Google LLC. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ +/* [START maps_layer_bicycling] */ +/* + * Optional: Makes the sample page fill the window. + */ +html, +body { + height: 100%; + margin: 0; + padding: 0; +} + +/* [END maps_layer_bicycling] */ diff --git a/dist/samples/layer-bicycling/jsfiddle/demo.css b/dist/samples/layer-bicycling/jsfiddle/demo.css new file mode 100644 index 000000000..cd422b689 --- /dev/null +++ b/dist/samples/layer-bicycling/jsfiddle/demo.css @@ -0,0 +1,15 @@ +/** + * @license + * Copyright 2026 Google LLC. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * Optional: Makes the sample page fill the window. + */ +html, +body { + height: 100%; + margin: 0; + padding: 0; +} diff --git a/dist/samples/layer-bicycling/jsfiddle/demo.details b/dist/samples/layer-bicycling/jsfiddle/demo.details new file mode 100644 index 000000000..cce78b2ea --- /dev/null +++ b/dist/samples/layer-bicycling/jsfiddle/demo.details @@ -0,0 +1,7 @@ +name: layer-bicycling +authors: + - Geo Developer IX Documentation Team +tags: + - google maps +load_type: h +description: Sample code supporting Google Maps Platform JavaScript API documentation. diff --git a/dist/samples/layer-bicycling/jsfiddle/demo.html b/dist/samples/layer-bicycling/jsfiddle/demo.html new file mode 100644 index 000000000..64b349afe --- /dev/null +++ b/dist/samples/layer-bicycling/jsfiddle/demo.html @@ -0,0 +1,27 @@ + + + + + + Bicycle Layer + + + + + + + + + diff --git a/dist/samples/layer-bicycling/jsfiddle/demo.js b/dist/samples/layer-bicycling/jsfiddle/demo.js new file mode 100644 index 000000000..ba86c1fe1 --- /dev/null +++ b/dist/samples/layer-bicycling/jsfiddle/demo.js @@ -0,0 +1,19 @@ +'use strict'; +/** + * @license + * Copyright 2026 Google LLC. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +async function init() { + const { BicyclingLayer } = await google.maps.importLibrary('maps'); + + const mapElement = document.querySelector('gmp-map'); + const innerMap = mapElement.innerMap; + + const bikeLayer = new BicyclingLayer(); + + bikeLayer.setMap(innerMap); +} + +void init(); diff --git a/index.html b/index.html index d8e13271d..37cbb7ab5 100644 --- a/index.html +++ b/index.html @@ -101,6 +101,7 @@

    Maps JSAPI Samples

  • hiding-features
  • infowindow-simple
  • js-api-loader-map
  • +
  • layer-bicycling
  • layer-data-event
  • layer-data-quakes-red
  • layer-data-quakes-simple