From b7f78879a967f8bbc5bf35dcfecef89a087c99b8 Mon Sep 17 00:00:00 2001 From: googlemaps-bot Date: Thu, 7 May 2026 15:59:29 +0000 Subject: [PATCH] Update dist folder [skip ci] --- .../3d-accessibility-features/app/index.ts | 4 ++-- .../3d-accessibility-features/docs/index.js | 4 ++-- .../3d-accessibility-features/docs/index.ts | 4 ++-- .../jsfiddle/demo.js | 4 ++-- dist/samples/3d-camera-boundary/app/index.ts | 4 ++-- dist/samples/3d-camera-boundary/docs/index.js | 4 ++-- dist/samples/3d-camera-boundary/docs/index.ts | 4 ++-- .../3d-camera-boundary/jsfiddle/demo.js | 4 ++-- dist/samples/3d-camera-center/app/index.ts | 4 ++-- dist/samples/3d-camera-center/docs/index.js | 4 ++-- dist/samples/3d-camera-center/docs/index.ts | 4 ++-- .../samples/3d-camera-center/jsfiddle/demo.js | 4 ++-- dist/samples/3d-coverage-map/app/index.ts | 4 ++-- dist/samples/3d-coverage-map/docs/index.js | 4 ++-- dist/samples/3d-coverage-map/docs/index.ts | 4 ++-- dist/samples/3d-coverage-map/jsfiddle/demo.js | 4 ++-- dist/samples/3d-localization/app/index.ts | 4 ++-- dist/samples/3d-localization/docs/index.js | 4 ++-- dist/samples/3d-localization/docs/index.ts | 4 ++-- dist/samples/3d-localization/jsfiddle/demo.js | 4 ++-- dist/samples/3d-map-styling/app/index.ts | 4 ++-- dist/samples/3d-map-styling/docs/index.js | 4 ++-- dist/samples/3d-map-styling/docs/index.ts | 4 ++-- dist/samples/3d-map-styling/jsfiddle/demo.js | 4 ++-- .../3d-marker-click-event/app/index.ts | 4 ++-- .../3d-marker-click-event/docs/index.js | 4 ++-- .../3d-marker-click-event/docs/index.ts | 4 ++-- .../3d-marker-click-event/jsfiddle/demo.js | 4 ++-- dist/samples/3d-mesh-flatten/app/index.ts | 4 ++-- dist/samples/3d-mesh-flatten/docs/index.js | 4 ++-- dist/samples/3d-mesh-flatten/docs/index.ts | 4 ++-- dist/samples/3d-mesh-flatten/jsfiddle/demo.js | 4 ++-- dist/samples/3d-simple-map/app/index.ts | 4 ++-- dist/samples/3d-simple-map/docs/index.js | 4 ++-- dist/samples/3d-simple-map/docs/index.ts | 4 ++-- dist/samples/3d-simple-map/jsfiddle/demo.js | 4 ++-- dist/samples/add-map/app/index.ts | 8 +++---- .../{index-D6lQKzhm.js => index-PY_yKy4N.js} | 2 +- dist/samples/add-map/dist/index.html | 2 +- dist/samples/add-map/docs/index.js | 8 +++---- dist/samples/add-map/docs/index.ts | 8 +++---- dist/samples/add-map/jsfiddle/demo.js | 8 +++---- .../app/index.ts | 4 ++-- .../docs/index.js | 4 ++-- .../docs/index.ts | 4 ++-- .../jsfiddle/demo.js | 4 ++-- .../advanced-markers-altitude/app/index.ts | 8 +++---- .../{index-BUhARZme.js => index-D24icea5.js} | 2 +- .../advanced-markers-altitude/dist/index.html | 2 +- .../advanced-markers-altitude/docs/index.js | 8 +++---- .../advanced-markers-altitude/docs/index.ts | 8 +++---- .../jsfiddle/demo.js | 8 +++---- .../advanced-markers-animation/app/index.ts | 6 ++--- .../advanced-markers-animation/docs/index.js | 6 ++--- .../advanced-markers-animation/docs/index.ts | 6 ++--- .../jsfiddle/demo.js | 6 ++--- .../advanced-markers-basic-style/app/index.ts | 8 +++---- .../dist/assets/index-C86JjmJl.js | 1 + .../dist/assets/index-Cs7O-C5Y.js | 1 - .../dist/index.html | 2 +- .../docs/index.js | 8 +++---- .../docs/index.ts | 8 +++---- .../jsfiddle/demo.js | 8 +++---- .../advanced-markers-collision/app/index.ts | 9 ++++---- .../dist/assets/index-CDpfhitr.js | 1 + .../dist/assets/index-DHUV3LrM.js | 1 - .../dist/index.html | 2 +- .../advanced-markers-collision/docs/index.js | 10 ++++----- .../advanced-markers-collision/docs/index.ts | 9 ++++---- .../jsfiddle/demo.js | 11 ++++------ .../advanced-markers-draggable/app/index.ts | 4 ++-- .../advanced-markers-draggable/docs/index.js | 4 ++-- .../advanced-markers-draggable/docs/index.ts | 4 ++-- .../jsfiddle/demo.js | 4 ++-- .../advanced-markers-graphics/app/index.ts | 8 +++---- .../dist/assets/index-Sbzf46WX.js | 1 + .../dist/assets/index-ew87NHl3.js | 1 - .../advanced-markers-graphics/dist/index.html | 2 +- .../advanced-markers-graphics/docs/index.js | 8 +++---- .../advanced-markers-graphics/docs/index.ts | 8 +++---- .../jsfiddle/demo.js | 8 +++---- .../advanced-markers-html-simple/app/index.ts | 8 +++---- .../{index-CIdISgjL.js => index-CTJOR8W2.js} | 2 +- .../dist/index.html | 2 +- .../docs/index.js | 8 +++---- .../docs/index.ts | 8 +++---- .../jsfiddle/demo.js | 8 +++---- .../advanced-markers-html/app/index.ts | 4 ++-- .../advanced-markers-html/docs/index.js | 4 ++-- .../advanced-markers-html/docs/index.ts | 4 ++-- .../advanced-markers-html/jsfiddle/demo.js | 4 ++-- .../advanced-markers-simple/app/index.ts | 8 +++---- .../{index-CaRm1bTX.js => index-DXcope9R.js} | 2 +- .../advanced-markers-simple/dist/index.html | 2 +- .../advanced-markers-simple/docs/index.js | 8 +++---- .../advanced-markers-simple/docs/index.ts | 8 +++---- .../advanced-markers-simple/jsfiddle/demo.js | 8 +++---- .../advanced-markers-zoom/app/index.ts | 8 +++---- .../dist/assets/index-BBSizdLT.js | 1 - .../dist/assets/index-Cvw2Ct9s.js | 1 + .../advanced-markers-zoom/dist/index.html | 2 +- .../advanced-markers-zoom/docs/index.js | 8 +++---- .../advanced-markers-zoom/docs/index.ts | 8 +++---- .../advanced-markers-zoom/jsfiddle/demo.js | 8 +++---- .../ai-powered-summaries-basic/app/index.ts | 8 +++---- .../ai-powered-summaries-basic/docs/index.js | 4 ++-- .../ai-powered-summaries-basic/docs/index.ts | 8 +++---- .../jsfiddle/demo.js | 4 ++-- .../samples/ai-powered-summaries/app/index.ts | 10 ++++----- .../ai-powered-summaries/docs/index.js | 4 ++-- .../ai-powered-summaries/docs/index.ts | 10 ++++----- .../ai-powered-summaries/jsfiddle/demo.js | 4 ++-- .../boundaries-choropleth/app/index.ts | 4 ++-- .../boundaries-choropleth/docs/index.js | 4 ++-- .../boundaries-choropleth/docs/index.ts | 4 ++-- .../boundaries-choropleth/jsfiddle/demo.js | 4 ++-- dist/samples/boundaries-click/app/index.ts | 6 ++--- dist/samples/boundaries-click/docs/index.js | 4 ++-- dist/samples/boundaries-click/docs/index.ts | 6 ++--- .../samples/boundaries-click/jsfiddle/demo.js | 4 ++-- dist/samples/boundaries-simple/app/index.ts | 4 ++-- dist/samples/boundaries-simple/docs/index.js | 4 ++-- dist/samples/boundaries-simple/docs/index.ts | 4 ++-- .../boundaries-simple/jsfiddle/demo.js | 4 ++-- .../boundaries-text-search/app/index.ts | 8 +++---- .../boundaries-text-search/docs/index.js | 4 ++-- .../boundaries-text-search/docs/index.ts | 8 +++---- .../boundaries-text-search/jsfiddle/demo.js | 4 ++-- dist/samples/circle-simple/app/index.ts | 10 ++++----- dist/samples/circle-simple/docs/index.js | 8 +++---- dist/samples/circle-simple/docs/index.ts | 10 ++++----- dist/samples/circle-simple/jsfiddle/demo.js | 8 +++---- .../control-bounds-restriction/app/index.ts | 6 ++--- .../control-bounds-restriction/docs/index.js | 4 ++-- .../control-bounds-restriction/docs/index.ts | 6 ++--- .../jsfiddle/demo.js | 4 ++-- .../samples/control-custom-state/app/index.ts | 11 ++++++---- .../control-custom-state/docs/index.js | 9 +++++--- .../control-custom-state/docs/index.ts | 11 ++++++---- .../control-custom-state/jsfiddle/demo.js | 9 +++++--- dist/samples/control-disableUI/app/index.ts | 4 ++-- dist/samples/control-disableUI/docs/index.js | 4 ++-- dist/samples/control-disableUI/docs/index.ts | 4 ++-- .../control-disableUI/jsfiddle/demo.js | 4 ++-- dist/samples/control-options/app/index.ts | 4 ++-- dist/samples/control-options/docs/index.js | 4 ++-- dist/samples/control-options/docs/index.ts | 4 ++-- dist/samples/control-options/jsfiddle/demo.js | 4 ++-- .../control-positioning-labels/app/index.ts | 8 +++---- .../{index-B0MmW35h.js => index-DGaMZhEd.js} | 2 +- .../dist/index.html | 2 +- .../control-positioning-labels/docs/index.js | 8 +++---- .../control-positioning-labels/docs/index.ts | 8 +++---- .../jsfiddle/demo.js | 8 +++---- dist/samples/control-positioning/app/index.ts | 6 ++--- .../samples/control-positioning/docs/index.js | 4 ++-- .../samples/control-positioning/docs/index.ts | 6 ++--- .../control-positioning/jsfiddle/demo.js | 4 ++-- dist/samples/control-replacement/app/index.ts | 10 ++++----- .../samples/control-replacement/docs/index.js | 10 ++++----- .../samples/control-replacement/docs/index.ts | 10 ++++----- .../control-replacement/jsfiddle/demo.js | 10 ++++----- dist/samples/control-simple/app/index.ts | 4 ++-- dist/samples/control-simple/docs/index.js | 4 ++-- dist/samples/control-simple/docs/index.ts | 4 ++-- dist/samples/control-simple/jsfiddle/demo.js | 4 ++-- dist/samples/dds-datasets-point/app/index.ts | 10 ++++----- .../{index-BiIKdmZq.js => index-BcBGGFO7.js} | 2 +- .../dds-datasets-point/dist/index.html | 2 +- dist/samples/dds-datasets-point/docs/index.js | 8 +++---- dist/samples/dds-datasets-point/docs/index.ts | 10 ++++----- .../dds-datasets-point/jsfiddle/demo.js | 8 +++---- .../dds-datasets-polygon-click/app/index.ts | 6 ++--- .../dds-datasets-polygon-click/docs/index.js | 4 ++-- .../dds-datasets-polygon-click/docs/index.ts | 6 ++--- .../jsfiddle/demo.js | 4 ++-- .../dds-datasets-polygon-colors/app/index.ts | 6 ++--- .../dds-datasets-polygon-colors/docs/index.js | 4 ++-- .../dds-datasets-polygon-colors/docs/index.ts | 6 ++--- .../jsfiddle/demo.js | 4 ++-- .../samples/dds-datasets-polygon/app/index.ts | 6 ++--- .../dds-datasets-polygon/docs/index.js | 4 ++-- .../dds-datasets-polygon/docs/index.ts | 6 ++--- .../dds-datasets-polygon/jsfiddle/demo.js | 4 ++-- .../dds-datasets-polyline/app/index.ts | 6 ++--- .../dds-datasets-polyline/docs/index.js | 4 ++-- .../dds-datasets-polyline/docs/index.ts | 6 ++--- .../dds-datasets-polyline/jsfiddle/demo.js | 4 ++-- dist/samples/dds-region-viewer/app/index.ts | 10 +++++---- dist/samples/dds-region-viewer/docs/index.js | 5 +++-- dist/samples/dds-region-viewer/docs/index.ts | 10 +++++---- .../dds-region-viewer/jsfiddle/demo.js | 5 +++-- dist/samples/deckgl-arclayer/app/index.ts | 6 +++-- dist/samples/deckgl-arclayer/docs/index.js | 5 +++-- dist/samples/deckgl-arclayer/docs/index.ts | 6 +++-- dist/samples/deckgl-arclayer/jsfiddle/demo.js | 5 +++-- dist/samples/deckgl-heatmap/app/index.ts | 6 +++-- dist/samples/deckgl-heatmap/docs/index.js | 6 ++--- dist/samples/deckgl-heatmap/docs/index.ts | 6 +++-- dist/samples/deckgl-heatmap/jsfiddle/demo.js | 6 ++--- dist/samples/deckgl-kml-updated/app/index.ts | 7 ++++-- dist/samples/deckgl-kml-updated/docs/index.js | 7 +++--- dist/samples/deckgl-kml-updated/docs/index.ts | 7 ++++-- .../deckgl-kml-updated/jsfiddle/demo.js | 6 ++--- dist/samples/deckgl-kml/app/index.ts | 11 ++++++---- dist/samples/deckgl-kml/docs/index.js | 11 +++++----- dist/samples/deckgl-kml/docs/index.ts | 11 ++++++---- dist/samples/deckgl-kml/jsfiddle/demo.js | 10 ++++----- dist/samples/deckgl-points/app/index.ts | 5 +++-- dist/samples/deckgl-points/docs/index.js | 4 ++-- dist/samples/deckgl-points/docs/index.ts | 5 +++-- dist/samples/deckgl-points/jsfiddle/demo.js | 4 ++-- dist/samples/deckgl-polygon/app/index.ts | 16 +++++--------- dist/samples/deckgl-polygon/docs/index.js | 11 ++++------ dist/samples/deckgl-polygon/docs/index.ts | 16 +++++--------- dist/samples/deckgl-polygon/jsfiddle/demo.js | 10 +++------ dist/samples/deckgl-tripslayer/app/index.ts | 4 ++-- dist/samples/deckgl-tripslayer/docs/index.js | 4 ++-- dist/samples/deckgl-tripslayer/docs/index.ts | 4 ++-- .../deckgl-tripslayer/jsfiddle/demo.js | 4 ++-- dist/samples/event-arguments/app/index.ts | 8 +++---- .../{index-DLnAWehh.js => index-l7pdboKs.js} | 2 +- dist/samples/event-arguments/dist/index.html | 2 +- dist/samples/event-arguments/docs/index.js | 8 +++---- dist/samples/event-arguments/docs/index.ts | 8 +++---- dist/samples/event-arguments/jsfiddle/demo.js | 8 +++---- dist/samples/event-click-latlng/app/index.ts | 4 ++-- dist/samples/event-click-latlng/docs/index.js | 4 ++-- dist/samples/event-click-latlng/docs/index.ts | 4 ++-- .../event-click-latlng/jsfiddle/demo.js | 4 ++-- dist/samples/event-closure/app/index.ts | 8 +++---- .../dist/assets/index-CguLmy-g.js | 1 + .../dist/assets/index-Drl7MJNE.js | 1 - dist/samples/event-closure/dist/index.html | 2 +- dist/samples/event-closure/docs/index.js | 8 +++---- dist/samples/event-closure/docs/index.ts | 8 +++---- dist/samples/event-closure/jsfiddle/demo.js | 8 +++---- dist/samples/event-poi/app/index.ts | 8 +++---- dist/samples/event-poi/docs/index.js | 4 ++-- dist/samples/event-poi/docs/index.ts | 8 +++---- dist/samples/event-poi/jsfiddle/demo.js | 4 ++-- dist/samples/event-properties/app/index.ts | 4 ++-- dist/samples/event-properties/docs/index.js | 4 ++-- dist/samples/event-properties/docs/index.ts | 4 ++-- .../samples/event-properties/jsfiddle/demo.js | 4 ++-- dist/samples/event-simple/app/index.ts | 8 +++---- .../{index-9XSPUjum.js => index-4-R800gu.js} | 2 +- dist/samples/event-simple/dist/index.html | 2 +- dist/samples/event-simple/docs/index.js | 8 +++---- dist/samples/event-simple/docs/index.ts | 8 +++---- dist/samples/event-simple/jsfiddle/demo.js | 8 +++---- .../app/index.ts | 4 ++-- .../docs/index.js | 4 ++-- .../docs/index.ts | 4 ++-- .../jsfiddle/demo.js | 4 ++-- dist/samples/geocoding-place-id/app/index.ts | 4 ++-- dist/samples/geocoding-place-id/docs/index.js | 4 ++-- dist/samples/geocoding-place-id/docs/index.ts | 4 ++-- .../geocoding-place-id/jsfiddle/demo.js | 4 ++-- dist/samples/geocoding-region-es/app/index.ts | 4 ++-- .../samples/geocoding-region-es/docs/index.js | 4 ++-- .../samples/geocoding-region-es/docs/index.ts | 4 ++-- .../geocoding-region-es/jsfiddle/demo.js | 4 ++-- dist/samples/geocoding-region-us/app/index.ts | 4 ++-- .../samples/geocoding-region-us/docs/index.js | 4 ++-- .../samples/geocoding-region-us/docs/index.ts | 4 ++-- .../geocoding-region-us/jsfiddle/demo.js | 4 ++-- dist/samples/geocoding-reverse/app/index.ts | 4 ++-- dist/samples/geocoding-reverse/docs/index.js | 4 ++-- dist/samples/geocoding-reverse/docs/index.ts | 4 ++-- .../geocoding-reverse/jsfiddle/demo.js | 4 ++-- dist/samples/geocoding-simple/app/index.ts | 10 ++++----- .../dist/assets/index--Xf9s_0d.js | 1 - .../dist/assets/index-TFN50Rj5.js | 1 + dist/samples/geocoding-simple/dist/index.html | 2 +- dist/samples/geocoding-simple/docs/index.js | 8 +++---- dist/samples/geocoding-simple/docs/index.ts | 10 ++++----- .../samples/geocoding-simple/jsfiddle/demo.js | 8 +++---- dist/samples/hiding-features/app/index.ts | 4 ++-- dist/samples/hiding-features/docs/index.js | 4 ++-- dist/samples/hiding-features/docs/index.ts | 4 ++-- dist/samples/hiding-features/jsfiddle/demo.js | 4 ++-- dist/samples/infowindow-simple/app/index.ts | 4 ++-- dist/samples/infowindow-simple/docs/index.js | 4 ++-- dist/samples/infowindow-simple/docs/index.ts | 4 ++-- .../infowindow-simple/jsfiddle/demo.js | 4 ++-- dist/samples/js-api-loader-map/app/index.ts | 4 ++-- dist/samples/js-api-loader-map/docs/index.js | 4 ++-- dist/samples/js-api-loader-map/docs/index.ts | 4 ++-- .../js-api-loader-map/jsfiddle/demo.js | 4 ++-- dist/samples/layer-data-event/app/index.ts | 4 ++-- dist/samples/layer-data-event/docs/index.js | 4 ++-- dist/samples/layer-data-event/docs/index.ts | 4 ++-- .../samples/layer-data-event/jsfiddle/demo.js | 4 ++-- .../layer-data-quakes-red/app/index.ts | 11 +++++----- .../{index-wSCHVohg.js => index-OTMI4Tta.js} | 2 +- .../layer-data-quakes-red/dist/index.html | 2 +- .../layer-data-quakes-red/docs/index.js | 9 ++++---- .../layer-data-quakes-red/docs/index.ts | 11 +++++----- .../layer-data-quakes-red/jsfiddle/demo.js | 9 ++++---- .../layer-data-quakes-simple/app/index.ts | 7 +++--- .../layer-data-quakes-simple/docs/index.js | 5 +++-- .../layer-data-quakes-simple/docs/index.ts | 7 +++--- .../layer-data-quakes-simple/jsfiddle/demo.js | 5 +++-- dist/samples/layer-data-simple/app/index.ts | 4 ++-- dist/samples/layer-data-simple/docs/index.js | 4 ++-- dist/samples/layer-data-simple/docs/index.ts | 4 ++-- .../layer-data-simple/jsfiddle/demo.js | 4 ++-- dist/samples/layer-data-style/app/index.ts | 8 +++---- .../{index-CkmsX2aC.js => index-Cve1kyUF.js} | 2 +- dist/samples/layer-data-style/dist/index.html | 2 +- dist/samples/layer-data-style/docs/index.js | 8 +++---- dist/samples/layer-data-style/docs/index.ts | 8 +++---- .../samples/layer-data-style/jsfiddle/demo.js | 8 +++---- dist/samples/map-events/app/index.ts | 4 ++-- dist/samples/map-events/docs/index.js | 4 ++-- dist/samples/map-events/docs/index.ts | 4 ++-- dist/samples/map-events/jsfiddle/demo.js | 4 ++-- .../map-projection-simple/app/index.ts | 4 ++-- .../map-projection-simple/docs/index.js | 4 ++-- .../map-projection-simple/docs/index.ts | 4 ++-- .../map-projection-simple/jsfiddle/demo.js | 4 ++-- dist/samples/map-simple-js/app/index.ts | 4 ++-- dist/samples/map-simple-js/docs/index.js | 4 ++-- dist/samples/map-simple-js/docs/index.ts | 4 ++-- dist/samples/map-simple-js/jsfiddle/demo.js | 4 ++-- dist/samples/map-simple/app/index.ts | 4 ++-- dist/samples/map-simple/docs/index.js | 4 ++-- dist/samples/map-simple/docs/index.ts | 4 ++-- dist/samples/map-simple/jsfiddle/demo.js | 4 ++-- .../place-autocomplete-basic-map/app/index.ts | 12 +++++----- .../dist/assets/index-CwdUD2Am.js | 1 + .../dist/assets/index-DeO0XQ2l.js | 1 - .../dist/index.html | 2 +- .../docs/index.js | 8 +++---- .../docs/index.ts | 12 +++++----- .../jsfiddle/demo.js | 8 +++---- .../place-autocomplete-element/app/index.ts | 4 ++-- .../place-autocomplete-element/docs/index.js | 6 ++--- .../place-autocomplete-element/docs/index.ts | 4 ++-- .../jsfiddle/demo.js | 6 ++--- .../place-autocomplete-map/app/index.ts | 10 ++++----- .../place-autocomplete-map/docs/index.js | 4 ++-- .../place-autocomplete-map/docs/index.ts | 10 ++++----- .../place-autocomplete-map/jsfiddle/demo.js | 4 ++-- dist/samples/place-class/app/index.ts | 6 ++--- dist/samples/place-class/docs/index.js | 4 ++-- dist/samples/place-class/docs/index.ts | 6 ++--- dist/samples/place-class/jsfiddle/demo.js | 4 ++-- dist/samples/place-nearby-search/app/index.ts | 13 +++++------ .../{index-hVCfAAP2.js => index-CPlujCpF.js} | 2 +- .../place-nearby-search/dist/index.html | 2 +- .../samples/place-nearby-search/docs/index.js | 9 ++++---- .../samples/place-nearby-search/docs/index.ts | 13 +++++------ .../place-nearby-search/jsfiddle/demo.js | 9 ++++---- dist/samples/place-reviews/app/index.ts | 8 +++---- dist/samples/place-reviews/docs/index.js | 4 ++-- dist/samples/place-reviews/docs/index.ts | 8 +++---- dist/samples/place-reviews/jsfiddle/demo.js | 4 ++-- dist/samples/place-text-search/app/index.ts | 4 ++-- dist/samples/place-text-search/docs/index.js | 4 ++-- dist/samples/place-text-search/docs/index.ts | 4 ++-- .../place-text-search/jsfiddle/demo.js | 4 ++-- .../app/index.ts | 4 ++-- .../docs/index.js | 4 ++-- .../docs/index.ts | 4 ++-- .../jsfiddle/demo.js | 4 ++-- .../places-placeid-finder/app/index.ts | 12 +++++----- .../places-placeid-finder/docs/index.js | 4 ++-- .../places-placeid-finder/docs/index.ts | 12 +++++----- .../places-placeid-finder/jsfiddle/demo.js | 4 ++-- dist/samples/polyline-complex/app/index.ts | 4 ++-- dist/samples/polyline-complex/docs/index.js | 4 ++-- dist/samples/polyline-complex/docs/index.ts | 4 ++-- .../samples/polyline-complex/jsfiddle/demo.js | 4 ++-- dist/samples/polyline-remove/app/index.ts | 6 ++--- dist/samples/polyline-remove/docs/index.js | 4 ++-- dist/samples/polyline-remove/docs/index.ts | 6 ++--- dist/samples/polyline-remove/jsfiddle/demo.js | 4 ++-- dist/samples/polyline-simple/app/index.ts | 6 ++--- dist/samples/polyline-simple/docs/index.js | 4 ++-- dist/samples/polyline-simple/docs/index.ts | 6 ++--- dist/samples/polyline-simple/jsfiddle/demo.js | 4 ++-- .../react-ui-kit-search-nearby/docs/app.tsx | 18 ++++++++++++--- .../react-ui-kit-search-text/docs/app.tsx | 17 +++++++++++--- dist/samples/rectangle-event/app/index.ts | 4 ++-- dist/samples/rectangle-event/docs/index.js | 4 ++-- dist/samples/rectangle-event/docs/index.ts | 4 ++-- dist/samples/rectangle-event/jsfiddle/demo.js | 4 ++-- .../routes-get-alternatives/app/index.ts | 10 ++++----- .../dist/assets/index-CYpnwxIJ.js | 1 + .../dist/assets/index-DUkkR9dP.js | 1 - .../routes-get-alternatives/dist/index.html | 2 +- .../routes-get-alternatives/docs/index.js | 8 +++---- .../routes-get-alternatives/docs/index.ts | 10 ++++----- .../routes-get-alternatives/jsfiddle/demo.js | 8 +++---- .../routes-get-directions-panel/app/index.ts | 4 ++-- .../routes-get-directions-panel/docs/index.js | 4 ++-- .../routes-get-directions-panel/docs/index.ts | 4 ++-- .../jsfiddle/demo.js | 4 ++-- .../routes-get-directions/app/index.ts | 4 ++-- .../routes-get-directions/docs/index.js | 4 ++-- .../routes-get-directions/docs/index.ts | 4 ++-- .../routes-get-directions/jsfiddle/demo.js | 4 ++-- dist/samples/routes-markers/app/index.ts | 18 +++++++-------- .../dist/assets/index-DeGHbAh6.js | 1 + .../dist/assets/index-aTlOqFO0.js | 1 - dist/samples/routes-markers/dist/index.html | 2 +- dist/samples/routes-markers/docs/index.js | 14 ++++++------ dist/samples/routes-markers/docs/index.ts | 18 +++++++-------- dist/samples/routes-markers/jsfiddle/demo.js | 14 ++++++------ dist/samples/routes-route-matrix/app/index.ts | 6 ++--- .../{index-TqnnJovY.js => index-BP2Te6Po.js} | 2 +- .../routes-route-matrix/dist/index.html | 2 +- .../samples/routes-route-matrix/docs/index.js | 6 ++--- .../samples/routes-route-matrix/docs/index.ts | 6 ++--- .../routes-route-matrix/jsfiddle/demo.js | 6 ++--- dist/samples/streetview-overlays/app/index.ts | 8 +++---- .../dist/assets/index-BdpLipIk.js | 1 - .../dist/assets/index-tP85ksEQ.js | 1 + .../streetview-overlays/dist/index.html | 2 +- .../samples/streetview-overlays/docs/index.js | 8 +++---- .../samples/streetview-overlays/docs/index.ts | 8 +++---- .../streetview-overlays/jsfiddle/demo.js | 8 +++---- dist/samples/test-example/app/index.ts | 10 ++++----- .../{index-C8mA1EpW.js => index-XpYzCYeX.js} | 2 +- dist/samples/test-example/dist/index.html | 2 +- dist/samples/test-example/docs/index.js | 8 +++---- dist/samples/test-example/docs/index.ts | 10 ++++----- dist/samples/test-example/jsfiddle/demo.js | 8 +++---- .../ui-kit-place-details-compact/app/index.ts | 4 ++-- .../docs/index.js | 4 ++-- .../docs/index.ts | 4 ++-- .../jsfiddle/demo.js | 4 ++-- .../samples/ui-kit-place-details/app/index.ts | 4 ++-- .../ui-kit-place-details/docs/index.js | 4 ++-- .../ui-kit-place-details/docs/index.ts | 4 ++-- .../ui-kit-place-details/jsfiddle/demo.js | 4 ++-- .../ui-kit-place-search-nearby/app/index.ts | 4 ++-- .../ui-kit-place-search-nearby/docs/index.ts | 4 ++-- .../ui-kit-place-search-text/app/index.ts | 4 ++-- .../ui-kit-place-search-text/docs/index.ts | 4 ++-- .../weather-api-current-compact/app/index.ts | 22 +++++++++++-------- .../{index-B5PxTHrN.js => index-1mvsB7xh.js} | 2 +- .../dist/index.html | 2 +- .../weather-api-current-compact/docs/index.js | 18 +++++++-------- .../weather-api-current-compact/docs/index.ts | 22 +++++++++++-------- .../jsfiddle/demo.js | 18 +++++++-------- .../web-components-events/app/index.ts | 4 ++-- .../web-components-events/docs/index.js | 4 ++-- .../web-components-events/docs/index.ts | 4 ++-- .../web-components-events/jsfiddle/demo.js | 4 ++-- 452 files changed, 1282 insertions(+), 1229 deletions(-) rename dist/samples/add-map/dist/assets/{index-D6lQKzhm.js => index-PY_yKy4N.js} (71%) rename dist/samples/advanced-markers-altitude/dist/assets/{index-BUhARZme.js => index-D24icea5.js} (62%) create mode 100644 dist/samples/advanced-markers-basic-style/dist/assets/index-C86JjmJl.js delete mode 100644 dist/samples/advanced-markers-basic-style/dist/assets/index-Cs7O-C5Y.js create mode 100644 dist/samples/advanced-markers-collision/dist/assets/index-CDpfhitr.js delete mode 100644 dist/samples/advanced-markers-collision/dist/assets/index-DHUV3LrM.js create mode 100644 dist/samples/advanced-markers-graphics/dist/assets/index-Sbzf46WX.js delete mode 100644 dist/samples/advanced-markers-graphics/dist/assets/index-ew87NHl3.js rename dist/samples/advanced-markers-html-simple/dist/assets/{index-CIdISgjL.js => index-CTJOR8W2.js} (68%) rename dist/samples/advanced-markers-simple/dist/assets/{index-CaRm1bTX.js => index-DXcope9R.js} (74%) delete mode 100644 dist/samples/advanced-markers-zoom/dist/assets/index-BBSizdLT.js create mode 100644 dist/samples/advanced-markers-zoom/dist/assets/index-Cvw2Ct9s.js rename dist/samples/control-positioning-labels/dist/assets/{index-B0MmW35h.js => index-DGaMZhEd.js} (58%) rename dist/samples/dds-datasets-point/dist/assets/{index-BiIKdmZq.js => index-BcBGGFO7.js} (58%) rename dist/samples/event-arguments/dist/assets/{index-DLnAWehh.js => index-l7pdboKs.js} (72%) create mode 100644 dist/samples/event-closure/dist/assets/index-CguLmy-g.js delete mode 100644 dist/samples/event-closure/dist/assets/index-Drl7MJNE.js rename dist/samples/event-simple/dist/assets/{index-9XSPUjum.js => index-4-R800gu.js} (60%) delete mode 100644 dist/samples/geocoding-simple/dist/assets/index--Xf9s_0d.js create mode 100644 dist/samples/geocoding-simple/dist/assets/index-TFN50Rj5.js rename dist/samples/layer-data-quakes-red/dist/assets/{index-wSCHVohg.js => index-OTMI4Tta.js} (56%) rename dist/samples/layer-data-style/dist/assets/{index-CkmsX2aC.js => index-Cve1kyUF.js} (71%) create mode 100644 dist/samples/place-autocomplete-basic-map/dist/assets/index-CwdUD2Am.js delete mode 100644 dist/samples/place-autocomplete-basic-map/dist/assets/index-DeO0XQ2l.js rename dist/samples/place-nearby-search/dist/assets/{index-hVCfAAP2.js => index-CPlujCpF.js} (52%) create mode 100644 dist/samples/routes-get-alternatives/dist/assets/index-CYpnwxIJ.js delete mode 100644 dist/samples/routes-get-alternatives/dist/assets/index-DUkkR9dP.js create mode 100644 dist/samples/routes-markers/dist/assets/index-DeGHbAh6.js delete mode 100644 dist/samples/routes-markers/dist/assets/index-aTlOqFO0.js rename dist/samples/routes-route-matrix/dist/assets/{index-TqnnJovY.js => index-BP2Te6Po.js} (93%) delete mode 100644 dist/samples/streetview-overlays/dist/assets/index-BdpLipIk.js create mode 100644 dist/samples/streetview-overlays/dist/assets/index-tP85ksEQ.js rename dist/samples/test-example/dist/assets/{index-C8mA1EpW.js => index-XpYzCYeX.js} (66%) rename dist/samples/weather-api-current-compact/dist/assets/{index-B5PxTHrN.js => index-1mvsB7xh.js} (72%) diff --git a/dist/samples/3d-accessibility-features/app/index.ts b/dist/samples/3d-accessibility-features/app/index.ts index 8e4a40cfd..55c8cfa1a 100644 --- a/dist/samples/3d-accessibility-features/app/index.ts +++ b/dist/samples/3d-accessibility-features/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_3d_accessibility_features] -async function initMap() { +async function init() { const [ { Map3DElement, Marker3DInteractiveElement, PopoverElement }, { PinElement }, @@ -82,5 +82,5 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); // [END maps_3d_accessibility_features] diff --git a/dist/samples/3d-accessibility-features/docs/index.js b/dist/samples/3d-accessibility-features/docs/index.js index 4a9eae98e..516f78576 100644 --- a/dist/samples/3d-accessibility-features/docs/index.js +++ b/dist/samples/3d-accessibility-features/docs/index.js @@ -6,7 +6,7 @@ */ // [START maps_3d_accessibility_features] -async function initMap() { +async function init() { const [ { Map3DElement, Marker3DInteractiveElement, PopoverElement }, { PinElement }, @@ -83,5 +83,5 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); // [END maps_3d_accessibility_features] diff --git a/dist/samples/3d-accessibility-features/docs/index.ts b/dist/samples/3d-accessibility-features/docs/index.ts index 8e4a40cfd..55c8cfa1a 100644 --- a/dist/samples/3d-accessibility-features/docs/index.ts +++ b/dist/samples/3d-accessibility-features/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_3d_accessibility_features] -async function initMap() { +async function init() { const [ { Map3DElement, Marker3DInteractiveElement, PopoverElement }, { PinElement }, @@ -82,5 +82,5 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); // [END maps_3d_accessibility_features] diff --git a/dist/samples/3d-accessibility-features/jsfiddle/demo.js b/dist/samples/3d-accessibility-features/jsfiddle/demo.js index 1fd68df72..efe918322 100644 --- a/dist/samples/3d-accessibility-features/jsfiddle/demo.js +++ b/dist/samples/3d-accessibility-features/jsfiddle/demo.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { const [ { Map3DElement, Marker3DInteractiveElement, PopoverElement }, { PinElement }, @@ -82,4 +82,4 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); diff --git a/dist/samples/3d-camera-boundary/app/index.ts b/dist/samples/3d-camera-boundary/app/index.ts index 315668941..6693e2695 100644 --- a/dist/samples/3d-camera-boundary/app/index.ts +++ b/dist/samples/3d-camera-boundary/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_3d_camera_boundary] -async function initMap() { +async function init() { const { Map3DElement } = await google.maps.importLibrary('maps3d'); const map = new Map3DElement({ @@ -19,5 +19,5 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); // [END maps_3d_camera_boundary] diff --git a/dist/samples/3d-camera-boundary/docs/index.js b/dist/samples/3d-camera-boundary/docs/index.js index 888ab412f..9a19ee189 100644 --- a/dist/samples/3d-camera-boundary/docs/index.js +++ b/dist/samples/3d-camera-boundary/docs/index.js @@ -6,7 +6,7 @@ */ // [START maps_3d_camera_boundary] -async function initMap() { +async function init() { const { Map3DElement } = await google.maps.importLibrary('maps3d'); const map = new Map3DElement({ @@ -20,5 +20,5 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); // [END maps_3d_camera_boundary] diff --git a/dist/samples/3d-camera-boundary/docs/index.ts b/dist/samples/3d-camera-boundary/docs/index.ts index 315668941..6693e2695 100644 --- a/dist/samples/3d-camera-boundary/docs/index.ts +++ b/dist/samples/3d-camera-boundary/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_3d_camera_boundary] -async function initMap() { +async function init() { const { Map3DElement } = await google.maps.importLibrary('maps3d'); const map = new Map3DElement({ @@ -19,5 +19,5 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); // [END maps_3d_camera_boundary] diff --git a/dist/samples/3d-camera-boundary/jsfiddle/demo.js b/dist/samples/3d-camera-boundary/jsfiddle/demo.js index db4c73533..01166a0e4 100644 --- a/dist/samples/3d-camera-boundary/jsfiddle/demo.js +++ b/dist/samples/3d-camera-boundary/jsfiddle/demo.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { const { Map3DElement } = await google.maps.importLibrary('maps3d'); const map = new Map3DElement({ @@ -19,4 +19,4 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); diff --git a/dist/samples/3d-camera-center/app/index.ts b/dist/samples/3d-camera-center/app/index.ts index a3420febd..620038f6c 100644 --- a/dist/samples/3d-camera-center/app/index.ts +++ b/dist/samples/3d-camera-center/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_3d_camera_center] -async function initMap(): Promise { +async function init(): Promise { // Import the needed libraries. await google.maps.importLibrary('maps3d'); @@ -36,5 +36,5 @@ async function initMap(): Promise { }); } -void initMap(); +void init(); // [END maps_3d_camera_center] diff --git a/dist/samples/3d-camera-center/docs/index.js b/dist/samples/3d-camera-center/docs/index.js index aff1ba52f..2af858feb 100644 --- a/dist/samples/3d-camera-center/docs/index.js +++ b/dist/samples/3d-camera-center/docs/index.js @@ -6,7 +6,7 @@ */ // [START maps_3d_camera_center] -async function initMap() { +async function init() { // Import the needed libraries. await google.maps.importLibrary('maps3d'); @@ -37,5 +37,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_3d_camera_center] diff --git a/dist/samples/3d-camera-center/docs/index.ts b/dist/samples/3d-camera-center/docs/index.ts index a3420febd..620038f6c 100644 --- a/dist/samples/3d-camera-center/docs/index.ts +++ b/dist/samples/3d-camera-center/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_3d_camera_center] -async function initMap(): Promise { +async function init(): Promise { // Import the needed libraries. await google.maps.importLibrary('maps3d'); @@ -36,5 +36,5 @@ async function initMap(): Promise { }); } -void initMap(); +void init(); // [END maps_3d_camera_center] diff --git a/dist/samples/3d-camera-center/jsfiddle/demo.js b/dist/samples/3d-camera-center/jsfiddle/demo.js index 632c029fb..cd00c58af 100644 --- a/dist/samples/3d-camera-center/jsfiddle/demo.js +++ b/dist/samples/3d-camera-center/jsfiddle/demo.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { // Import the needed libraries. await google.maps.importLibrary('maps3d'); @@ -36,4 +36,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/3d-coverage-map/app/index.ts b/dist/samples/3d-coverage-map/app/index.ts index 64a4765fb..9c2d6f8a4 100644 --- a/dist/samples/3d-coverage-map/app/index.ts +++ b/dist/samples/3d-coverage-map/app/index.ts @@ -16,7 +16,7 @@ const layerStyle = { const mapElement = document.querySelector('gmp-map')!; const placeAutocomplete = document.querySelector('gmp-place-autocomplete')!; -async function initMap() { +async function init() { // Request needed libraries. await Promise.all([ google.maps.importLibrary('maps'), @@ -53,5 +53,5 @@ async function initMap() { } ); } -void initMap(); +void init(); // [END maps_3d_coverage_map] diff --git a/dist/samples/3d-coverage-map/docs/index.js b/dist/samples/3d-coverage-map/docs/index.js index c984de6b8..79277f5d7 100644 --- a/dist/samples/3d-coverage-map/docs/index.js +++ b/dist/samples/3d-coverage-map/docs/index.js @@ -17,7 +17,7 @@ const layerStyle = { const mapElement = document.querySelector('gmp-map'); const placeAutocomplete = document.querySelector('gmp-place-autocomplete'); -async function initMap() { +async function init() { // Request needed libraries. await Promise.all([ google.maps.importLibrary('maps'), @@ -54,5 +54,5 @@ async function initMap() { } ); } -void initMap(); +void init(); // [END maps_3d_coverage_map] diff --git a/dist/samples/3d-coverage-map/docs/index.ts b/dist/samples/3d-coverage-map/docs/index.ts index 64a4765fb..9c2d6f8a4 100644 --- a/dist/samples/3d-coverage-map/docs/index.ts +++ b/dist/samples/3d-coverage-map/docs/index.ts @@ -16,7 +16,7 @@ const layerStyle = { const mapElement = document.querySelector('gmp-map')!; const placeAutocomplete = document.querySelector('gmp-place-autocomplete')!; -async function initMap() { +async function init() { // Request needed libraries. await Promise.all([ google.maps.importLibrary('maps'), @@ -53,5 +53,5 @@ async function initMap() { } ); } -void initMap(); +void init(); // [END maps_3d_coverage_map] diff --git a/dist/samples/3d-coverage-map/jsfiddle/demo.js b/dist/samples/3d-coverage-map/jsfiddle/demo.js index 587faf127..b0781f003 100644 --- a/dist/samples/3d-coverage-map/jsfiddle/demo.js +++ b/dist/samples/3d-coverage-map/jsfiddle/demo.js @@ -16,7 +16,7 @@ const layerStyle = { const mapElement = document.querySelector('gmp-map'); const placeAutocomplete = document.querySelector('gmp-place-autocomplete'); -async function initMap() { +async function init() { // Request needed libraries. await Promise.all([ google.maps.importLibrary('maps'), @@ -53,4 +53,4 @@ async function initMap() { } ); } -void initMap(); +void init(); diff --git a/dist/samples/3d-localization/app/index.ts b/dist/samples/3d-localization/app/index.ts index e9c617ec8..bf5a01a68 100644 --- a/dist/samples/3d-localization/app/index.ts +++ b/dist/samples/3d-localization/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_3d_localization] -async function initMap() { +async function init() { const { Map3DElement } = await google.maps.importLibrary('maps3d'); const map = new Map3DElement({ @@ -26,5 +26,5 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); // [END maps_3d_localization] diff --git a/dist/samples/3d-localization/docs/index.js b/dist/samples/3d-localization/docs/index.js index fdca66841..982cb6239 100644 --- a/dist/samples/3d-localization/docs/index.js +++ b/dist/samples/3d-localization/docs/index.js @@ -6,7 +6,7 @@ */ // [START maps_3d_localization] -async function initMap() { +async function init() { const { Map3DElement } = await google.maps.importLibrary('maps3d'); const map = new Map3DElement({ @@ -27,5 +27,5 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); // [END maps_3d_localization] diff --git a/dist/samples/3d-localization/docs/index.ts b/dist/samples/3d-localization/docs/index.ts index e9c617ec8..bf5a01a68 100644 --- a/dist/samples/3d-localization/docs/index.ts +++ b/dist/samples/3d-localization/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_3d_localization] -async function initMap() { +async function init() { const { Map3DElement } = await google.maps.importLibrary('maps3d'); const map = new Map3DElement({ @@ -26,5 +26,5 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); // [END maps_3d_localization] diff --git a/dist/samples/3d-localization/jsfiddle/demo.js b/dist/samples/3d-localization/jsfiddle/demo.js index 4ddda0d34..4ff1b6d57 100644 --- a/dist/samples/3d-localization/jsfiddle/demo.js +++ b/dist/samples/3d-localization/jsfiddle/demo.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { const { Map3DElement } = await google.maps.importLibrary('maps3d'); const map = new Map3DElement({ @@ -26,4 +26,4 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); diff --git a/dist/samples/3d-map-styling/app/index.ts b/dist/samples/3d-map-styling/app/index.ts index b2062e87d..cc9ff1706 100644 --- a/dist/samples/3d-map-styling/app/index.ts +++ b/dist/samples/3d-map-styling/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_3d_map_styling] -async function initMap() { +async function init() { const { Map3DElement } = await google.maps.importLibrary('maps3d'); const map = new Map3DElement({ @@ -25,5 +25,5 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); // [END maps_3d_map_styling] diff --git a/dist/samples/3d-map-styling/docs/index.js b/dist/samples/3d-map-styling/docs/index.js index eed915ad0..6f17820f0 100644 --- a/dist/samples/3d-map-styling/docs/index.js +++ b/dist/samples/3d-map-styling/docs/index.js @@ -6,7 +6,7 @@ */ // [START maps_3d_map_styling] -async function initMap() { +async function init() { const { Map3DElement } = await google.maps.importLibrary('maps3d'); const map = new Map3DElement({ @@ -26,5 +26,5 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); // [END maps_3d_map_styling] diff --git a/dist/samples/3d-map-styling/docs/index.ts b/dist/samples/3d-map-styling/docs/index.ts index b2062e87d..cc9ff1706 100644 --- a/dist/samples/3d-map-styling/docs/index.ts +++ b/dist/samples/3d-map-styling/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_3d_map_styling] -async function initMap() { +async function init() { const { Map3DElement } = await google.maps.importLibrary('maps3d'); const map = new Map3DElement({ @@ -25,5 +25,5 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); // [END maps_3d_map_styling] diff --git a/dist/samples/3d-map-styling/jsfiddle/demo.js b/dist/samples/3d-map-styling/jsfiddle/demo.js index 7619df75c..f25a5d5b1 100644 --- a/dist/samples/3d-map-styling/jsfiddle/demo.js +++ b/dist/samples/3d-map-styling/jsfiddle/demo.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { const { Map3DElement } = await google.maps.importLibrary('maps3d'); const map = new Map3DElement({ @@ -25,4 +25,4 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); diff --git a/dist/samples/3d-marker-click-event/app/index.ts b/dist/samples/3d-marker-click-event/app/index.ts index 130129add..7bcad5269 100644 --- a/dist/samples/3d-marker-click-event/app/index.ts +++ b/dist/samples/3d-marker-click-event/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_3d_marker_click_event] -async function initMap() { +async function init() { // Include the interactive marker class const { Map3DElement, Marker3DInteractiveElement } = await google.maps.importLibrary('maps3d'); @@ -46,5 +46,5 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); // [END maps_3d_marker_click_event] diff --git a/dist/samples/3d-marker-click-event/docs/index.js b/dist/samples/3d-marker-click-event/docs/index.js index 36e0e1bc1..7016ddbd6 100644 --- a/dist/samples/3d-marker-click-event/docs/index.js +++ b/dist/samples/3d-marker-click-event/docs/index.js @@ -6,7 +6,7 @@ */ // [START maps_3d_marker_click_event] -async function initMap() { +async function init() { // Include the interactive marker class const { Map3DElement, Marker3DInteractiveElement } = await google.maps.importLibrary('maps3d'); @@ -47,5 +47,5 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); // [END maps_3d_marker_click_event] diff --git a/dist/samples/3d-marker-click-event/docs/index.ts b/dist/samples/3d-marker-click-event/docs/index.ts index 130129add..7bcad5269 100644 --- a/dist/samples/3d-marker-click-event/docs/index.ts +++ b/dist/samples/3d-marker-click-event/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_3d_marker_click_event] -async function initMap() { +async function init() { // Include the interactive marker class const { Map3DElement, Marker3DInteractiveElement } = await google.maps.importLibrary('maps3d'); @@ -46,5 +46,5 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); // [END maps_3d_marker_click_event] diff --git a/dist/samples/3d-marker-click-event/jsfiddle/demo.js b/dist/samples/3d-marker-click-event/jsfiddle/demo.js index ea174e33b..4ba4d26dc 100644 --- a/dist/samples/3d-marker-click-event/jsfiddle/demo.js +++ b/dist/samples/3d-marker-click-event/jsfiddle/demo.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { // Include the interactive marker class const { Map3DElement, Marker3DInteractiveElement } = await google.maps.importLibrary('maps3d'); @@ -46,4 +46,4 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); diff --git a/dist/samples/3d-mesh-flatten/app/index.ts b/dist/samples/3d-mesh-flatten/app/index.ts index 7c265437b..1d29b035e 100644 --- a/dist/samples/3d-mesh-flatten/app/index.ts +++ b/dist/samples/3d-mesh-flatten/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_3d_mesh_flatten] -async function initMap(): Promise { +async function init(): Promise { await google.maps.importLibrary('maps3d'); const map = document.querySelector('gmp-map-3d')!; @@ -26,5 +26,5 @@ async function initMap(): Promise { }); } -void initMap(); +void init(); // [END maps_3d_mesh_flatten] diff --git a/dist/samples/3d-mesh-flatten/docs/index.js b/dist/samples/3d-mesh-flatten/docs/index.js index 9560ac81f..ccfcf8aa6 100644 --- a/dist/samples/3d-mesh-flatten/docs/index.js +++ b/dist/samples/3d-mesh-flatten/docs/index.js @@ -6,7 +6,7 @@ */ // [START maps_3d_mesh_flatten] -async function initMap() { +async function init() { await google.maps.importLibrary('maps3d'); const map = document.querySelector('gmp-map-3d'); @@ -25,5 +25,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_3d_mesh_flatten] diff --git a/dist/samples/3d-mesh-flatten/docs/index.ts b/dist/samples/3d-mesh-flatten/docs/index.ts index 7c265437b..1d29b035e 100644 --- a/dist/samples/3d-mesh-flatten/docs/index.ts +++ b/dist/samples/3d-mesh-flatten/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_3d_mesh_flatten] -async function initMap(): Promise { +async function init(): Promise { await google.maps.importLibrary('maps3d'); const map = document.querySelector('gmp-map-3d')!; @@ -26,5 +26,5 @@ async function initMap(): Promise { }); } -void initMap(); +void init(); // [END maps_3d_mesh_flatten] diff --git a/dist/samples/3d-mesh-flatten/jsfiddle/demo.js b/dist/samples/3d-mesh-flatten/jsfiddle/demo.js index c3e197da2..4c3aa0a1f 100644 --- a/dist/samples/3d-mesh-flatten/jsfiddle/demo.js +++ b/dist/samples/3d-mesh-flatten/jsfiddle/demo.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { await google.maps.importLibrary('maps3d'); const map = document.querySelector('gmp-map-3d'); @@ -24,4 +24,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/3d-simple-map/app/index.ts b/dist/samples/3d-simple-map/app/index.ts index ff51750fc..d8de48ae7 100644 --- a/dist/samples/3d-simple-map/app/index.ts +++ b/dist/samples/3d-simple-map/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_3d_simple_map] -async function initMap() { +async function init() { const { Map3DElement } = await google.maps.importLibrary('maps3d'); const map = new Map3DElement({ @@ -18,5 +18,5 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); // [END maps_3d_simple_map] diff --git a/dist/samples/3d-simple-map/docs/index.js b/dist/samples/3d-simple-map/docs/index.js index 1014b301b..135ce936b 100644 --- a/dist/samples/3d-simple-map/docs/index.js +++ b/dist/samples/3d-simple-map/docs/index.js @@ -6,7 +6,7 @@ */ // [START maps_3d_simple_map] -async function initMap() { +async function init() { const { Map3DElement } = await google.maps.importLibrary('maps3d'); const map = new Map3DElement({ @@ -19,5 +19,5 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); // [END maps_3d_simple_map] diff --git a/dist/samples/3d-simple-map/docs/index.ts b/dist/samples/3d-simple-map/docs/index.ts index ff51750fc..d8de48ae7 100644 --- a/dist/samples/3d-simple-map/docs/index.ts +++ b/dist/samples/3d-simple-map/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_3d_simple_map] -async function initMap() { +async function init() { const { Map3DElement } = await google.maps.importLibrary('maps3d'); const map = new Map3DElement({ @@ -18,5 +18,5 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); // [END maps_3d_simple_map] diff --git a/dist/samples/3d-simple-map/jsfiddle/demo.js b/dist/samples/3d-simple-map/jsfiddle/demo.js index 5f113bbf7..20137b79a 100644 --- a/dist/samples/3d-simple-map/jsfiddle/demo.js +++ b/dist/samples/3d-simple-map/jsfiddle/demo.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { const { Map3DElement } = await google.maps.importLibrary('maps3d'); const map = new Map3DElement({ @@ -18,4 +18,4 @@ async function initMap() { document.body.append(map); } -void initMap(); +void init(); diff --git a/dist/samples/add-map/app/index.ts b/dist/samples/add-map/app/index.ts index bd94e550e..4ead4e936 100644 --- a/dist/samples/add-map/app/index.ts +++ b/dist/samples/add-map/app/index.ts @@ -5,13 +5,13 @@ */ // [START maps_add_map] -async function initMap(): Promise { +async function init(): Promise { // [START maps_add_map_instantiate_map] // [START maps_add_map_libraries] // Request the needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); // [END maps_add_map_libraries] // [START maps_add_map_innermap] @@ -37,5 +37,5 @@ async function initMap(): Promise { }); // [END maps_add_map_instantiate_marker] } -void initMap(); +void init(); // [END maps_add_map] diff --git a/dist/samples/add-map/dist/assets/index-D6lQKzhm.js b/dist/samples/add-map/dist/assets/index-PY_yKy4N.js similarity index 71% rename from dist/samples/add-map/dist/assets/index-D6lQKzhm.js rename to dist/samples/add-map/dist/assets/index-PY_yKy4N.js index 4aab0f1ba..001b5618e 100644 --- a/dist/samples/add-map/dist/assets/index-D6lQKzhm.js +++ b/dist/samples/add-map/dist/assets/index-PY_yKy4N.js @@ -1 +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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`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[,{AdvancedMarkerElement:e}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`marker`)]),t=document.querySelector(`gmp-map`),n=t.innerMap;n.setOptions({mapTypeControl:!1}),new e({map:n,position:t.center,title:`Uluru/Ayers Rock`})}e(); \ No newline at end of file +(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`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[{AdvancedMarkerElement:e}]=await Promise.all([google.maps.importLibrary(`marker`),google.maps.importLibrary(`maps`)]),t=document.querySelector(`gmp-map`),n=t.innerMap;n.setOptions({mapTypeControl:!1}),new e({map:n,position:t.center,title:`Uluru/Ayers Rock`})}e(); \ No newline at end of file diff --git a/dist/samples/add-map/dist/index.html b/dist/samples/add-map/dist/index.html index a246070d3..ea6f68817 100644 --- a/dist/samples/add-map/dist/index.html +++ b/dist/samples/add-map/dist/index.html @@ -15,7 +15,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/add-map/docs/index.js b/dist/samples/add-map/docs/index.js index cbabe9e5d..a1853d0ae 100644 --- a/dist/samples/add-map/docs/index.js +++ b/dist/samples/add-map/docs/index.js @@ -6,13 +6,13 @@ */ // [START maps_add_map] -async function initMap() { +async function init() { // [START maps_add_map_instantiate_map] // [START maps_add_map_libraries] // Request the needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); // [END maps_add_map_libraries] // [START maps_add_map_innermap] @@ -38,5 +38,5 @@ async function initMap() { }); // [END maps_add_map_instantiate_marker] } -void initMap(); +void init(); // [END maps_add_map] diff --git a/dist/samples/add-map/docs/index.ts b/dist/samples/add-map/docs/index.ts index bd94e550e..4ead4e936 100644 --- a/dist/samples/add-map/docs/index.ts +++ b/dist/samples/add-map/docs/index.ts @@ -5,13 +5,13 @@ */ // [START maps_add_map] -async function initMap(): Promise { +async function init(): Promise { // [START maps_add_map_instantiate_map] // [START maps_add_map_libraries] // Request the needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); // [END maps_add_map_libraries] // [START maps_add_map_innermap] @@ -37,5 +37,5 @@ async function initMap(): Promise { }); // [END maps_add_map_instantiate_marker] } -void initMap(); +void init(); // [END maps_add_map] diff --git a/dist/samples/add-map/jsfiddle/demo.js b/dist/samples/add-map/jsfiddle/demo.js index fe30e3cd2..2807186d4 100644 --- a/dist/samples/add-map/jsfiddle/demo.js +++ b/dist/samples/add-map/jsfiddle/demo.js @@ -5,11 +5,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { // Request the needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); // Get the gmp-map element. @@ -30,4 +30,4 @@ async function initMap() { title: 'Uluru/Ayers Rock', }); } -void initMap(); +void init(); diff --git a/dist/samples/advanced-markers-accessibility/app/index.ts b/dist/samples/advanced-markers-accessibility/app/index.ts index 6b0c287f5..46ea868f3 100644 --- a/dist/samples/advanced-markers-accessibility/app/index.ts +++ b/dist/samples/advanced-markers-accessibility/app/index.ts @@ -7,7 +7,7 @@ // [START maps_advanced_markers_accessibility] const mapElement = document.querySelector('gmp-map')!; -async function initMap() { +async function init() { // Request needed libraries. const [{ InfoWindow }, { AdvancedMarkerElement, PinElement }] = await Promise.all([ @@ -70,5 +70,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_advanced_markers_accessibility] diff --git a/dist/samples/advanced-markers-accessibility/docs/index.js b/dist/samples/advanced-markers-accessibility/docs/index.js index 7dde38de3..8f3e5ec4a 100644 --- a/dist/samples/advanced-markers-accessibility/docs/index.js +++ b/dist/samples/advanced-markers-accessibility/docs/index.js @@ -8,7 +8,7 @@ // [START maps_advanced_markers_accessibility] const mapElement = document.querySelector('gmp-map'); -async function initMap() { +async function init() { // Request needed libraries. const [{ InfoWindow }, { AdvancedMarkerElement, PinElement }] = await Promise.all([ @@ -71,5 +71,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_advanced_markers_accessibility] diff --git a/dist/samples/advanced-markers-accessibility/docs/index.ts b/dist/samples/advanced-markers-accessibility/docs/index.ts index 6b0c287f5..46ea868f3 100644 --- a/dist/samples/advanced-markers-accessibility/docs/index.ts +++ b/dist/samples/advanced-markers-accessibility/docs/index.ts @@ -7,7 +7,7 @@ // [START maps_advanced_markers_accessibility] const mapElement = document.querySelector('gmp-map')!; -async function initMap() { +async function init() { // Request needed libraries. const [{ InfoWindow }, { AdvancedMarkerElement, PinElement }] = await Promise.all([ @@ -70,5 +70,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_advanced_markers_accessibility] diff --git a/dist/samples/advanced-markers-accessibility/jsfiddle/demo.js b/dist/samples/advanced-markers-accessibility/jsfiddle/demo.js index 6b174fa71..7926db8c2 100644 --- a/dist/samples/advanced-markers-accessibility/jsfiddle/demo.js +++ b/dist/samples/advanced-markers-accessibility/jsfiddle/demo.js @@ -7,7 +7,7 @@ const mapElement = document.querySelector('gmp-map'); -async function initMap() { +async function init() { // Request needed libraries. const [{ InfoWindow }, { AdvancedMarkerElement, PinElement }] = await Promise.all([ @@ -67,4 +67,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/advanced-markers-altitude/app/index.ts b/dist/samples/advanced-markers-altitude/app/index.ts index c70d9996b..d7d6c370f 100644 --- a/dist/samples/advanced-markers-altitude/app/index.ts +++ b/dist/samples/advanced-markers-altitude/app/index.ts @@ -7,11 +7,11 @@ // [START maps_advanced_markers_altitude] const mapElement = document.querySelector('gmp-map')!; -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement, PinElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement, PinElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); mapElement.innerMap.setOptions({ @@ -41,5 +41,5 @@ async function initMap() { // [END maps_advanced_markers_altitude_marker] } -void initMap(); +void init(); // [END maps_advanced_markers_altitude] diff --git a/dist/samples/advanced-markers-altitude/dist/assets/index-BUhARZme.js b/dist/samples/advanced-markers-altitude/dist/assets/index-D24icea5.js similarity index 62% rename from dist/samples/advanced-markers-altitude/dist/assets/index-BUhARZme.js rename to dist/samples/advanced-markers-altitude/dist/assets/index-D24icea5.js index 3994e858a..31fc07460 100644 --- a/dist/samples/advanced-markers-altitude/dist/assets/index-BUhARZme.js +++ b/dist/samples/advanced-markers-altitude/dist/assets/index-D24icea5.js @@ -1 +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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=document.querySelector(`gmp-map`);async function t(){let[,{AdvancedMarkerElement:t,PinElement:n}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`marker`)]);e.innerMap.setOptions({tilt:67.5,heading:45});let r=new n({background:`#4b2e83`,borderColor:`#b7a57a`,glyphColor:`#b7a57a`,scale:2}),i=new t({position:{lat:47.65170843460547,lng:-122.30754,altitude:20}});i.append(r),e.append(i)}t(); \ No newline at end of file +(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=document.querySelector(`gmp-map`);async function t(){let[{AdvancedMarkerElement:t,PinElement:n}]=await Promise.all([google.maps.importLibrary(`marker`),google.maps.importLibrary(`maps`)]);e.innerMap.setOptions({tilt:67.5,heading:45});let r=new n({background:`#4b2e83`,borderColor:`#b7a57a`,glyphColor:`#b7a57a`,scale:2}),i=new t({position:{lat:47.65170843460547,lng:-122.30754,altitude:20}});i.append(r),e.append(i)}t(); \ No newline at end of file diff --git a/dist/samples/advanced-markers-altitude/dist/index.html b/dist/samples/advanced-markers-altitude/dist/index.html index 6d48ccf51..0a51e9f86 100644 --- a/dist/samples/advanced-markers-altitude/dist/index.html +++ b/dist/samples/advanced-markers-altitude/dist/index.html @@ -15,7 +15,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/advanced-markers-altitude/docs/index.js b/dist/samples/advanced-markers-altitude/docs/index.js index 17b6a200d..3a31ad9cf 100644 --- a/dist/samples/advanced-markers-altitude/docs/index.js +++ b/dist/samples/advanced-markers-altitude/docs/index.js @@ -8,11 +8,11 @@ // [START maps_advanced_markers_altitude] const mapElement = document.querySelector('gmp-map'); -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement, PinElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement, PinElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); mapElement.innerMap.setOptions({ @@ -42,5 +42,5 @@ async function initMap() { // [END maps_advanced_markers_altitude_marker] } -void initMap(); +void init(); // [END maps_advanced_markers_altitude] diff --git a/dist/samples/advanced-markers-altitude/docs/index.ts b/dist/samples/advanced-markers-altitude/docs/index.ts index c70d9996b..d7d6c370f 100644 --- a/dist/samples/advanced-markers-altitude/docs/index.ts +++ b/dist/samples/advanced-markers-altitude/docs/index.ts @@ -7,11 +7,11 @@ // [START maps_advanced_markers_altitude] const mapElement = document.querySelector('gmp-map')!; -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement, PinElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement, PinElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); mapElement.innerMap.setOptions({ @@ -41,5 +41,5 @@ async function initMap() { // [END maps_advanced_markers_altitude_marker] } -void initMap(); +void init(); // [END maps_advanced_markers_altitude] diff --git a/dist/samples/advanced-markers-altitude/jsfiddle/demo.js b/dist/samples/advanced-markers-altitude/jsfiddle/demo.js index 38b2b4880..33c031f26 100644 --- a/dist/samples/advanced-markers-altitude/jsfiddle/demo.js +++ b/dist/samples/advanced-markers-altitude/jsfiddle/demo.js @@ -7,11 +7,11 @@ const mapElement = document.querySelector('gmp-map'); -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement, PinElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement, PinElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); mapElement.innerMap.setOptions({ @@ -39,4 +39,4 @@ async function initMap() { mapElement.append(marker); } -void initMap(); +void init(); diff --git a/dist/samples/advanced-markers-animation/app/index.ts b/dist/samples/advanced-markers-animation/app/index.ts index 91a3dd295..9fd432c9a 100644 --- a/dist/samples/advanced-markers-animation/app/index.ts +++ b/dist/samples/advanced-markers-animation/app/index.ts @@ -40,7 +40,7 @@ const intersectionObserver = new IntersectionObserver((entries) => { } }); -async function initMap(): Promise { +async function init(): Promise { // Request needed libraries. const [ { Map }, @@ -108,8 +108,8 @@ function refreshMap() { const mapDiv = document.createElement('div'); mapDiv.id = 'map'; mapContainer!.appendChild(mapDiv); - void initMap(); + void init(); } -void initMap(); +void init(); // [END maps_advanced_markers_animation] diff --git a/dist/samples/advanced-markers-animation/docs/index.js b/dist/samples/advanced-markers-animation/docs/index.js index 4c063efe0..0992c9793 100644 --- a/dist/samples/advanced-markers-animation/docs/index.js +++ b/dist/samples/advanced-markers-animation/docs/index.js @@ -41,7 +41,7 @@ const intersectionObserver = new IntersectionObserver((entries) => { } }); -async function initMap() { +async function init() { // Request needed libraries. const [ { Map }, @@ -109,8 +109,8 @@ function refreshMap() { const mapDiv = document.createElement('div'); mapDiv.id = 'map'; mapContainer.appendChild(mapDiv); - void initMap(); + void init(); } -void initMap(); +void init(); // [END maps_advanced_markers_animation] diff --git a/dist/samples/advanced-markers-animation/docs/index.ts b/dist/samples/advanced-markers-animation/docs/index.ts index 91a3dd295..9fd432c9a 100644 --- a/dist/samples/advanced-markers-animation/docs/index.ts +++ b/dist/samples/advanced-markers-animation/docs/index.ts @@ -40,7 +40,7 @@ const intersectionObserver = new IntersectionObserver((entries) => { } }); -async function initMap(): Promise { +async function init(): Promise { // Request needed libraries. const [ { Map }, @@ -108,8 +108,8 @@ function refreshMap() { const mapDiv = document.createElement('div'); mapDiv.id = 'map'; mapContainer!.appendChild(mapDiv); - void initMap(); + void init(); } -void initMap(); +void init(); // [END maps_advanced_markers_animation] diff --git a/dist/samples/advanced-markers-animation/jsfiddle/demo.js b/dist/samples/advanced-markers-animation/jsfiddle/demo.js index 444c049ad..c5220296d 100644 --- a/dist/samples/advanced-markers-animation/jsfiddle/demo.js +++ b/dist/samples/advanced-markers-animation/jsfiddle/demo.js @@ -40,7 +40,7 @@ const intersectionObserver = new IntersectionObserver((entries) => { } }); -async function initMap() { +async function init() { // Request needed libraries. const [ { Map }, @@ -108,7 +108,7 @@ function refreshMap() { const mapDiv = document.createElement('div'); mapDiv.id = 'map'; mapContainer.appendChild(mapDiv); - void initMap(); + void init(); } -void initMap(); +void init(); diff --git a/dist/samples/advanced-markers-basic-style/app/index.ts b/dist/samples/advanced-markers-basic-style/app/index.ts index 042e9634e..ebdc8e886 100644 --- a/dist/samples/advanced-markers-basic-style/app/index.ts +++ b/dist/samples/advanced-markers-basic-style/app/index.ts @@ -7,11 +7,11 @@ // [START maps_advanced_markers_basic_style] const mapElement = document.querySelector('gmp-map')!; -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement, PinElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement, PinElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); // Each PinElement is paired with a marker to demonstrate setting each parameter. @@ -98,5 +98,5 @@ async function initMap() { // [END maps_advanced_markers_basic_style_hide_glyph] } -void initMap(); +void init(); // [END maps_advanced_markers_basic_style] diff --git a/dist/samples/advanced-markers-basic-style/dist/assets/index-C86JjmJl.js b/dist/samples/advanced-markers-basic-style/dist/assets/index-C86JjmJl.js new file mode 100644 index 000000000..a3f0557ce --- /dev/null +++ b/dist/samples/advanced-markers-basic-style/dist/assets/index-C86JjmJl.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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=document.querySelector(`gmp-map`);async function t(){let[{AdvancedMarkerElement:t,PinElement:n}]=await Promise.all([google.maps.importLibrary(`marker`),google.maps.importLibrary(`maps`)]),r=new t({position:{lat:37.419,lng:-122.03},title:`Title text for the marker at lat: 37.419, lng: -122.03`});e.append(r);let i=new n({scale:1.5}),a=new t({position:{lat:37.419,lng:-122.02}});a.append(i),e.append(a);let o=new n({background:`#FBBC04`}),s=new t({position:{lat:37.419,lng:-122.01}});s.append(o),e.append(s);let c=new n({borderColor:`#137333`}),l=new t({position:{lat:37.415,lng:-122.035}});l.append(c),e.append(l);let u=new n({glyphColor:`white`}),d=new t({position:{lat:37.415,lng:-122.025}});d.append(u),e.append(d);let f=new n({glyphText:`T`,glyphColor:`white`}),p=new t({position:{lat:37.415,lng:-122.015}});p.append(f),e.append(p);let m=new n({glyphText:``}),h=new t({position:{lat:37.415,lng:-122.005}});h.append(m),e.append(h)}t(); \ No newline at end of file diff --git a/dist/samples/advanced-markers-basic-style/dist/assets/index-Cs7O-C5Y.js b/dist/samples/advanced-markers-basic-style/dist/assets/index-Cs7O-C5Y.js deleted file mode 100644 index 998407f59..000000000 --- a/dist/samples/advanced-markers-basic-style/dist/assets/index-Cs7O-C5Y.js +++ /dev/null @@ -1 +0,0 @@ -(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=document.querySelector(`gmp-map`);async function t(){let[,{AdvancedMarkerElement:t,PinElement:n}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`marker`)]),r=new t({position:{lat:37.419,lng:-122.03},title:`Title text for the marker at lat: 37.419, lng: -122.03`});e.append(r);let i=new n({scale:1.5}),a=new t({position:{lat:37.419,lng:-122.02}});a.append(i),e.append(a);let o=new n({background:`#FBBC04`}),s=new t({position:{lat:37.419,lng:-122.01}});s.append(o),e.append(s);let c=new n({borderColor:`#137333`}),l=new t({position:{lat:37.415,lng:-122.035}});l.append(c),e.append(l);let u=new n({glyphColor:`white`}),d=new t({position:{lat:37.415,lng:-122.025}});d.append(u),e.append(d);let f=new n({glyphText:`T`,glyphColor:`white`}),p=new t({position:{lat:37.415,lng:-122.015}});p.append(f),e.append(p);let m=new n({glyphText:``}),h=new t({position:{lat:37.415,lng:-122.005}});h.append(m),e.append(h)}t(); \ No newline at end of file diff --git a/dist/samples/advanced-markers-basic-style/dist/index.html b/dist/samples/advanced-markers-basic-style/dist/index.html index 4aea8f0b6..7c63789d1 100644 --- a/dist/samples/advanced-markers-basic-style/dist/index.html +++ b/dist/samples/advanced-markers-basic-style/dist/index.html @@ -15,7 +15,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/advanced-markers-basic-style/docs/index.js b/dist/samples/advanced-markers-basic-style/docs/index.js index 48bac2a3d..abd52eaa4 100644 --- a/dist/samples/advanced-markers-basic-style/docs/index.js +++ b/dist/samples/advanced-markers-basic-style/docs/index.js @@ -8,11 +8,11 @@ // [START maps_advanced_markers_basic_style] const mapElement = document.querySelector('gmp-map'); -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement, PinElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement, PinElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); // Each PinElement is paired with a marker to demonstrate setting each parameter. @@ -99,5 +99,5 @@ async function initMap() { // [END maps_advanced_markers_basic_style_hide_glyph] } -void initMap(); +void init(); // [END maps_advanced_markers_basic_style] diff --git a/dist/samples/advanced-markers-basic-style/docs/index.ts b/dist/samples/advanced-markers-basic-style/docs/index.ts index 042e9634e..ebdc8e886 100644 --- a/dist/samples/advanced-markers-basic-style/docs/index.ts +++ b/dist/samples/advanced-markers-basic-style/docs/index.ts @@ -7,11 +7,11 @@ // [START maps_advanced_markers_basic_style] const mapElement = document.querySelector('gmp-map')!; -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement, PinElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement, PinElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); // Each PinElement is paired with a marker to demonstrate setting each parameter. @@ -98,5 +98,5 @@ async function initMap() { // [END maps_advanced_markers_basic_style_hide_glyph] } -void initMap(); +void init(); // [END maps_advanced_markers_basic_style] diff --git a/dist/samples/advanced-markers-basic-style/jsfiddle/demo.js b/dist/samples/advanced-markers-basic-style/jsfiddle/demo.js index 6678f73bf..fef58688e 100644 --- a/dist/samples/advanced-markers-basic-style/jsfiddle/demo.js +++ b/dist/samples/advanced-markers-basic-style/jsfiddle/demo.js @@ -7,11 +7,11 @@ const mapElement = document.querySelector('gmp-map'); -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement, PinElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement, PinElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); // Each PinElement is paired with a marker to demonstrate setting each parameter. @@ -84,4 +84,4 @@ async function initMap() { mapElement.append(markerNoGlyph); } -void initMap(); +void init(); diff --git a/dist/samples/advanced-markers-collision/app/index.ts b/dist/samples/advanced-markers-collision/app/index.ts index 86e2ef1a1..1343c1785 100644 --- a/dist/samples/advanced-markers-collision/app/index.ts +++ b/dist/samples/advanced-markers-collision/app/index.ts @@ -4,16 +4,15 @@ * SPDX-License-Identifier: Apache-2.0 */ -// eslint-disable no-undef // [START maps_advanced_markers_collision] const mapElement = document.querySelector('gmp-map')!; // Initialize and add the map -async function initMap(): Promise { +async function init(): Promise { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const markers: google.maps.marker.AdvancedMarkerElement[] = []; @@ -63,5 +62,5 @@ async function initMap(): Promise { }); } -void initMap(); +void init(); // [END maps_advanced_markers_collision] diff --git a/dist/samples/advanced-markers-collision/dist/assets/index-CDpfhitr.js b/dist/samples/advanced-markers-collision/dist/assets/index-CDpfhitr.js new file mode 100644 index 000000000..6d9fcfe07 --- /dev/null +++ b/dist/samples/advanced-markers-collision/dist/assets/index-CDpfhitr.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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=document.querySelector(`gmp-map`);async function t(){let[{AdvancedMarkerElement:t}]=await Promise.all([google.maps.importLibrary(`marker`),google.maps.importLibrary(`maps`)]),n=[],r=`REQUIRED`,i=new mdc.select.MDCSelect(document.querySelector(`.mdc-select`));i.listen(`MDCSelect:change`,()=>{n.forEach(e=>{e.collisionBehavior=i.value})}),i.value=r,[[-122.3402,47.6093],[-122.3402,47.6094],[-122.3403,47.6094],[-122.3384,47.6098],[-122.3389,47.6095],[-122.3396,47.6095],[-122.3379,47.6097],[-122.3378,47.6097],[-122.3396,47.6091],[-122.3383,47.6089],[-122.3379,47.6093],[-122.3381,47.6095],[-122.3378,47.6095]].forEach(([i,a])=>{let o=new t({position:{lat:a,lng:i},collisionBehavior:r});e.appendChild(o),n.push(o)})}t(); \ No newline at end of file diff --git a/dist/samples/advanced-markers-collision/dist/assets/index-DHUV3LrM.js b/dist/samples/advanced-markers-collision/dist/assets/index-DHUV3LrM.js deleted file mode 100644 index 9b3b75386..000000000 --- a/dist/samples/advanced-markers-collision/dist/assets/index-DHUV3LrM.js +++ /dev/null @@ -1 +0,0 @@ -(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=document.querySelector(`gmp-map`);async function t(){let[,{AdvancedMarkerElement:t}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`marker`)]),n=[],r=`REQUIRED`,i=new mdc.select.MDCSelect(document.querySelector(`.mdc-select`));i.listen(`MDCSelect:change`,()=>{n.forEach(e=>{e.collisionBehavior=i.value})}),i.value=r,[[-122.3402,47.6093],[-122.3402,47.6094],[-122.3403,47.6094],[-122.3384,47.6098],[-122.3389,47.6095],[-122.3396,47.6095],[-122.3379,47.6097],[-122.3378,47.6097],[-122.3396,47.6091],[-122.3383,47.6089],[-122.3379,47.6093],[-122.3381,47.6095],[-122.3378,47.6095]].forEach(([i,a])=>{let o=new t({position:{lat:a,lng:i},collisionBehavior:r});e.appendChild(o),n.push(o)})}t(); \ No newline at end of file diff --git a/dist/samples/advanced-markers-collision/dist/index.html b/dist/samples/advanced-markers-collision/dist/index.html index 1ac6fc28d..816391c17 100644 --- a/dist/samples/advanced-markers-collision/dist/index.html +++ b/dist/samples/advanced-markers-collision/dist/index.html @@ -23,7 +23,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/advanced-markers-collision/docs/index.js b/dist/samples/advanced-markers-collision/docs/index.js index aad56fd51..e7f92d4f9 100644 --- a/dist/samples/advanced-markers-collision/docs/index.js +++ b/dist/samples/advanced-markers-collision/docs/index.js @@ -5,23 +5,21 @@ * SPDX-License-Identifier: Apache-2.0 */ -// eslint-disable no-undef // [START maps_advanced_markers_collision] const mapElement = document.querySelector('gmp-map'); // Initialize and add the map -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const markers = []; const collisionBehavior = 'REQUIRED'; - // @ts-expect-error: mdc not typed const select = new mdc.select.MDCSelect( document.querySelector('.mdc-select') ); @@ -63,5 +61,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_advanced_markers_collision] diff --git a/dist/samples/advanced-markers-collision/docs/index.ts b/dist/samples/advanced-markers-collision/docs/index.ts index 86e2ef1a1..1343c1785 100644 --- a/dist/samples/advanced-markers-collision/docs/index.ts +++ b/dist/samples/advanced-markers-collision/docs/index.ts @@ -4,16 +4,15 @@ * SPDX-License-Identifier: Apache-2.0 */ -// eslint-disable no-undef // [START maps_advanced_markers_collision] const mapElement = document.querySelector('gmp-map')!; // Initialize and add the map -async function initMap(): Promise { +async function init(): Promise { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const markers: google.maps.marker.AdvancedMarkerElement[] = []; @@ -63,5 +62,5 @@ async function initMap(): Promise { }); } -void initMap(); +void init(); // [END maps_advanced_markers_collision] diff --git a/dist/samples/advanced-markers-collision/jsfiddle/demo.js b/dist/samples/advanced-markers-collision/jsfiddle/demo.js index ca5662aa2..a523e6f2e 100644 --- a/dist/samples/advanced-markers-collision/jsfiddle/demo.js +++ b/dist/samples/advanced-markers-collision/jsfiddle/demo.js @@ -5,23 +5,20 @@ * SPDX-License-Identifier: Apache-2.0 */ -// eslint-disable no-undef - const mapElement = document.querySelector('gmp-map'); // Initialize and add the map -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const markers = []; const collisionBehavior = 'REQUIRED'; - // @ts-expect-error: mdc not typed const select = new mdc.select.MDCSelect( document.querySelector('.mdc-select') ); @@ -62,4 +59,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/advanced-markers-draggable/app/index.ts b/dist/samples/advanced-markers-draggable/app/index.ts index 11724e200..284325ede 100644 --- a/dist/samples/advanced-markers-draggable/app/index.ts +++ b/dist/samples/advanced-markers-draggable/app/index.ts @@ -7,7 +7,7 @@ // [START maps_advanced_markers_draggable] const mapElement = document.querySelector('gmp-map')!; -async function initMap() { +async function init() { // Request needed libraries. const [{ InfoWindow }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -33,5 +33,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_advanced_markers_draggable] diff --git a/dist/samples/advanced-markers-draggable/docs/index.js b/dist/samples/advanced-markers-draggable/docs/index.js index cd3092462..b7bfbb302 100644 --- a/dist/samples/advanced-markers-draggable/docs/index.js +++ b/dist/samples/advanced-markers-draggable/docs/index.js @@ -8,7 +8,7 @@ // [START maps_advanced_markers_draggable] const mapElement = document.querySelector('gmp-map'); -async function initMap() { +async function init() { // Request needed libraries. const [{ InfoWindow }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -34,5 +34,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_advanced_markers_draggable] diff --git a/dist/samples/advanced-markers-draggable/docs/index.ts b/dist/samples/advanced-markers-draggable/docs/index.ts index 11724e200..284325ede 100644 --- a/dist/samples/advanced-markers-draggable/docs/index.ts +++ b/dist/samples/advanced-markers-draggable/docs/index.ts @@ -7,7 +7,7 @@ // [START maps_advanced_markers_draggable] const mapElement = document.querySelector('gmp-map')!; -async function initMap() { +async function init() { // Request needed libraries. const [{ InfoWindow }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -33,5 +33,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_advanced_markers_draggable] diff --git a/dist/samples/advanced-markers-draggable/jsfiddle/demo.js b/dist/samples/advanced-markers-draggable/jsfiddle/demo.js index 71b7abb5a..4bd19f6f4 100644 --- a/dist/samples/advanced-markers-draggable/jsfiddle/demo.js +++ b/dist/samples/advanced-markers-draggable/jsfiddle/demo.js @@ -7,7 +7,7 @@ const mapElement = document.querySelector('gmp-map'); -async function initMap() { +async function init() { // Request needed libraries. const [{ InfoWindow }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -31,4 +31,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/advanced-markers-graphics/app/index.ts b/dist/samples/advanced-markers-graphics/app/index.ts index b4f0b2840..642fcb703 100644 --- a/dist/samples/advanced-markers-graphics/app/index.ts +++ b/dist/samples/advanced-markers-graphics/app/index.ts @@ -5,13 +5,13 @@ */ // [START maps_advanced_markers_graphics] -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement, PinElement }, { Place }] = + const [{ AdvancedMarkerElement, PinElement }, { Place }] = await Promise.all([ - google.maps.importLibrary('maps'), google.maps.importLibrary('marker'), google.maps.importLibrary('places'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map')!; @@ -98,5 +98,5 @@ async function initMap() { // [END maps_advanced_markers_graphics_place_icon] } -void initMap(); +void init(); // [END maps_advanced_markers_graphics] diff --git a/dist/samples/advanced-markers-graphics/dist/assets/index-Sbzf46WX.js b/dist/samples/advanced-markers-graphics/dist/assets/index-Sbzf46WX.js new file mode 100644 index 000000000..18e283142 --- /dev/null +++ b/dist/samples/advanced-markers-graphics/dist/assets/index-Sbzf46WX.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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`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[{AdvancedMarkerElement:e,PinElement:t},{Place:n}]=await Promise.all([google.maps.importLibrary(`marker`),google.maps.importLibrary(`places`),google.maps.importLibrary(`maps`)]),r=document.querySelector(`gmp-map`),i=new DOMParser().parseFromString(``,`image/svg+xml`).documentElement,a=new e({position:{lat:37.42475,lng:-122.094},title:`A marker using a custom SVG image.`,anchorLeft:`-50%`,anchorTop:`-50%`});a.append(i),r.append(a);let o=document.createElement(`img`);o.src=new URL(``+new URL(`../beachflag.png`,import.meta.url).href,``+import.meta.url).href;let s=new e({position:{lat:37.434,lng:-122.082},title:`A marker using a custom PNG Image`,anchorLeft:`0px`,anchorTop:`100%`});s.append(o),r.append(s);let c=new t({glyphSrc:new URL(``+new URL(`../google_logo_g.svg`,import.meta.url).href,``+import.meta.url)}),l=new e({position:{lat:37.425,lng:-122.07},title:`A marker using a custom SVG for the glyph.`});l.append(c),r.append(l);let u=new n({id:`ChIJN5Nz71W3j4ARhx5bwpTQEGg`});await u.fetchFields({fields:[`location`,`displayName`,`svgIconMaskURI`,`iconBackgroundColor`]});let d=new t({background:u.iconBackgroundColor,glyphSrc:new URL(String(u.svgIconMaskURI))}),f=new e({position:u.location,title:u.displayName});f.append(d),r.append(f)}e(); \ No newline at end of file diff --git a/dist/samples/advanced-markers-graphics/dist/assets/index-ew87NHl3.js b/dist/samples/advanced-markers-graphics/dist/assets/index-ew87NHl3.js deleted file mode 100644 index b2c0fecf4..000000000 --- a/dist/samples/advanced-markers-graphics/dist/assets/index-ew87NHl3.js +++ /dev/null @@ -1 +0,0 @@ -(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`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[,{AdvancedMarkerElement:e,PinElement:t},{Place:n}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`marker`),google.maps.importLibrary(`places`)]),r=document.querySelector(`gmp-map`),i=new DOMParser().parseFromString(``,`image/svg+xml`).documentElement,a=new e({position:{lat:37.42475,lng:-122.094},title:`A marker using a custom SVG image.`,anchorLeft:`-50%`,anchorTop:`-50%`});a.append(i),r.append(a);let o=document.createElement(`img`);o.src=new URL(``+new URL(`../beachflag.png`,import.meta.url).href,``+import.meta.url).href;let s=new e({position:{lat:37.434,lng:-122.082},title:`A marker using a custom PNG Image`,anchorLeft:`0px`,anchorTop:`100%`});s.append(o),r.append(s);let c=new t({glyphSrc:new URL(``+new URL(`../google_logo_g.svg`,import.meta.url).href,``+import.meta.url)}),l=new e({position:{lat:37.425,lng:-122.07},title:`A marker using a custom SVG for the glyph.`});l.append(c),r.append(l);let u=new n({id:`ChIJN5Nz71W3j4ARhx5bwpTQEGg`});await u.fetchFields({fields:[`location`,`displayName`,`svgIconMaskURI`,`iconBackgroundColor`]});let d=new t({background:u.iconBackgroundColor,glyphSrc:new URL(String(u.svgIconMaskURI))}),f=new e({position:u.location,title:u.displayName});f.append(d),r.append(f)}e(); \ No newline at end of file diff --git a/dist/samples/advanced-markers-graphics/dist/index.html b/dist/samples/advanced-markers-graphics/dist/index.html index 5afc5cd57..8693ff517 100644 --- a/dist/samples/advanced-markers-graphics/dist/index.html +++ b/dist/samples/advanced-markers-graphics/dist/index.html @@ -14,7 +14,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/advanced-markers-graphics/docs/index.js b/dist/samples/advanced-markers-graphics/docs/index.js index 388f73e36..db0d8dbf9 100644 --- a/dist/samples/advanced-markers-graphics/docs/index.js +++ b/dist/samples/advanced-markers-graphics/docs/index.js @@ -5,13 +5,13 @@ */ // [START maps_advanced_markers_graphics] -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement, PinElement }, { Place }] = + const [{ AdvancedMarkerElement, PinElement }, { Place }] = await Promise.all([ - google.maps.importLibrary('maps'), google.maps.importLibrary('marker'), google.maps.importLibrary('places'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map'); @@ -98,6 +98,6 @@ async function initMap() { // [END maps_advanced_markers_graphics_place_icon] } -void initMap(); +void init(); export {}; // [END maps_advanced_markers_graphics] diff --git a/dist/samples/advanced-markers-graphics/docs/index.ts b/dist/samples/advanced-markers-graphics/docs/index.ts index b4f0b2840..642fcb703 100644 --- a/dist/samples/advanced-markers-graphics/docs/index.ts +++ b/dist/samples/advanced-markers-graphics/docs/index.ts @@ -5,13 +5,13 @@ */ // [START maps_advanced_markers_graphics] -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement, PinElement }, { Place }] = + const [{ AdvancedMarkerElement, PinElement }, { Place }] = await Promise.all([ - google.maps.importLibrary('maps'), google.maps.importLibrary('marker'), google.maps.importLibrary('places'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map')!; @@ -98,5 +98,5 @@ async function initMap() { // [END maps_advanced_markers_graphics_place_icon] } -void initMap(); +void init(); // [END maps_advanced_markers_graphics] diff --git a/dist/samples/advanced-markers-graphics/jsfiddle/demo.js b/dist/samples/advanced-markers-graphics/jsfiddle/demo.js index 8d47c4d0f..e98eb4e5b 100644 --- a/dist/samples/advanced-markers-graphics/jsfiddle/demo.js +++ b/dist/samples/advanced-markers-graphics/jsfiddle/demo.js @@ -4,13 +4,13 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement, PinElement }, { Place }] = + const [{ AdvancedMarkerElement, PinElement }, { Place }] = await Promise.all([ - google.maps.importLibrary('maps'), google.maps.importLibrary('marker'), google.maps.importLibrary('places'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map'); @@ -89,5 +89,5 @@ async function initMap() { mapElement.append(placeIconMarker); } -void initMap(); +void init(); export {}; diff --git a/dist/samples/advanced-markers-html-simple/app/index.ts b/dist/samples/advanced-markers-html-simple/app/index.ts index c0a4d6629..35cbdcc50 100644 --- a/dist/samples/advanced-markers-html-simple/app/index.ts +++ b/dist/samples/advanced-markers-html-simple/app/index.ts @@ -8,11 +8,11 @@ // [START maps_advanced_markers_html_simple_snippet] const mapElement = document.querySelector('gmp-map')!; -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const priceTag = document.createElement('div'); @@ -26,5 +26,5 @@ async function initMap() { mapElement.append(marker); } // [END maps_advanced_markers_html_simple_snippet] -void initMap(); +void init(); // [END maps_advanced_markers_html_simple] diff --git a/dist/samples/advanced-markers-html-simple/dist/assets/index-CIdISgjL.js b/dist/samples/advanced-markers-html-simple/dist/assets/index-CTJOR8W2.js similarity index 68% rename from dist/samples/advanced-markers-html-simple/dist/assets/index-CIdISgjL.js rename to dist/samples/advanced-markers-html-simple/dist/assets/index-CTJOR8W2.js index 5e290e291..b490a6db8 100644 --- a/dist/samples/advanced-markers-html-simple/dist/assets/index-CIdISgjL.js +++ b/dist/samples/advanced-markers-html-simple/dist/assets/index-CTJOR8W2.js @@ -1 +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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=document.querySelector(`gmp-map`);async function t(){let[,{AdvancedMarkerElement:t}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`marker`)]),n=document.createElement(`div`);n.className=`price-tag`,n.textContent=`$2.5M`;let r=new t({position:{lat:37.42,lng:-122.1}});r.append(n),e.append(r)}t(); \ No newline at end of file +(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=document.querySelector(`gmp-map`);async function t(){let[{AdvancedMarkerElement:t}]=await Promise.all([google.maps.importLibrary(`marker`),google.maps.importLibrary(`maps`)]),n=document.createElement(`div`);n.className=`price-tag`,n.textContent=`$2.5M`;let r=new t({position:{lat:37.42,lng:-122.1}});r.append(n),e.append(r)}t(); \ No newline at end of file diff --git a/dist/samples/advanced-markers-html-simple/dist/index.html b/dist/samples/advanced-markers-html-simple/dist/index.html index 27d402b6c..7c7650719 100644 --- a/dist/samples/advanced-markers-html-simple/dist/index.html +++ b/dist/samples/advanced-markers-html-simple/dist/index.html @@ -15,7 +15,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/advanced-markers-html-simple/docs/index.js b/dist/samples/advanced-markers-html-simple/docs/index.js index dcab37987..d0320e02f 100644 --- a/dist/samples/advanced-markers-html-simple/docs/index.js +++ b/dist/samples/advanced-markers-html-simple/docs/index.js @@ -9,11 +9,11 @@ // [START maps_advanced_markers_html_simple_snippet] const mapElement = document.querySelector('gmp-map'); -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const priceTag = document.createElement('div'); @@ -27,5 +27,5 @@ async function initMap() { mapElement.append(marker); } // [END maps_advanced_markers_html_simple_snippet] -void initMap(); +void init(); // [END maps_advanced_markers_html_simple] diff --git a/dist/samples/advanced-markers-html-simple/docs/index.ts b/dist/samples/advanced-markers-html-simple/docs/index.ts index c0a4d6629..35cbdcc50 100644 --- a/dist/samples/advanced-markers-html-simple/docs/index.ts +++ b/dist/samples/advanced-markers-html-simple/docs/index.ts @@ -8,11 +8,11 @@ // [START maps_advanced_markers_html_simple_snippet] const mapElement = document.querySelector('gmp-map')!; -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const priceTag = document.createElement('div'); @@ -26,5 +26,5 @@ async function initMap() { mapElement.append(marker); } // [END maps_advanced_markers_html_simple_snippet] -void initMap(); +void init(); // [END maps_advanced_markers_html_simple] diff --git a/dist/samples/advanced-markers-html-simple/jsfiddle/demo.js b/dist/samples/advanced-markers-html-simple/jsfiddle/demo.js index 81596b441..844879eeb 100644 --- a/dist/samples/advanced-markers-html-simple/jsfiddle/demo.js +++ b/dist/samples/advanced-markers-html-simple/jsfiddle/demo.js @@ -7,11 +7,11 @@ const mapElement = document.querySelector('gmp-map'); -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const priceTag = document.createElement('div'); @@ -25,4 +25,4 @@ async function initMap() { mapElement.append(marker); } -void initMap(); +void init(); diff --git a/dist/samples/advanced-markers-html/app/index.ts b/dist/samples/advanced-markers-html/app/index.ts index 0f3bc1537..35db51f9a 100644 --- a/dist/samples/advanced-markers-html/app/index.ts +++ b/dist/samples/advanced-markers-html/app/index.ts @@ -6,7 +6,7 @@ // [START maps_advanced_markers_html] // [START maps_advanced_markers_html_snippet] -async function initMap() { +async function init() { // Request needed libraries. const [{ Map }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -211,5 +211,5 @@ const properties = [ }, ]; -void initMap(); +void init(); // [END maps_advanced_markers_html] diff --git a/dist/samples/advanced-markers-html/docs/index.js b/dist/samples/advanced-markers-html/docs/index.js index a9e368687..f6d4882b9 100644 --- a/dist/samples/advanced-markers-html/docs/index.js +++ b/dist/samples/advanced-markers-html/docs/index.js @@ -7,7 +7,7 @@ // [START maps_advanced_markers_html] // [START maps_advanced_markers_html_snippet] -async function initMap() { +async function init() { // Request needed libraries. const [{ Map }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -212,5 +212,5 @@ const properties = [ }, ]; -void initMap(); +void init(); // [END maps_advanced_markers_html] diff --git a/dist/samples/advanced-markers-html/docs/index.ts b/dist/samples/advanced-markers-html/docs/index.ts index 0f3bc1537..35db51f9a 100644 --- a/dist/samples/advanced-markers-html/docs/index.ts +++ b/dist/samples/advanced-markers-html/docs/index.ts @@ -6,7 +6,7 @@ // [START maps_advanced_markers_html] // [START maps_advanced_markers_html_snippet] -async function initMap() { +async function init() { // Request needed libraries. const [{ Map }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -211,5 +211,5 @@ const properties = [ }, ]; -void initMap(); +void init(); // [END maps_advanced_markers_html] diff --git a/dist/samples/advanced-markers-html/jsfiddle/demo.js b/dist/samples/advanced-markers-html/jsfiddle/demo.js index 0e9fabcf3..d8e6c7dc3 100644 --- a/dist/samples/advanced-markers-html/jsfiddle/demo.js +++ b/dist/samples/advanced-markers-html/jsfiddle/demo.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { // Request needed libraries. const [{ Map }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -210,4 +210,4 @@ const properties = [ }, ]; -void initMap(); +void init(); diff --git a/dist/samples/advanced-markers-simple/app/index.ts b/dist/samples/advanced-markers-simple/app/index.ts index 4eba2456f..0e5cbb201 100644 --- a/dist/samples/advanced-markers-simple/app/index.ts +++ b/dist/samples/advanced-markers-simple/app/index.ts @@ -8,11 +8,11 @@ // [START maps_advanced_markers_simple_snippet] const mapElement = document.querySelector('gmp-map')!; -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const marker = new AdvancedMarkerElement({ @@ -21,5 +21,5 @@ async function initMap() { mapElement.append(marker); } // [END maps_advanced_markers_simple_snippet] -void initMap(); +void init(); // [END maps_advanced_markers_simple] diff --git a/dist/samples/advanced-markers-simple/dist/assets/index-CaRm1bTX.js b/dist/samples/advanced-markers-simple/dist/assets/index-DXcope9R.js similarity index 74% rename from dist/samples/advanced-markers-simple/dist/assets/index-CaRm1bTX.js rename to dist/samples/advanced-markers-simple/dist/assets/index-DXcope9R.js index 74c3d7aa1..d3915920e 100644 --- a/dist/samples/advanced-markers-simple/dist/assets/index-CaRm1bTX.js +++ b/dist/samples/advanced-markers-simple/dist/assets/index-DXcope9R.js @@ -1 +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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=document.querySelector(`gmp-map`);async function t(){let[,{AdvancedMarkerElement:t}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`marker`)]),n=new t({position:{lat:37.4239163,lng:-122.0947209}});e.append(n)}t(); \ No newline at end of file +(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=document.querySelector(`gmp-map`);async function t(){let[{AdvancedMarkerElement:t}]=await Promise.all([google.maps.importLibrary(`marker`),google.maps.importLibrary(`maps`)]),n=new t({position:{lat:37.4239163,lng:-122.0947209}});e.append(n)}t(); \ No newline at end of file diff --git a/dist/samples/advanced-markers-simple/dist/index.html b/dist/samples/advanced-markers-simple/dist/index.html index ceaa0cccd..9dedebe7e 100644 --- a/dist/samples/advanced-markers-simple/dist/index.html +++ b/dist/samples/advanced-markers-simple/dist/index.html @@ -15,7 +15,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/advanced-markers-simple/docs/index.js b/dist/samples/advanced-markers-simple/docs/index.js index 4ab31bdc8..a9e0d7375 100644 --- a/dist/samples/advanced-markers-simple/docs/index.js +++ b/dist/samples/advanced-markers-simple/docs/index.js @@ -9,11 +9,11 @@ // [START maps_advanced_markers_simple_snippet] const mapElement = document.querySelector('gmp-map'); -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const marker = new AdvancedMarkerElement({ @@ -22,5 +22,5 @@ async function initMap() { mapElement.append(marker); } // [END maps_advanced_markers_simple_snippet] -void initMap(); +void init(); // [END maps_advanced_markers_simple] diff --git a/dist/samples/advanced-markers-simple/docs/index.ts b/dist/samples/advanced-markers-simple/docs/index.ts index 4eba2456f..0e5cbb201 100644 --- a/dist/samples/advanced-markers-simple/docs/index.ts +++ b/dist/samples/advanced-markers-simple/docs/index.ts @@ -8,11 +8,11 @@ // [START maps_advanced_markers_simple_snippet] const mapElement = document.querySelector('gmp-map')!; -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const marker = new AdvancedMarkerElement({ @@ -21,5 +21,5 @@ async function initMap() { mapElement.append(marker); } // [END maps_advanced_markers_simple_snippet] -void initMap(); +void init(); // [END maps_advanced_markers_simple] diff --git a/dist/samples/advanced-markers-simple/jsfiddle/demo.js b/dist/samples/advanced-markers-simple/jsfiddle/demo.js index 4e45ea438..c25be0541 100644 --- a/dist/samples/advanced-markers-simple/jsfiddle/demo.js +++ b/dist/samples/advanced-markers-simple/jsfiddle/demo.js @@ -7,11 +7,11 @@ const mapElement = document.querySelector('gmp-map'); -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const marker = new AdvancedMarkerElement({ @@ -20,4 +20,4 @@ async function initMap() { mapElement.append(marker); } -void initMap(); +void init(); diff --git a/dist/samples/advanced-markers-zoom/app/index.ts b/dist/samples/advanced-markers-zoom/app/index.ts index 8dba1cdd2..63581c46a 100644 --- a/dist/samples/advanced-markers-zoom/app/index.ts +++ b/dist/samples/advanced-markers-zoom/app/index.ts @@ -7,11 +7,11 @@ // [START maps_advanced_markers_zoom] const mapElement = document.querySelector('gmp-map')!; -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const markerOptions = [ @@ -55,5 +55,5 @@ async function initMap() { // [END maps_advanced_markers_zoom_listener] } -void initMap(); +void init(); // [END maps_advanced_markers_zoom] diff --git a/dist/samples/advanced-markers-zoom/dist/assets/index-BBSizdLT.js b/dist/samples/advanced-markers-zoom/dist/assets/index-BBSizdLT.js deleted file mode 100644 index a99e3951b..000000000 --- a/dist/samples/advanced-markers-zoom/dist/assets/index-BBSizdLT.js +++ /dev/null @@ -1 +0,0 @@ -(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=document.querySelector(`gmp-map`);async function t(){let[,{AdvancedMarkerElement:t}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`marker`)]),n=[{position:{lat:37.4239163,lng:-122.094},title:`This marker is visible at zoom level 15 and higher.`,minZoom:14},{position:{lat:37.4245,lng:-122.096},title:`This marker is visible at zoom level 16 and higher.`,minZoom:15},{position:{lat:37.4249,lng:-122.095},title:`This marker is visible at zoom level 17 and higher.`,minZoom:16},{position:{lat:37.425,lng:-122.0955},title:`This marker is visible at zoom level 18 and higher.`,minZoom:17}],r=[];for(let{position:i,title:a}of n){let n=new t({position:i,title:a});e.append(n),r.push(n)}e.innerMap.addListener(`zoom_changed`,()=>{let t=e.innerMap.getZoom();for(let e=0;ea?i:null}})}t(); \ No newline at end of file diff --git a/dist/samples/advanced-markers-zoom/dist/assets/index-Cvw2Ct9s.js b/dist/samples/advanced-markers-zoom/dist/assets/index-Cvw2Ct9s.js new file mode 100644 index 000000000..710f28839 --- /dev/null +++ b/dist/samples/advanced-markers-zoom/dist/assets/index-Cvw2Ct9s.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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=document.querySelector(`gmp-map`);async function t(){let[{AdvancedMarkerElement:t}]=await Promise.all([google.maps.importLibrary(`marker`),google.maps.importLibrary(`maps`)]),n=[{position:{lat:37.4239163,lng:-122.094},title:`This marker is visible at zoom level 15 and higher.`,minZoom:14},{position:{lat:37.4245,lng:-122.096},title:`This marker is visible at zoom level 16 and higher.`,minZoom:15},{position:{lat:37.4249,lng:-122.095},title:`This marker is visible at zoom level 17 and higher.`,minZoom:16},{position:{lat:37.425,lng:-122.0955},title:`This marker is visible at zoom level 18 and higher.`,minZoom:17}],r=[];for(let{position:i,title:a}of n){let n=new t({position:i,title:a});e.append(n),r.push(n)}e.innerMap.addListener(`zoom_changed`,()=>{let t=e.innerMap.getZoom();for(let e=0;ea?i:null}})}t(); \ No newline at end of file diff --git a/dist/samples/advanced-markers-zoom/dist/index.html b/dist/samples/advanced-markers-zoom/dist/index.html index 919748267..392f3ea63 100644 --- a/dist/samples/advanced-markers-zoom/dist/index.html +++ b/dist/samples/advanced-markers-zoom/dist/index.html @@ -15,7 +15,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/advanced-markers-zoom/docs/index.js b/dist/samples/advanced-markers-zoom/docs/index.js index 9b82a52fa..05fcc0b8d 100644 --- a/dist/samples/advanced-markers-zoom/docs/index.js +++ b/dist/samples/advanced-markers-zoom/docs/index.js @@ -8,11 +8,11 @@ // [START maps_advanced_markers_zoom] const mapElement = document.querySelector('gmp-map'); -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const markerOptions = [ @@ -56,5 +56,5 @@ async function initMap() { // [END maps_advanced_markers_zoom_listener] } -void initMap(); +void init(); // [END maps_advanced_markers_zoom] diff --git a/dist/samples/advanced-markers-zoom/docs/index.ts b/dist/samples/advanced-markers-zoom/docs/index.ts index 8dba1cdd2..63581c46a 100644 --- a/dist/samples/advanced-markers-zoom/docs/index.ts +++ b/dist/samples/advanced-markers-zoom/docs/index.ts @@ -7,11 +7,11 @@ // [START maps_advanced_markers_zoom] const mapElement = document.querySelector('gmp-map')!; -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const markerOptions = [ @@ -55,5 +55,5 @@ async function initMap() { // [END maps_advanced_markers_zoom_listener] } -void initMap(); +void init(); // [END maps_advanced_markers_zoom] diff --git a/dist/samples/advanced-markers-zoom/jsfiddle/demo.js b/dist/samples/advanced-markers-zoom/jsfiddle/demo.js index 74817e6e2..da9ef33ff 100644 --- a/dist/samples/advanced-markers-zoom/jsfiddle/demo.js +++ b/dist/samples/advanced-markers-zoom/jsfiddle/demo.js @@ -7,11 +7,11 @@ const mapElement = document.querySelector('gmp-map'); -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const markerOptions = [ @@ -53,4 +53,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/ai-powered-summaries-basic/app/index.ts b/dist/samples/ai-powered-summaries-basic/app/index.ts index b81e10760..08a9a70a5 100644 --- a/dist/samples/ai-powered-summaries-basic/app/index.ts +++ b/dist/samples/ai-powered-summaries-basic/app/index.ts @@ -6,10 +6,10 @@ // [START maps_ai_powered_summaries_basic] const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; let infoWindow; -async function initMap() { +async function init() { const { InfoWindow } = await google.maps.importLibrary('maps'); innerMap = mapElement.innerMap; @@ -81,7 +81,7 @@ async function getPlaceDetails() { content.append(address, lineBreak, summary, lineBreak, attribution); - innerMap.setCenter(place.location); + innerMap.setCenter(place.location!); // Handle marker click. marker.addListener('gmp-click', () => { @@ -101,5 +101,5 @@ function showInfoWindow(marker, place, content) { }); } -void initMap(); +void init(); // [END maps_ai_powered_summaries_basic] diff --git a/dist/samples/ai-powered-summaries-basic/docs/index.js b/dist/samples/ai-powered-summaries-basic/docs/index.js index 0f0685f1e..4db677c9c 100644 --- a/dist/samples/ai-powered-summaries-basic/docs/index.js +++ b/dist/samples/ai-powered-summaries-basic/docs/index.js @@ -10,7 +10,7 @@ const mapElement = document.querySelector('gmp-map'); let innerMap; let infoWindow; -async function initMap() { +async function init() { const { InfoWindow } = await google.maps.importLibrary('maps'); innerMap = mapElement.innerMap; @@ -102,5 +102,5 @@ function showInfoWindow(marker, place, content) { }); } -void initMap(); +void init(); // [END maps_ai_powered_summaries_basic] diff --git a/dist/samples/ai-powered-summaries-basic/docs/index.ts b/dist/samples/ai-powered-summaries-basic/docs/index.ts index b81e10760..08a9a70a5 100644 --- a/dist/samples/ai-powered-summaries-basic/docs/index.ts +++ b/dist/samples/ai-powered-summaries-basic/docs/index.ts @@ -6,10 +6,10 @@ // [START maps_ai_powered_summaries_basic] const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; let infoWindow; -async function initMap() { +async function init() { const { InfoWindow } = await google.maps.importLibrary('maps'); innerMap = mapElement.innerMap; @@ -81,7 +81,7 @@ async function getPlaceDetails() { content.append(address, lineBreak, summary, lineBreak, attribution); - innerMap.setCenter(place.location); + innerMap.setCenter(place.location!); // Handle marker click. marker.addListener('gmp-click', () => { @@ -101,5 +101,5 @@ function showInfoWindow(marker, place, content) { }); } -void initMap(); +void init(); // [END maps_ai_powered_summaries_basic] diff --git a/dist/samples/ai-powered-summaries-basic/jsfiddle/demo.js b/dist/samples/ai-powered-summaries-basic/jsfiddle/demo.js index 8e6039eb2..744bb27c7 100644 --- a/dist/samples/ai-powered-summaries-basic/jsfiddle/demo.js +++ b/dist/samples/ai-powered-summaries-basic/jsfiddle/demo.js @@ -9,7 +9,7 @@ const mapElement = document.querySelector('gmp-map'); let innerMap; let infoWindow; -async function initMap() { +async function init() { const { InfoWindow } = await google.maps.importLibrary('maps'); innerMap = mapElement.innerMap; @@ -98,4 +98,4 @@ function showInfoWindow(marker, place, content) { }); } -void initMap(); +void init(); diff --git a/dist/samples/ai-powered-summaries/app/index.ts b/dist/samples/ai-powered-summaries/app/index.ts index bbd79b4f7..8a1c371b9 100644 --- a/dist/samples/ai-powered-summaries/app/index.ts +++ b/dist/samples/ai-powered-summaries/app/index.ts @@ -20,10 +20,10 @@ const flagContentLink = document.getElementById( 'flag-content-link' ) as HTMLAnchorElement; -let innerMap; +let innerMap: google.maps.Map; let marker: google.maps.marker.AdvancedMarkerElement; -async function initMap(): Promise { +async function init(): Promise { // Request needed libraries. const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), @@ -39,7 +39,7 @@ async function initMap(): Promise { // Bind autocomplete bounds to map bounds. innerMap.addListener('bounds_changed', () => { - placeAutocomplete.locationRestriction = innerMap.getBounds(); + placeAutocomplete.locationRestriction = innerMap.getBounds()!; }); // Create the marker. @@ -72,7 +72,7 @@ async function initMap(): Promise { if (place.viewport) { innerMap.fitBounds(place.viewport); } else { - innerMap.setCenter(place.location); + innerMap.setCenter(place.location!); innerMap.setZoom(17); } marker.position = place.location; @@ -239,5 +239,5 @@ function updateSummaryPanel(place: google.maps.places.Place) { } } -void initMap(); +void init(); // [END maps_ai_powered_summaries] diff --git a/dist/samples/ai-powered-summaries/docs/index.js b/dist/samples/ai-powered-summaries/docs/index.js index d363c83af..07b47acd8 100644 --- a/dist/samples/ai-powered-summaries/docs/index.js +++ b/dist/samples/ai-powered-summaries/docs/index.js @@ -20,7 +20,7 @@ const flagContentLink = document.getElementById('flag-content-link'); let innerMap; let marker; -async function initMap() { +async function init() { // Request needed libraries. const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), @@ -231,5 +231,5 @@ function updateSummaryPanel(place) { } } -void initMap(); +void init(); // [END maps_ai_powered_summaries] diff --git a/dist/samples/ai-powered-summaries/docs/index.ts b/dist/samples/ai-powered-summaries/docs/index.ts index bbd79b4f7..8a1c371b9 100644 --- a/dist/samples/ai-powered-summaries/docs/index.ts +++ b/dist/samples/ai-powered-summaries/docs/index.ts @@ -20,10 +20,10 @@ const flagContentLink = document.getElementById( 'flag-content-link' ) as HTMLAnchorElement; -let innerMap; +let innerMap: google.maps.Map; let marker: google.maps.marker.AdvancedMarkerElement; -async function initMap(): Promise { +async function init(): Promise { // Request needed libraries. const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), @@ -39,7 +39,7 @@ async function initMap(): Promise { // Bind autocomplete bounds to map bounds. innerMap.addListener('bounds_changed', () => { - placeAutocomplete.locationRestriction = innerMap.getBounds(); + placeAutocomplete.locationRestriction = innerMap.getBounds()!; }); // Create the marker. @@ -72,7 +72,7 @@ async function initMap(): Promise { if (place.viewport) { innerMap.fitBounds(place.viewport); } else { - innerMap.setCenter(place.location); + innerMap.setCenter(place.location!); innerMap.setZoom(17); } marker.position = place.location; @@ -239,5 +239,5 @@ function updateSummaryPanel(place: google.maps.places.Place) { } } -void initMap(); +void init(); // [END maps_ai_powered_summaries] diff --git a/dist/samples/ai-powered-summaries/jsfiddle/demo.js b/dist/samples/ai-powered-summaries/jsfiddle/demo.js index 2bb489c2a..95579fe08 100644 --- a/dist/samples/ai-powered-summaries/jsfiddle/demo.js +++ b/dist/samples/ai-powered-summaries/jsfiddle/demo.js @@ -19,7 +19,7 @@ const flagContentLink = document.getElementById('flag-content-link'); let innerMap; let marker; -async function initMap() { +async function init() { // Request needed libraries. const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), @@ -229,4 +229,4 @@ function updateSummaryPanel(place) { } } -void initMap(); +void init(); diff --git a/dist/samples/boundaries-choropleth/app/index.ts b/dist/samples/boundaries-choropleth/app/index.ts index c3f8a193a..de8e916a1 100644 --- a/dist/samples/boundaries-choropleth/app/index.ts +++ b/dist/samples/boundaries-choropleth/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_boundaries_choropleth] -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -102,5 +102,5 @@ async function initMap() { }; } -void initMap(); +void init(); // [END maps_boundaries_choropleth] diff --git a/dist/samples/boundaries-choropleth/docs/index.js b/dist/samples/boundaries-choropleth/docs/index.js index 344b96b2a..32f94e19a 100644 --- a/dist/samples/boundaries-choropleth/docs/index.js +++ b/dist/samples/boundaries-choropleth/docs/index.js @@ -6,7 +6,7 @@ */ // [START maps_boundaries_choropleth] -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -102,5 +102,5 @@ async function initMap() { }; } -void initMap(); +void init(); // [END maps_boundaries_choropleth] diff --git a/dist/samples/boundaries-choropleth/docs/index.ts b/dist/samples/boundaries-choropleth/docs/index.ts index c3f8a193a..de8e916a1 100644 --- a/dist/samples/boundaries-choropleth/docs/index.ts +++ b/dist/samples/boundaries-choropleth/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_boundaries_choropleth] -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -102,5 +102,5 @@ async function initMap() { }; } -void initMap(); +void init(); // [END maps_boundaries_choropleth] diff --git a/dist/samples/boundaries-choropleth/jsfiddle/demo.js b/dist/samples/boundaries-choropleth/jsfiddle/demo.js index 18f2c3423..c526d5f6a 100644 --- a/dist/samples/boundaries-choropleth/jsfiddle/demo.js +++ b/dist/samples/boundaries-choropleth/jsfiddle/demo.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -100,4 +100,4 @@ async function initMap() { }; } -void initMap(); +void init(); diff --git a/dist/samples/boundaries-click/app/index.ts b/dist/samples/boundaries-click/app/index.ts index b6803614f..27912eaa0 100644 --- a/dist/samples/boundaries-click/app/index.ts +++ b/dist/samples/boundaries-click/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_boundaries_click_event] -let innerMap; +let innerMap: google.maps.Map; let featureLayer; let infoWindow; let lastInteractedFeatureIds: string[] = []; @@ -25,7 +25,7 @@ function handleMouseMove(e) { } // [END maps_boundaries_click_event_handler] -async function initMap() { +async function init() { // Request needed libraries. const { InfoWindow } = await google.maps.importLibrary('maps'); @@ -141,5 +141,5 @@ function updateInfoWindow(content, center) { }); } -void initMap(); +void init(); // [END maps_boundaries_click_event] diff --git a/dist/samples/boundaries-click/docs/index.js b/dist/samples/boundaries-click/docs/index.js index bdd367e44..3a3c5b027 100644 --- a/dist/samples/boundaries-click/docs/index.js +++ b/dist/samples/boundaries-click/docs/index.js @@ -26,7 +26,7 @@ function handleMouseMove(e) { } // [END maps_boundaries_click_event_handler] -async function initMap() { +async function init() { // Request needed libraries. const { InfoWindow } = await google.maps.importLibrary('maps'); @@ -142,5 +142,5 @@ function updateInfoWindow(content, center) { }); } -void initMap(); +void init(); // [END maps_boundaries_click_event] diff --git a/dist/samples/boundaries-click/docs/index.ts b/dist/samples/boundaries-click/docs/index.ts index b6803614f..27912eaa0 100644 --- a/dist/samples/boundaries-click/docs/index.ts +++ b/dist/samples/boundaries-click/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_boundaries_click_event] -let innerMap; +let innerMap: google.maps.Map; let featureLayer; let infoWindow; let lastInteractedFeatureIds: string[] = []; @@ -25,7 +25,7 @@ function handleMouseMove(e) { } // [END maps_boundaries_click_event_handler] -async function initMap() { +async function init() { // Request needed libraries. const { InfoWindow } = await google.maps.importLibrary('maps'); @@ -141,5 +141,5 @@ function updateInfoWindow(content, center) { }); } -void initMap(); +void init(); // [END maps_boundaries_click_event] diff --git a/dist/samples/boundaries-click/jsfiddle/demo.js b/dist/samples/boundaries-click/jsfiddle/demo.js index 418964bc2..781ad01f4 100644 --- a/dist/samples/boundaries-click/jsfiddle/demo.js +++ b/dist/samples/boundaries-click/jsfiddle/demo.js @@ -23,7 +23,7 @@ function handleMouseMove(e) { featureLayer.style = applyStyle; } -async function initMap() { +async function init() { // Request needed libraries. const { InfoWindow } = await google.maps.importLibrary('maps'); @@ -135,4 +135,4 @@ function updateInfoWindow(content, center) { }); } -void initMap(); +void init(); diff --git a/dist/samples/boundaries-simple/app/index.ts b/dist/samples/boundaries-simple/app/index.ts index 53893af36..33be8ca1c 100644 --- a/dist/samples/boundaries-simple/app/index.ts +++ b/dist/samples/boundaries-simple/app/index.ts @@ -12,7 +12,7 @@ // [START maps_boundaries_simple] let featureLayer; -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -47,5 +47,5 @@ async function initMap() { // [END maps_boundaries_simple_style_single] } -void initMap(); +void init(); // [END maps_boundaries_simple] diff --git a/dist/samples/boundaries-simple/docs/index.js b/dist/samples/boundaries-simple/docs/index.js index 6c02c233a..9cf1a90c7 100644 --- a/dist/samples/boundaries-simple/docs/index.js +++ b/dist/samples/boundaries-simple/docs/index.js @@ -13,7 +13,7 @@ // [START maps_boundaries_simple] let featureLayer; -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -48,5 +48,5 @@ async function initMap() { // [END maps_boundaries_simple_style_single] } -void initMap(); +void init(); // [END maps_boundaries_simple] diff --git a/dist/samples/boundaries-simple/docs/index.ts b/dist/samples/boundaries-simple/docs/index.ts index 53893af36..33be8ca1c 100644 --- a/dist/samples/boundaries-simple/docs/index.ts +++ b/dist/samples/boundaries-simple/docs/index.ts @@ -12,7 +12,7 @@ // [START maps_boundaries_simple] let featureLayer; -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -47,5 +47,5 @@ async function initMap() { // [END maps_boundaries_simple_style_single] } -void initMap(); +void init(); // [END maps_boundaries_simple] diff --git a/dist/samples/boundaries-simple/jsfiddle/demo.js b/dist/samples/boundaries-simple/jsfiddle/demo.js index b214bcf3b..90548b8b1 100644 --- a/dist/samples/boundaries-simple/jsfiddle/demo.js +++ b/dist/samples/boundaries-simple/jsfiddle/demo.js @@ -12,7 +12,7 @@ let featureLayer; -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -43,4 +43,4 @@ async function initMap() { }; } -void initMap(); +void init(); diff --git a/dist/samples/boundaries-text-search/app/index.ts b/dist/samples/boundaries-text-search/app/index.ts index 182f51e25..6e18e407b 100644 --- a/dist/samples/boundaries-text-search/app/index.ts +++ b/dist/samples/boundaries-text-search/app/index.ts @@ -5,11 +5,11 @@ */ // [START maps_boundaries_text_search] -let innerMap; +let innerMap: google.maps.Map; let featureLayer; let center; -async function initMap() { +async function init() { // Load the needed libraries. await google.maps.importLibrary('maps'); @@ -41,7 +41,7 @@ async function findBoundary() { if (places.length) { const place = places[0]; styleBoundary(place.id); - innerMap.setCenter(place.location); + innerMap.setCenter(place.location!); } else { console.log('No results'); } @@ -65,5 +65,5 @@ function styleBoundary(placeid) { }; } // [END maps_boundaries_text_search_find_region] -void initMap(); +void init(); // [END maps_boundaries_text_search] diff --git a/dist/samples/boundaries-text-search/docs/index.js b/dist/samples/boundaries-text-search/docs/index.js index 253679e66..c94adf8a2 100644 --- a/dist/samples/boundaries-text-search/docs/index.js +++ b/dist/samples/boundaries-text-search/docs/index.js @@ -10,7 +10,7 @@ let innerMap; let featureLayer; let center; -async function initMap() { +async function init() { // Load the needed libraries. await google.maps.importLibrary('maps'); @@ -66,5 +66,5 @@ function styleBoundary(placeid) { }; } // [END maps_boundaries_text_search_find_region] -void initMap(); +void init(); // [END maps_boundaries_text_search] diff --git a/dist/samples/boundaries-text-search/docs/index.ts b/dist/samples/boundaries-text-search/docs/index.ts index 182f51e25..6e18e407b 100644 --- a/dist/samples/boundaries-text-search/docs/index.ts +++ b/dist/samples/boundaries-text-search/docs/index.ts @@ -5,11 +5,11 @@ */ // [START maps_boundaries_text_search] -let innerMap; +let innerMap: google.maps.Map; let featureLayer; let center; -async function initMap() { +async function init() { // Load the needed libraries. await google.maps.importLibrary('maps'); @@ -41,7 +41,7 @@ async function findBoundary() { if (places.length) { const place = places[0]; styleBoundary(place.id); - innerMap.setCenter(place.location); + innerMap.setCenter(place.location!); } else { console.log('No results'); } @@ -65,5 +65,5 @@ function styleBoundary(placeid) { }; } // [END maps_boundaries_text_search_find_region] -void initMap(); +void init(); // [END maps_boundaries_text_search] diff --git a/dist/samples/boundaries-text-search/jsfiddle/demo.js b/dist/samples/boundaries-text-search/jsfiddle/demo.js index 4cf7ff810..a70131e37 100644 --- a/dist/samples/boundaries-text-search/jsfiddle/demo.js +++ b/dist/samples/boundaries-text-search/jsfiddle/demo.js @@ -9,7 +9,7 @@ let innerMap; let featureLayer; let center; -async function initMap() { +async function init() { // Load the needed libraries. await google.maps.importLibrary('maps'); @@ -65,4 +65,4 @@ function styleBoundary(placeid) { }; } -void initMap(); +void init(); diff --git a/dist/samples/circle-simple/app/index.ts b/dist/samples/circle-simple/app/index.ts index f3a8cbbf4..25f20b01c 100644 --- a/dist/samples/circle-simple/app/index.ts +++ b/dist/samples/circle-simple/app/index.ts @@ -6,9 +6,9 @@ // [START maps_circle_simple] const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; -async function initMap() { +async function init() { // Request needed libraries. const [{ Circle }, { AdvancedMarkerElement }, { event }] = await Promise.all([ @@ -71,8 +71,8 @@ async function initMap() { // Add event listener to update the radius based on user selection. buttons.forEach((button) => { - button.addEventListener('change', (event) => { - const target = event.target as HTMLInputElement; + button.addEventListener('change', (changeEvent) => { + const target = changeEvent.target as HTMLInputElement; walkingCircle.setRadius(Number(target.value)); }); }); @@ -91,5 +91,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_circle_simple] diff --git a/dist/samples/circle-simple/docs/index.js b/dist/samples/circle-simple/docs/index.js index a82596e05..bca54c7d2 100644 --- a/dist/samples/circle-simple/docs/index.js +++ b/dist/samples/circle-simple/docs/index.js @@ -9,7 +9,7 @@ const mapElement = document.querySelector('gmp-map'); let innerMap; -async function initMap() { +async function init() { // Request needed libraries. const [{ Circle }, { AdvancedMarkerElement }, { event }] = await Promise.all([ @@ -72,8 +72,8 @@ async function initMap() { // Add event listener to update the radius based on user selection. buttons.forEach((button) => { - button.addEventListener('change', (event) => { - const target = event.target; + button.addEventListener('change', (changeEvent) => { + const target = changeEvent.target; walkingCircle.setRadius(Number(target.value)); }); }); @@ -92,5 +92,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_circle_simple] diff --git a/dist/samples/circle-simple/docs/index.ts b/dist/samples/circle-simple/docs/index.ts index f3a8cbbf4..25f20b01c 100644 --- a/dist/samples/circle-simple/docs/index.ts +++ b/dist/samples/circle-simple/docs/index.ts @@ -6,9 +6,9 @@ // [START maps_circle_simple] const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; -async function initMap() { +async function init() { // Request needed libraries. const [{ Circle }, { AdvancedMarkerElement }, { event }] = await Promise.all([ @@ -71,8 +71,8 @@ async function initMap() { // Add event listener to update the radius based on user selection. buttons.forEach((button) => { - button.addEventListener('change', (event) => { - const target = event.target as HTMLInputElement; + button.addEventListener('change', (changeEvent) => { + const target = changeEvent.target as HTMLInputElement; walkingCircle.setRadius(Number(target.value)); }); }); @@ -91,5 +91,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_circle_simple] diff --git a/dist/samples/circle-simple/jsfiddle/demo.js b/dist/samples/circle-simple/jsfiddle/demo.js index 62ee167e2..33ec77d9d 100644 --- a/dist/samples/circle-simple/jsfiddle/demo.js +++ b/dist/samples/circle-simple/jsfiddle/demo.js @@ -8,7 +8,7 @@ const mapElement = document.querySelector('gmp-map'); let innerMap; -async function initMap() { +async function init() { // Request needed libraries. const [{ Circle }, { AdvancedMarkerElement }, { event }] = await Promise.all([ @@ -71,8 +71,8 @@ async function initMap() { // Add event listener to update the radius based on user selection. buttons.forEach((button) => { - button.addEventListener('change', (event) => { - const target = event.target; + button.addEventListener('change', (changeEvent) => { + const target = changeEvent.target; walkingCircle.setRadius(Number(target.value)); }); }); @@ -91,4 +91,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/control-bounds-restriction/app/index.ts b/dist/samples/control-bounds-restriction/app/index.ts index 3fe474b6c..04457fffd 100644 --- a/dist/samples/control-bounds-restriction/app/index.ts +++ b/dist/samples/control-bounds-restriction/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_control_bounds_restriction] -let innerMap; +let innerMap: google.maps.Map; const mapElement = document.querySelector('gmp-map')!; // [START maps_control_bounds_restriction_region] @@ -17,7 +17,7 @@ const NEW_ZEALAND_BOUNDS = { }; // [END maps_control_bounds_restriction_region] -async function initMap() { +async function init() { // Import the needed libraries. await google.maps.importLibrary('maps'); @@ -33,5 +33,5 @@ async function initMap() { // [END maps_control_bounds_restriction_options] } -void initMap(); +void init(); // [END maps_control_bounds_restriction] diff --git a/dist/samples/control-bounds-restriction/docs/index.js b/dist/samples/control-bounds-restriction/docs/index.js index afd484dc2..03fcd766c 100644 --- a/dist/samples/control-bounds-restriction/docs/index.js +++ b/dist/samples/control-bounds-restriction/docs/index.js @@ -18,7 +18,7 @@ const NEW_ZEALAND_BOUNDS = { }; // [END maps_control_bounds_restriction_region] -async function initMap() { +async function init() { // Import the needed libraries. await google.maps.importLibrary('maps'); @@ -34,5 +34,5 @@ async function initMap() { // [END maps_control_bounds_restriction_options] } -void initMap(); +void init(); // [END maps_control_bounds_restriction] diff --git a/dist/samples/control-bounds-restriction/docs/index.ts b/dist/samples/control-bounds-restriction/docs/index.ts index 3fe474b6c..04457fffd 100644 --- a/dist/samples/control-bounds-restriction/docs/index.ts +++ b/dist/samples/control-bounds-restriction/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_control_bounds_restriction] -let innerMap; +let innerMap: google.maps.Map; const mapElement = document.querySelector('gmp-map')!; // [START maps_control_bounds_restriction_region] @@ -17,7 +17,7 @@ const NEW_ZEALAND_BOUNDS = { }; // [END maps_control_bounds_restriction_region] -async function initMap() { +async function init() { // Import the needed libraries. await google.maps.importLibrary('maps'); @@ -33,5 +33,5 @@ async function initMap() { // [END maps_control_bounds_restriction_options] } -void initMap(); +void init(); // [END maps_control_bounds_restriction] diff --git a/dist/samples/control-bounds-restriction/jsfiddle/demo.js b/dist/samples/control-bounds-restriction/jsfiddle/demo.js index d23b275cc..2c944c002 100644 --- a/dist/samples/control-bounds-restriction/jsfiddle/demo.js +++ b/dist/samples/control-bounds-restriction/jsfiddle/demo.js @@ -15,7 +15,7 @@ const NEW_ZEALAND_BOUNDS = { east: -175.81, }; -async function initMap() { +async function init() { // Import the needed libraries. await google.maps.importLibrary('maps'); @@ -30,4 +30,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/control-custom-state/app/index.ts b/dist/samples/control-custom-state/app/index.ts index a5c7030e7..efc8a9110 100755 --- a/dist/samples/control-custom-state/app/index.ts +++ b/dist/samples/control-custom-state/app/index.ts @@ -5,12 +5,15 @@ */ // [START maps_control_custom_state] -let innerMap; +let innerMap: google.maps.Map; const mapElement = document.querySelector('gmp-map')!; -let center: google.maps.LatLngLiteral = { lat: 41.85, lng: -87.65 }; +let center: google.maps.LatLngLiteral | google.maps.LatLng = { + lat: 41.85, + lng: -87.65, +}; -async function initMap() { +async function init() { await google.maps.importLibrary('maps'); innerMap = mapElement.innerMap; @@ -43,5 +46,5 @@ async function initMap() { // [END maps_control_custom_state_event_listeners] } -void initMap(); +void init(); // [END maps_control_custom_state] diff --git a/dist/samples/control-custom-state/docs/index.js b/dist/samples/control-custom-state/docs/index.js index c1aac338a..f16024f55 100644 --- a/dist/samples/control-custom-state/docs/index.js +++ b/dist/samples/control-custom-state/docs/index.js @@ -9,9 +9,12 @@ let innerMap; const mapElement = document.querySelector('gmp-map'); -let center = { lat: 41.85, lng: -87.65 }; +let center = { + lat: 41.85, + lng: -87.65, +}; -async function initMap() { +async function init() { await google.maps.importLibrary('maps'); innerMap = mapElement.innerMap; @@ -40,5 +43,5 @@ async function initMap() { // [END maps_control_custom_state_event_listeners] } -void initMap(); +void init(); // [END maps_control_custom_state] diff --git a/dist/samples/control-custom-state/docs/index.ts b/dist/samples/control-custom-state/docs/index.ts index a5c7030e7..efc8a9110 100755 --- a/dist/samples/control-custom-state/docs/index.ts +++ b/dist/samples/control-custom-state/docs/index.ts @@ -5,12 +5,15 @@ */ // [START maps_control_custom_state] -let innerMap; +let innerMap: google.maps.Map; const mapElement = document.querySelector('gmp-map')!; -let center: google.maps.LatLngLiteral = { lat: 41.85, lng: -87.65 }; +let center: google.maps.LatLngLiteral | google.maps.LatLng = { + lat: 41.85, + lng: -87.65, +}; -async function initMap() { +async function init() { await google.maps.importLibrary('maps'); innerMap = mapElement.innerMap; @@ -43,5 +46,5 @@ async function initMap() { // [END maps_control_custom_state_event_listeners] } -void initMap(); +void init(); // [END maps_control_custom_state] diff --git a/dist/samples/control-custom-state/jsfiddle/demo.js b/dist/samples/control-custom-state/jsfiddle/demo.js index cfdef270c..d2d4ca979 100644 --- a/dist/samples/control-custom-state/jsfiddle/demo.js +++ b/dist/samples/control-custom-state/jsfiddle/demo.js @@ -8,9 +8,12 @@ let innerMap; const mapElement = document.querySelector('gmp-map'); -let center = { lat: 41.85, lng: -87.65 }; +let center = { + lat: 41.85, + lng: -87.65, +}; -async function initMap() { +async function init() { await google.maps.importLibrary('maps'); innerMap = mapElement.innerMap; @@ -37,4 +40,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/control-disableUI/app/index.ts b/dist/samples/control-disableUI/app/index.ts index 08d12753b..8e4133294 100644 --- a/dist/samples/control-disableUI/app/index.ts +++ b/dist/samples/control-disableUI/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_control_disableUI] -async function initMap() { +async function init() { // Request the needed libraries. await google.maps.importLibrary('maps'); @@ -21,5 +21,5 @@ async function initMap() { // [END maps_control_disableUI_options] } -void initMap(); +void init(); // [END maps_control_disableUI] diff --git a/dist/samples/control-disableUI/docs/index.js b/dist/samples/control-disableUI/docs/index.js index 9474fd030..1f4b91847 100644 --- a/dist/samples/control-disableUI/docs/index.js +++ b/dist/samples/control-disableUI/docs/index.js @@ -6,7 +6,7 @@ */ // [START maps_control_disableUI] -async function initMap() { +async function init() { // Request the needed libraries. await google.maps.importLibrary('maps'); @@ -22,5 +22,5 @@ async function initMap() { // [END maps_control_disableUI_options] } -void initMap(); +void init(); // [END maps_control_disableUI] diff --git a/dist/samples/control-disableUI/docs/index.ts b/dist/samples/control-disableUI/docs/index.ts index 08d12753b..8e4133294 100644 --- a/dist/samples/control-disableUI/docs/index.ts +++ b/dist/samples/control-disableUI/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_control_disableUI] -async function initMap() { +async function init() { // Request the needed libraries. await google.maps.importLibrary('maps'); @@ -21,5 +21,5 @@ async function initMap() { // [END maps_control_disableUI_options] } -void initMap(); +void init(); // [END maps_control_disableUI] diff --git a/dist/samples/control-disableUI/jsfiddle/demo.js b/dist/samples/control-disableUI/jsfiddle/demo.js index 04516d9d8..f212ff456 100644 --- a/dist/samples/control-disableUI/jsfiddle/demo.js +++ b/dist/samples/control-disableUI/jsfiddle/demo.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { // Request the needed libraries. await google.maps.importLibrary('maps'); @@ -19,4 +19,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/control-options/app/index.ts b/dist/samples/control-options/app/index.ts index d38d8fd31..d20aa00f3 100755 --- a/dist/samples/control-options/app/index.ts +++ b/dist/samples/control-options/app/index.ts @@ -8,7 +8,7 @@ // You can set control options to change the default position or style of many // of the map controls. -async function initMap() { +async function init() { // Request the needed libraries. const [{ MapTypeControlStyle, MapTypeId }, { ControlPosition }] = await Promise.all([ @@ -32,5 +32,5 @@ async function initMap() { // [END maps_control_options_change_default] } -void initMap(); +void init(); // [END maps_control_options] diff --git a/dist/samples/control-options/docs/index.js b/dist/samples/control-options/docs/index.js index a92dc9adb..41ac5cfd7 100644 --- a/dist/samples/control-options/docs/index.js +++ b/dist/samples/control-options/docs/index.js @@ -9,7 +9,7 @@ // You can set control options to change the default position or style of many // of the map controls. -async function initMap() { +async function init() { // Request the needed libraries. const [{ MapTypeControlStyle, MapTypeId }, { ControlPosition }] = await Promise.all([ @@ -33,5 +33,5 @@ async function initMap() { // [END maps_control_options_change_default] } -void initMap(); +void init(); // [END maps_control_options] diff --git a/dist/samples/control-options/docs/index.ts b/dist/samples/control-options/docs/index.ts index d38d8fd31..d20aa00f3 100755 --- a/dist/samples/control-options/docs/index.ts +++ b/dist/samples/control-options/docs/index.ts @@ -8,7 +8,7 @@ // You can set control options to change the default position or style of many // of the map controls. -async function initMap() { +async function init() { // Request the needed libraries. const [{ MapTypeControlStyle, MapTypeId }, { ControlPosition }] = await Promise.all([ @@ -32,5 +32,5 @@ async function initMap() { // [END maps_control_options_change_default] } -void initMap(); +void init(); // [END maps_control_options] diff --git a/dist/samples/control-options/jsfiddle/demo.js b/dist/samples/control-options/jsfiddle/demo.js index 1d2546c1d..6bc0f4eaa 100644 --- a/dist/samples/control-options/jsfiddle/demo.js +++ b/dist/samples/control-options/jsfiddle/demo.js @@ -8,7 +8,7 @@ // You can set control options to change the default position or style of many // of the map controls. -async function initMap() { +async function init() { // Request the needed libraries. const [{ MapTypeControlStyle, MapTypeId }, { ControlPosition }] = await Promise.all([ @@ -30,4 +30,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/control-positioning-labels/app/index.ts b/dist/samples/control-positioning-labels/app/index.ts index 2de6f36e8..5429eccaa 100644 --- a/dist/samples/control-positioning-labels/app/index.ts +++ b/dist/samples/control-positioning-labels/app/index.ts @@ -33,11 +33,11 @@ function MakeControl(controlDiv: HTMLElement, label: string) { controlUI.appendChild(controlText); } -async function initMap() { +async function init() { // Request the needed libraries. - const [, { ControlPosition }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ ControlPosition }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map')!; @@ -81,5 +81,5 @@ function toggleRTL() { } } -void initMap(); +void init(); // [END maps_control_positioning_labels] diff --git a/dist/samples/control-positioning-labels/dist/assets/index-B0MmW35h.js b/dist/samples/control-positioning-labels/dist/assets/index-DGaMZhEd.js similarity index 58% rename from dist/samples/control-positioning-labels/dist/assets/index-B0MmW35h.js rename to dist/samples/control-positioning-labels/dist/assets/index-DGaMZhEd.js index 31443f611..a09467999 100644 --- a/dist/samples/control-positioning-labels/dist/assets/index-B0MmW35h.js +++ b/dist/samples/control-positioning-labels/dist/assets/index-DGaMZhEd.js @@ -1 +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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function e(e,t){let n=document.createElement(`div`);n.style.backgroundColor=`#fff`,n.style.padding=`3px`,n.style.cursor=`pointer`,n.style.textAlign=`center`,n.title=`Click to toggle RTL/LTR`,n.className=`controlUI`,e.appendChild(n);let r=document.createElement(`div`);r.style.fontSize=`12px`,r.innerHTML=t,r.className=`controlText`,n.appendChild(r)}async function t(){let[,{ControlPosition:t}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`core`)]),r=document.querySelector(`gmp-map`).innerMap;[`BLOCK_START_INLINE_START`,`INLINE_START_BLOCK_START`,`BLOCK_START_INLINE_CENTER`,`BLOCK_START_INLINE_END`,`INLINE_END_BLOCK_START`,`INLINE_START_BLOCK_CENTER`,`INLINE_END_BLOCK_CENTER`,`BLOCK_END_INLINE_START`,`INLINE_START_BLOCK_END`,`BLOCK_END_INLINE_CENTER`,`BLOCK_END_INLINE_END`,`INLINE_END_BLOCK_END`].forEach(i=>{let a=document.createElement(`div`),o=t[i];e(a,i),a.addEventListener(`click`,n),r.controls[o].push(a)})}function n(){let e=document.documentElement;e.dir===`rtl`?e.dir=`ltr`:e.dir=`rtl`}t(); \ No newline at end of file +(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function e(e,t){let n=document.createElement(`div`);n.style.backgroundColor=`#fff`,n.style.padding=`3px`,n.style.cursor=`pointer`,n.style.textAlign=`center`,n.title=`Click to toggle RTL/LTR`,n.className=`controlUI`,e.appendChild(n);let r=document.createElement(`div`);r.style.fontSize=`12px`,r.innerHTML=t,r.className=`controlText`,n.appendChild(r)}async function t(){let[{ControlPosition:t}]=await Promise.all([google.maps.importLibrary(`core`),google.maps.importLibrary(`maps`)]),r=document.querySelector(`gmp-map`).innerMap;[`BLOCK_START_INLINE_START`,`INLINE_START_BLOCK_START`,`BLOCK_START_INLINE_CENTER`,`BLOCK_START_INLINE_END`,`INLINE_END_BLOCK_START`,`INLINE_START_BLOCK_CENTER`,`INLINE_END_BLOCK_CENTER`,`BLOCK_END_INLINE_START`,`INLINE_START_BLOCK_END`,`BLOCK_END_INLINE_CENTER`,`BLOCK_END_INLINE_END`,`INLINE_END_BLOCK_END`].forEach(i=>{let a=document.createElement(`div`),o=t[i];e(a,i),a.addEventListener(`click`,n),r.controls[o].push(a)})}function n(){let e=document.documentElement;e.dir===`rtl`?e.dir=`ltr`:e.dir=`rtl`}t(); \ No newline at end of file diff --git a/dist/samples/control-positioning-labels/dist/index.html b/dist/samples/control-positioning-labels/dist/index.html index ec9484d19..df305a587 100644 --- a/dist/samples/control-positioning-labels/dist/index.html +++ b/dist/samples/control-positioning-labels/dist/index.html @@ -15,7 +15,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/control-positioning-labels/docs/index.js b/dist/samples/control-positioning-labels/docs/index.js index 40f794c32..aaa76811b 100644 --- a/dist/samples/control-positioning-labels/docs/index.js +++ b/dist/samples/control-positioning-labels/docs/index.js @@ -34,11 +34,11 @@ function MakeControl(controlDiv, label) { controlUI.appendChild(controlText); } -async function initMap() { +async function init() { // Request the needed libraries. - const [, { ControlPosition }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ ControlPosition }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map'); @@ -82,5 +82,5 @@ function toggleRTL() { } } -void initMap(); +void init(); // [END maps_control_positioning_labels] diff --git a/dist/samples/control-positioning-labels/docs/index.ts b/dist/samples/control-positioning-labels/docs/index.ts index 2de6f36e8..5429eccaa 100644 --- a/dist/samples/control-positioning-labels/docs/index.ts +++ b/dist/samples/control-positioning-labels/docs/index.ts @@ -33,11 +33,11 @@ function MakeControl(controlDiv: HTMLElement, label: string) { controlUI.appendChild(controlText); } -async function initMap() { +async function init() { // Request the needed libraries. - const [, { ControlPosition }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ ControlPosition }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map')!; @@ -81,5 +81,5 @@ function toggleRTL() { } } -void initMap(); +void init(); // [END maps_control_positioning_labels] diff --git a/dist/samples/control-positioning-labels/jsfiddle/demo.js b/dist/samples/control-positioning-labels/jsfiddle/demo.js index 3bb343071..173d90afe 100644 --- a/dist/samples/control-positioning-labels/jsfiddle/demo.js +++ b/dist/samples/control-positioning-labels/jsfiddle/demo.js @@ -34,11 +34,11 @@ function MakeControl(controlDiv, label) { controlUI.appendChild(controlText); } -async function initMap() { +async function init() { // Request the needed libraries. - const [, { ControlPosition }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ ControlPosition }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map'); @@ -82,4 +82,4 @@ function toggleRTL() { } } -void initMap(); +void init(); diff --git a/dist/samples/control-positioning/app/index.ts b/dist/samples/control-positioning/app/index.ts index 6796ad91b..851f88299 100755 --- a/dist/samples/control-positioning/app/index.ts +++ b/dist/samples/control-positioning/app/index.ts @@ -6,9 +6,9 @@ // [START maps_control_positioning] const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; -async function initMap() { +async function init() { // Request needed libraries. const [{ MapTypeControlStyle }, { ControlPosition }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -38,5 +38,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_control_positioning] diff --git a/dist/samples/control-positioning/docs/index.js b/dist/samples/control-positioning/docs/index.js index 1d1c0796f..0b41cd2ac 100644 --- a/dist/samples/control-positioning/docs/index.js +++ b/dist/samples/control-positioning/docs/index.js @@ -9,7 +9,7 @@ const mapElement = document.querySelector('gmp-map'); let innerMap; -async function initMap() { +async function init() { // Request needed libraries. const [{ MapTypeControlStyle }, { ControlPosition }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -39,5 +39,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_control_positioning] diff --git a/dist/samples/control-positioning/docs/index.ts b/dist/samples/control-positioning/docs/index.ts index 6796ad91b..851f88299 100755 --- a/dist/samples/control-positioning/docs/index.ts +++ b/dist/samples/control-positioning/docs/index.ts @@ -6,9 +6,9 @@ // [START maps_control_positioning] const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; -async function initMap() { +async function init() { // Request needed libraries. const [{ MapTypeControlStyle }, { ControlPosition }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -38,5 +38,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_control_positioning] diff --git a/dist/samples/control-positioning/jsfiddle/demo.js b/dist/samples/control-positioning/jsfiddle/demo.js index d341eb27f..05fca5635 100644 --- a/dist/samples/control-positioning/jsfiddle/demo.js +++ b/dist/samples/control-positioning/jsfiddle/demo.js @@ -8,7 +8,7 @@ const mapElement = document.querySelector('gmp-map'); let innerMap; -async function initMap() { +async function init() { // Request needed libraries. const [{ MapTypeControlStyle }, { ControlPosition }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -38,4 +38,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/control-replacement/app/index.ts b/dist/samples/control-replacement/app/index.ts index f6bff76c2..95f0acd49 100644 --- a/dist/samples/control-replacement/app/index.ts +++ b/dist/samples/control-replacement/app/index.ts @@ -8,7 +8,7 @@ const mapElement = document.querySelector('gmp-map')!; let innerMap: google.maps.Map; -async function initMap() { +async function init() { // Load the needed libraries. await google.maps.importLibrary('maps'); @@ -37,7 +37,7 @@ function initZoomControl(map: google.maps.Map) { }); } -function initMapTypeControl(innerMap: google.maps.Map) { +function initMapTypeControl(map: google.maps.Map) { const mapTypeControlDiv = document.querySelector('.maptype-control')!; const btnMap = document.querySelector('.maptype-control-map')!; const btnSatellite = document.querySelector('.maptype-control-satellite')!; @@ -45,13 +45,13 @@ function initMapTypeControl(innerMap: google.maps.Map) { btnMap.addEventListener('click', () => { mapTypeControlDiv.classList.add('maptype-control-is-map'); mapTypeControlDiv.classList.remove('maptype-control-is-satellite'); - innerMap.setMapTypeId('roadmap'); + map.setMapTypeId('roadmap'); }); btnSatellite.addEventListener('click', () => { mapTypeControlDiv.classList.add('maptype-control-is-satellite'); mapTypeControlDiv.classList.remove('maptype-control-is-map'); - innerMap.setMapTypeId('hybrid'); + map.setMapTypeId('hybrid'); }); } @@ -82,5 +82,5 @@ function toggleFullScreen(element: google.maps.MapElement) { } } -void initMap(); +void init(); // [END maps_control_replacement] diff --git a/dist/samples/control-replacement/docs/index.js b/dist/samples/control-replacement/docs/index.js index 21139c098..5eb108d48 100644 --- a/dist/samples/control-replacement/docs/index.js +++ b/dist/samples/control-replacement/docs/index.js @@ -9,7 +9,7 @@ const mapElement = document.querySelector('gmp-map'); let innerMap; -async function initMap() { +async function init() { // Load the needed libraries. await google.maps.importLibrary('maps'); @@ -38,7 +38,7 @@ function initZoomControl(map) { }); } -function initMapTypeControl(innerMap) { +function initMapTypeControl(map) { const mapTypeControlDiv = document.querySelector('.maptype-control'); const btnMap = document.querySelector('.maptype-control-map'); const btnSatellite = document.querySelector('.maptype-control-satellite'); @@ -46,13 +46,13 @@ function initMapTypeControl(innerMap) { btnMap.addEventListener('click', () => { mapTypeControlDiv.classList.add('maptype-control-is-map'); mapTypeControlDiv.classList.remove('maptype-control-is-satellite'); - innerMap.setMapTypeId('roadmap'); + map.setMapTypeId('roadmap'); }); btnSatellite.addEventListener('click', () => { mapTypeControlDiv.classList.add('maptype-control-is-satellite'); mapTypeControlDiv.classList.remove('maptype-control-is-map'); - innerMap.setMapTypeId('hybrid'); + map.setMapTypeId('hybrid'); }); } @@ -83,5 +83,5 @@ function toggleFullScreen(element) { } } -void initMap(); +void init(); // [END maps_control_replacement] diff --git a/dist/samples/control-replacement/docs/index.ts b/dist/samples/control-replacement/docs/index.ts index f6bff76c2..95f0acd49 100644 --- a/dist/samples/control-replacement/docs/index.ts +++ b/dist/samples/control-replacement/docs/index.ts @@ -8,7 +8,7 @@ const mapElement = document.querySelector('gmp-map')!; let innerMap: google.maps.Map; -async function initMap() { +async function init() { // Load the needed libraries. await google.maps.importLibrary('maps'); @@ -37,7 +37,7 @@ function initZoomControl(map: google.maps.Map) { }); } -function initMapTypeControl(innerMap: google.maps.Map) { +function initMapTypeControl(map: google.maps.Map) { const mapTypeControlDiv = document.querySelector('.maptype-control')!; const btnMap = document.querySelector('.maptype-control-map')!; const btnSatellite = document.querySelector('.maptype-control-satellite')!; @@ -45,13 +45,13 @@ function initMapTypeControl(innerMap: google.maps.Map) { btnMap.addEventListener('click', () => { mapTypeControlDiv.classList.add('maptype-control-is-map'); mapTypeControlDiv.classList.remove('maptype-control-is-satellite'); - innerMap.setMapTypeId('roadmap'); + map.setMapTypeId('roadmap'); }); btnSatellite.addEventListener('click', () => { mapTypeControlDiv.classList.add('maptype-control-is-satellite'); mapTypeControlDiv.classList.remove('maptype-control-is-map'); - innerMap.setMapTypeId('hybrid'); + map.setMapTypeId('hybrid'); }); } @@ -82,5 +82,5 @@ function toggleFullScreen(element: google.maps.MapElement) { } } -void initMap(); +void init(); // [END maps_control_replacement] diff --git a/dist/samples/control-replacement/jsfiddle/demo.js b/dist/samples/control-replacement/jsfiddle/demo.js index 4a4b8832d..2a9b09879 100644 --- a/dist/samples/control-replacement/jsfiddle/demo.js +++ b/dist/samples/control-replacement/jsfiddle/demo.js @@ -8,7 +8,7 @@ const mapElement = document.querySelector('gmp-map'); let innerMap; -async function initMap() { +async function init() { // Load the needed libraries. await google.maps.importLibrary('maps'); @@ -37,7 +37,7 @@ function initZoomControl(map) { }); } -function initMapTypeControl(innerMap) { +function initMapTypeControl(map) { const mapTypeControlDiv = document.querySelector('.maptype-control'); const btnMap = document.querySelector('.maptype-control-map'); const btnSatellite = document.querySelector('.maptype-control-satellite'); @@ -45,13 +45,13 @@ function initMapTypeControl(innerMap) { btnMap.addEventListener('click', () => { mapTypeControlDiv.classList.add('maptype-control-is-map'); mapTypeControlDiv.classList.remove('maptype-control-is-satellite'); - innerMap.setMapTypeId('roadmap'); + map.setMapTypeId('roadmap'); }); btnSatellite.addEventListener('click', () => { mapTypeControlDiv.classList.add('maptype-control-is-satellite'); mapTypeControlDiv.classList.remove('maptype-control-is-map'); - innerMap.setMapTypeId('hybrid'); + map.setMapTypeId('hybrid'); }); } @@ -82,4 +82,4 @@ function toggleFullScreen(element) { } } -void initMap(); +void init(); diff --git a/dist/samples/control-simple/app/index.ts b/dist/samples/control-simple/app/index.ts index 194f4c804..977b1753a 100644 --- a/dist/samples/control-simple/app/index.ts +++ b/dist/samples/control-simple/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_control_simple] -async function initMap() { +async function init() { // Request the needed libraries. await google.maps.importLibrary('maps'); @@ -20,5 +20,5 @@ async function initMap() { }); // [END maps_control_simple_options] } -void initMap(); +void init(); // [END maps_control_simple] diff --git a/dist/samples/control-simple/docs/index.js b/dist/samples/control-simple/docs/index.js index 687904b5e..843b85201 100644 --- a/dist/samples/control-simple/docs/index.js +++ b/dist/samples/control-simple/docs/index.js @@ -6,7 +6,7 @@ */ // [START maps_control_simple] -async function initMap() { +async function init() { // Request the needed libraries. await google.maps.importLibrary('maps'); @@ -21,5 +21,5 @@ async function initMap() { }); // [END maps_control_simple_options] } -void initMap(); +void init(); // [END maps_control_simple] diff --git a/dist/samples/control-simple/docs/index.ts b/dist/samples/control-simple/docs/index.ts index 194f4c804..977b1753a 100644 --- a/dist/samples/control-simple/docs/index.ts +++ b/dist/samples/control-simple/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_control_simple] -async function initMap() { +async function init() { // Request the needed libraries. await google.maps.importLibrary('maps'); @@ -20,5 +20,5 @@ async function initMap() { }); // [END maps_control_simple_options] } -void initMap(); +void init(); // [END maps_control_simple] diff --git a/dist/samples/control-simple/jsfiddle/demo.js b/dist/samples/control-simple/jsfiddle/demo.js index 44d0f225b..e13020402 100644 --- a/dist/samples/control-simple/jsfiddle/demo.js +++ b/dist/samples/control-simple/jsfiddle/demo.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { // Request the needed libraries. await google.maps.importLibrary('maps'); @@ -18,4 +18,4 @@ async function initMap() { scaleControl: true, }); } -void initMap(); +void init(); diff --git a/dist/samples/dds-datasets-point/app/index.ts b/dist/samples/dds-datasets-point/app/index.ts index 1e944c095..ce4dbe397 100644 --- a/dist/samples/dds-datasets-point/app/index.ts +++ b/dist/samples/dds-datasets-point/app/index.ts @@ -6,7 +6,7 @@ // [START maps_dds_datasets_point] const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; // [START maps_dds_datasets_point_style_function] function setStyle(params) { // [START maps_dds_datasets_point_style_get_features] @@ -84,11 +84,11 @@ function setStyle(params) { } // [END maps_dds_datasets_point_style_function] -async function initMap() { +async function init() { // Request needed libraries. - const [, { event }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ event }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); // Get the inner map. @@ -146,5 +146,5 @@ function makeLegend() { } } -void initMap(); +void init(); // [END maps_dds_datasets_point] diff --git a/dist/samples/dds-datasets-point/dist/assets/index-BiIKdmZq.js b/dist/samples/dds-datasets-point/dist/assets/index-BcBGGFO7.js similarity index 58% rename from dist/samples/dds-datasets-point/dist/assets/index-BiIKdmZq.js rename to dist/samples/dds-datasets-point/dist/assets/index-BcBGGFO7.js index eb4a99c1a..1b592f257 100644 --- a/dist/samples/dds-datasets-point/dist/assets/index-BiIKdmZq.js +++ b/dist/samples/dds-datasets-point/dist/assets/index-BcBGGFO7.js @@ -1 +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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=document.querySelector(`gmp-map`),t;function n(e){switch(e.feature.datasetAttributes.CombinationofPrimaryandHighlightColor){case`Black+`:return{fillColor:`black`,pointRadius:8};case`Cinnamon+`:return{fillColor:`#8b0000`,pointRadius:8};case`Cinnamon+Gray`:return{fillColor:`#8b0000`,strokeColor:`gray`,pointRadius:6};case`Cinnamon+White`:return{fillColor:`#8b0000`,strokeColor:`white`,pointRadius:6};case`Gray+`:return{fillColor:`gray`,pointRadius:8};case`Gray+Cinnamon`:return{fillColor:`gray`,strokeColor:`#8b0000`,pointRadius:6};case`Gray+Cinnamon, White`:return{fillColor:`silver`,strokeColor:`#8b0000`,pointRadius:6};case`Gray+White`:return{fillColor:`gray`,strokeColor:`white`,pointRadius:6};default:return{fillColor:`yellow`,pointRadius:8}}}async function r(){let[,{event:r}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`core`)]);t=e.innerMap,r.addListenerOnce(t,`idle`,()=>{i()});let a=t.getDatasetFeatureLayer(`a99635b0-5e73-4b2a-8ae3-cb40f4b7f47e`);a.style=n}function i(){let e={black:[`black`],cinnamon:[`#8b0000`],"cinnamon + gray":[`#8b0000`,`gray`],"cinnamon + white":[`#8b0000`,`white`],gray:[`gray`],"gray + cinnamon":[`gray`,`#8b0000`],"gray + cinnamon + white":[`silver`,`#8b0000`],"gray + white":[`gray`,`white`],"no color data":[`yellow`]},t=document.getElementById(`legend`);t.id=`legend`;let n=document.createElement(`div`);n.innerText=`Fur Colors`,n.classList.add(`title`),t.appendChild(n);let r;for(r in e){let n=document.createElement(`div`);n.id=`container`;let i=document.createElement(`div`);i.style.backgroundColor=e[r][0],e[r][1]?i.style.borderColor=e[r][1]:i.style.borderColor=e[r][0],i.classList.add(`box`);let a=document.createElement(`div`);a.classList.add(`legend`),a.innerText=r,n.appendChild(i),n.appendChild(a),t.appendChild(n)}}r(); \ No newline at end of file +(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=document.querySelector(`gmp-map`),t;function n(e){switch(e.feature.datasetAttributes.CombinationofPrimaryandHighlightColor){case`Black+`:return{fillColor:`black`,pointRadius:8};case`Cinnamon+`:return{fillColor:`#8b0000`,pointRadius:8};case`Cinnamon+Gray`:return{fillColor:`#8b0000`,strokeColor:`gray`,pointRadius:6};case`Cinnamon+White`:return{fillColor:`#8b0000`,strokeColor:`white`,pointRadius:6};case`Gray+`:return{fillColor:`gray`,pointRadius:8};case`Gray+Cinnamon`:return{fillColor:`gray`,strokeColor:`#8b0000`,pointRadius:6};case`Gray+Cinnamon, White`:return{fillColor:`silver`,strokeColor:`#8b0000`,pointRadius:6};case`Gray+White`:return{fillColor:`gray`,strokeColor:`white`,pointRadius:6};default:return{fillColor:`yellow`,pointRadius:8}}}async function r(){let[{event:r}]=await Promise.all([google.maps.importLibrary(`core`),google.maps.importLibrary(`maps`)]);t=e.innerMap,r.addListenerOnce(t,`idle`,()=>{i()});let a=t.getDatasetFeatureLayer(`a99635b0-5e73-4b2a-8ae3-cb40f4b7f47e`);a.style=n}function i(){let e={black:[`black`],cinnamon:[`#8b0000`],"cinnamon + gray":[`#8b0000`,`gray`],"cinnamon + white":[`#8b0000`,`white`],gray:[`gray`],"gray + cinnamon":[`gray`,`#8b0000`],"gray + cinnamon + white":[`silver`,`#8b0000`],"gray + white":[`gray`,`white`],"no color data":[`yellow`]},t=document.getElementById(`legend`);t.id=`legend`;let n=document.createElement(`div`);n.innerText=`Fur Colors`,n.classList.add(`title`),t.appendChild(n);let r;for(r in e){let n=document.createElement(`div`);n.id=`container`;let i=document.createElement(`div`);i.style.backgroundColor=e[r][0],e[r][1]?i.style.borderColor=e[r][1]:i.style.borderColor=e[r][0],i.classList.add(`box`);let a=document.createElement(`div`);a.classList.add(`legend`),a.innerText=r,n.appendChild(i),n.appendChild(a),t.appendChild(n)}}r(); \ No newline at end of file diff --git a/dist/samples/dds-datasets-point/dist/index.html b/dist/samples/dds-datasets-point/dist/index.html index 6fb992028..c6eda1ee9 100644 --- a/dist/samples/dds-datasets-point/dist/index.html +++ b/dist/samples/dds-datasets-point/dist/index.html @@ -15,7 +15,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/dds-datasets-point/docs/index.js b/dist/samples/dds-datasets-point/docs/index.js index 7d4fed39e..64bf5d26d 100644 --- a/dist/samples/dds-datasets-point/docs/index.js +++ b/dist/samples/dds-datasets-point/docs/index.js @@ -85,11 +85,11 @@ function setStyle(params) { } // [END maps_dds_datasets_point_style_function] -async function initMap() { +async function init() { // Request needed libraries. - const [, { event }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ event }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); // Get the inner map. @@ -147,5 +147,5 @@ function makeLegend() { } } -void initMap(); +void init(); // [END maps_dds_datasets_point] diff --git a/dist/samples/dds-datasets-point/docs/index.ts b/dist/samples/dds-datasets-point/docs/index.ts index 1e944c095..ce4dbe397 100644 --- a/dist/samples/dds-datasets-point/docs/index.ts +++ b/dist/samples/dds-datasets-point/docs/index.ts @@ -6,7 +6,7 @@ // [START maps_dds_datasets_point] const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; // [START maps_dds_datasets_point_style_function] function setStyle(params) { // [START maps_dds_datasets_point_style_get_features] @@ -84,11 +84,11 @@ function setStyle(params) { } // [END maps_dds_datasets_point_style_function] -async function initMap() { +async function init() { // Request needed libraries. - const [, { event }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ event }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); // Get the inner map. @@ -146,5 +146,5 @@ function makeLegend() { } } -void initMap(); +void init(); // [END maps_dds_datasets_point] diff --git a/dist/samples/dds-datasets-point/jsfiddle/demo.js b/dist/samples/dds-datasets-point/jsfiddle/demo.js index 0fb394c96..74853ad3e 100644 --- a/dist/samples/dds-datasets-point/jsfiddle/demo.js +++ b/dist/samples/dds-datasets-point/jsfiddle/demo.js @@ -81,11 +81,11 @@ function setStyle(params) { } } -async function initMap() { +async function init() { // Request needed libraries. - const [, { event }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ event }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); // Get the inner map. @@ -143,4 +143,4 @@ function makeLegend() { } } -void initMap(); +void init(); diff --git a/dist/samples/dds-datasets-polygon-click/app/index.ts b/dist/samples/dds-datasets-polygon-click/app/index.ts index 06cc87a5a..77e7b6a3c 100644 --- a/dist/samples/dds-datasets-polygon-click/app/index.ts +++ b/dist/samples/dds-datasets-polygon-click/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_dds_datasets_polygon_click] const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; let lastInteractedFeatureIds: string[] = []; let lastClickedFeatureIds: string[] = []; let datasetLayer; @@ -31,7 +31,7 @@ function handleMouseMove(e) { } // [END maps_dds_datasets_polygon_click_eventhandler] -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -105,5 +105,5 @@ function applyStyle(params) { } // [END maps_dds_datasets_polygon_click_stylefunction] -void initMap(); +void init(); // [END maps_dds_datasets_polygon_click] diff --git a/dist/samples/dds-datasets-polygon-click/docs/index.js b/dist/samples/dds-datasets-polygon-click/docs/index.js index 321449a06..204561967 100644 --- a/dist/samples/dds-datasets-polygon-click/docs/index.js +++ b/dist/samples/dds-datasets-polygon-click/docs/index.js @@ -32,7 +32,7 @@ function handleMouseMove(e) { } // [END maps_dds_datasets_polygon_click_eventhandler] -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -106,5 +106,5 @@ function applyStyle(params) { } // [END maps_dds_datasets_polygon_click_stylefunction] -void initMap(); +void init(); // [END maps_dds_datasets_polygon_click] diff --git a/dist/samples/dds-datasets-polygon-click/docs/index.ts b/dist/samples/dds-datasets-polygon-click/docs/index.ts index 06cc87a5a..77e7b6a3c 100644 --- a/dist/samples/dds-datasets-polygon-click/docs/index.ts +++ b/dist/samples/dds-datasets-polygon-click/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_dds_datasets_polygon_click] const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; let lastInteractedFeatureIds: string[] = []; let lastClickedFeatureIds: string[] = []; let datasetLayer; @@ -31,7 +31,7 @@ function handleMouseMove(e) { } // [END maps_dds_datasets_polygon_click_eventhandler] -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -105,5 +105,5 @@ function applyStyle(params) { } // [END maps_dds_datasets_polygon_click_stylefunction] -void initMap(); +void init(); // [END maps_dds_datasets_polygon_click] diff --git a/dist/samples/dds-datasets-polygon-click/jsfiddle/demo.js b/dist/samples/dds-datasets-polygon-click/jsfiddle/demo.js index e012991bd..b1a371848 100644 --- a/dist/samples/dds-datasets-polygon-click/jsfiddle/demo.js +++ b/dist/samples/dds-datasets-polygon-click/jsfiddle/demo.js @@ -30,7 +30,7 @@ function handleMouseMove(e) { datasetLayer.style = applyStyle; } -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -100,4 +100,4 @@ function applyStyle(params) { return styleDefault; } -void initMap(); +void init(); diff --git a/dist/samples/dds-datasets-polygon-colors/app/index.ts b/dist/samples/dds-datasets-polygon-colors/app/index.ts index 6453f787d..698f827fb 100644 --- a/dist/samples/dds-datasets-polygon-colors/app/index.ts +++ b/dist/samples/dds-datasets-polygon-colors/app/index.ts @@ -6,7 +6,7 @@ // [START maps_dds_datasets_polygon_colors] const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; // [START maps_dds_datasets_polygon_colors_style_function] function setStyle(params) { const datasetFeature = params.feature; @@ -45,7 +45,7 @@ function setStyle(params) { } // [END maps_dds_datasets_polygon_colors_style_function] -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -58,5 +58,5 @@ async function initMap() { datasetLayer.style = setStyle; } -void initMap(); +void init(); // [END maps_dds_datasets_polygon_colors] diff --git a/dist/samples/dds-datasets-polygon-colors/docs/index.js b/dist/samples/dds-datasets-polygon-colors/docs/index.js index 37d8daa2f..27ad88f65 100644 --- a/dist/samples/dds-datasets-polygon-colors/docs/index.js +++ b/dist/samples/dds-datasets-polygon-colors/docs/index.js @@ -46,7 +46,7 @@ function setStyle(params) { } // [END maps_dds_datasets_polygon_colors_style_function] -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -59,5 +59,5 @@ async function initMap() { datasetLayer.style = setStyle; } -void initMap(); +void init(); // [END maps_dds_datasets_polygon_colors] diff --git a/dist/samples/dds-datasets-polygon-colors/docs/index.ts b/dist/samples/dds-datasets-polygon-colors/docs/index.ts index 6453f787d..698f827fb 100644 --- a/dist/samples/dds-datasets-polygon-colors/docs/index.ts +++ b/dist/samples/dds-datasets-polygon-colors/docs/index.ts @@ -6,7 +6,7 @@ // [START maps_dds_datasets_polygon_colors] const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; // [START maps_dds_datasets_polygon_colors_style_function] function setStyle(params) { const datasetFeature = params.feature; @@ -45,7 +45,7 @@ function setStyle(params) { } // [END maps_dds_datasets_polygon_colors_style_function] -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -58,5 +58,5 @@ async function initMap() { datasetLayer.style = setStyle; } -void initMap(); +void init(); // [END maps_dds_datasets_polygon_colors] diff --git a/dist/samples/dds-datasets-polygon-colors/jsfiddle/demo.js b/dist/samples/dds-datasets-polygon-colors/jsfiddle/demo.js index 67f5680f4..648900b27 100644 --- a/dist/samples/dds-datasets-polygon-colors/jsfiddle/demo.js +++ b/dist/samples/dds-datasets-polygon-colors/jsfiddle/demo.js @@ -44,7 +44,7 @@ function setStyle(params) { } } -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -57,4 +57,4 @@ async function initMap() { datasetLayer.style = setStyle; } -void initMap(); +void init(); diff --git a/dist/samples/dds-datasets-polygon/app/index.ts b/dist/samples/dds-datasets-polygon/app/index.ts index 4549a40e6..18e6ba7d4 100644 --- a/dist/samples/dds-datasets-polygon/app/index.ts +++ b/dist/samples/dds-datasets-polygon/app/index.ts @@ -6,7 +6,7 @@ // [START maps_dds_datasets_polygon] const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; // [START maps_dds_datasets_polygon_featurestyleoptions] const styleOptions = { strokeColor: 'green', @@ -17,7 +17,7 @@ const styleOptions = { }; // [END maps_dds_datasets_polygon_featurestyleoptions] -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -33,5 +33,5 @@ async function initMap() { // [END maps_dds_datasets_polygon_featurelayer] } -void initMap(); +void init(); // [END maps_dds_datasets_polygon] diff --git a/dist/samples/dds-datasets-polygon/docs/index.js b/dist/samples/dds-datasets-polygon/docs/index.js index 56e3082d8..a776ede1f 100644 --- a/dist/samples/dds-datasets-polygon/docs/index.js +++ b/dist/samples/dds-datasets-polygon/docs/index.js @@ -18,7 +18,7 @@ const styleOptions = { }; // [END maps_dds_datasets_polygon_featurestyleoptions] -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -34,5 +34,5 @@ async function initMap() { // [END maps_dds_datasets_polygon_featurelayer] } -void initMap(); +void init(); // [END maps_dds_datasets_polygon] diff --git a/dist/samples/dds-datasets-polygon/docs/index.ts b/dist/samples/dds-datasets-polygon/docs/index.ts index 4549a40e6..18e6ba7d4 100644 --- a/dist/samples/dds-datasets-polygon/docs/index.ts +++ b/dist/samples/dds-datasets-polygon/docs/index.ts @@ -6,7 +6,7 @@ // [START maps_dds_datasets_polygon] const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; // [START maps_dds_datasets_polygon_featurestyleoptions] const styleOptions = { strokeColor: 'green', @@ -17,7 +17,7 @@ const styleOptions = { }; // [END maps_dds_datasets_polygon_featurestyleoptions] -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -33,5 +33,5 @@ async function initMap() { // [END maps_dds_datasets_polygon_featurelayer] } -void initMap(); +void init(); // [END maps_dds_datasets_polygon] diff --git a/dist/samples/dds-datasets-polygon/jsfiddle/demo.js b/dist/samples/dds-datasets-polygon/jsfiddle/demo.js index 2b0750185..c7b915c65 100644 --- a/dist/samples/dds-datasets-polygon/jsfiddle/demo.js +++ b/dist/samples/dds-datasets-polygon/jsfiddle/demo.js @@ -16,7 +16,7 @@ const styleOptions = { fillOpacity: 0.3, }; -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -30,4 +30,4 @@ async function initMap() { datasetLayer.style = styleOptions; } -void initMap(); +void init(); diff --git a/dist/samples/dds-datasets-polyline/app/index.ts b/dist/samples/dds-datasets-polyline/app/index.ts index 1f1f7b436..5d8c4e315 100644 --- a/dist/samples/dds-datasets-polyline/app/index.ts +++ b/dist/samples/dds-datasets-polyline/app/index.ts @@ -6,8 +6,8 @@ // [START maps_dds_datasets_polyline] const mapElement = document.querySelector('gmp-map')!; -let innerMap; -async function initMap() { +let innerMap: google.maps.Map; +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -24,5 +24,5 @@ async function initMap() { // [END maps_dds_datasets_polyline_style_function] } -void initMap(); +void init(); // [END maps_dds_datasets_polyline] diff --git a/dist/samples/dds-datasets-polyline/docs/index.js b/dist/samples/dds-datasets-polyline/docs/index.js index 531348ec8..0ccdc238e 100644 --- a/dist/samples/dds-datasets-polyline/docs/index.js +++ b/dist/samples/dds-datasets-polyline/docs/index.js @@ -8,7 +8,7 @@ // [START maps_dds_datasets_polyline] const mapElement = document.querySelector('gmp-map'); let innerMap; -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -25,5 +25,5 @@ async function initMap() { // [END maps_dds_datasets_polyline_style_function] } -void initMap(); +void init(); // [END maps_dds_datasets_polyline] diff --git a/dist/samples/dds-datasets-polyline/docs/index.ts b/dist/samples/dds-datasets-polyline/docs/index.ts index 1f1f7b436..5d8c4e315 100644 --- a/dist/samples/dds-datasets-polyline/docs/index.ts +++ b/dist/samples/dds-datasets-polyline/docs/index.ts @@ -6,8 +6,8 @@ // [START maps_dds_datasets_polyline] const mapElement = document.querySelector('gmp-map')!; -let innerMap; -async function initMap() { +let innerMap: google.maps.Map; +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -24,5 +24,5 @@ async function initMap() { // [END maps_dds_datasets_polyline_style_function] } -void initMap(); +void init(); // [END maps_dds_datasets_polyline] diff --git a/dist/samples/dds-datasets-polyline/jsfiddle/demo.js b/dist/samples/dds-datasets-polyline/jsfiddle/demo.js index 341b4431a..fdf465657 100644 --- a/dist/samples/dds-datasets-polyline/jsfiddle/demo.js +++ b/dist/samples/dds-datasets-polyline/jsfiddle/demo.js @@ -7,7 +7,7 @@ const mapElement = document.querySelector('gmp-map'); let innerMap; -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -22,4 +22,4 @@ async function initMap() { datasetLayer.style = { strokeColor: 'green', strokeWeight: 4 }; } -void initMap(); +void init(); diff --git a/dist/samples/dds-region-viewer/app/index.ts b/dist/samples/dds-region-viewer/app/index.ts index 013a69d28..121bbd333 100644 --- a/dist/samples/dds-region-viewer/app/index.ts +++ b/dist/samples/dds-region-viewer/app/index.ts @@ -13,7 +13,7 @@ // [START maps_dds_region_viewer] const mapElement = document.querySelector('gmp-map')!; let placeAutocomplete; -let innerMap; +let innerMap: google.maps.Map; let countryMenu: HTMLSelectElement; let featureMenu: HTMLSelectElement; let searchInputOption: HTMLInputElement; @@ -33,7 +33,7 @@ let selectedPlaceId: string; import * as countries from './src/countries.json'; -async function initMap() { +async function init() { await Promise.all([ google.maps.importLibrary('maps'), google.maps.importLibrary('places'), @@ -270,6 +270,7 @@ function applyStyle(placeid?) { // Populate the countries menu. function buildMenu() { + // eslint-disable-next-line @typescript-eslint/no-explicit-any for (const item of (countries as any).default) { const countryOption = document.createElement('option'); countryOption.textContent = item.name; @@ -310,6 +311,7 @@ function updateFeatureMenuAvailability(countryCode: string) { // Return a map of feature availability for a country. function getFeatureAvailability(countryName) { // Return the data for the selected country. + // eslint-disable-next-line @typescript-eslint/no-explicit-any const selectedCountry = (countries as any).default.find((country) => { return country.code === countryName; }); @@ -400,7 +402,7 @@ async function showSelectedPolygon(placeid, mode) { featureMenu.value ); } - const viewport = place.viewport; + const viewport = place.viewport!; innerMap.fitBounds(viewport, 155); // Build the HTML. @@ -446,5 +448,5 @@ async function showSelectedPolygon(placeid, mode) { applyStyle(placeid); } -void initMap(); +void init(); // [END maps_dds_region_viewer] diff --git a/dist/samples/dds-region-viewer/docs/index.js b/dist/samples/dds-region-viewer/docs/index.js index c32157654..a5573b847 100644 --- a/dist/samples/dds-region-viewer/docs/index.js +++ b/dist/samples/dds-region-viewer/docs/index.js @@ -33,7 +33,7 @@ let selectedPlaceId; import * as countries from './src/countries.json'; -async function initMap() { +async function init() { await Promise.all([ google.maps.importLibrary('maps'), google.maps.importLibrary('places'), @@ -300,6 +300,7 @@ function updateFeatureMenuAvailability(countryCode) { // Return a map of feature availability for a country. function getFeatureAvailability(countryName) { // Return the data for the selected country. + const selectedCountry = countries.default.find((country) => { return country.code === countryName; }); @@ -436,5 +437,5 @@ async function showSelectedPolygon(placeid, mode) { applyStyle(placeid); } -void initMap(); +void init(); // [END maps_dds_region_viewer] diff --git a/dist/samples/dds-region-viewer/docs/index.ts b/dist/samples/dds-region-viewer/docs/index.ts index 013a69d28..121bbd333 100644 --- a/dist/samples/dds-region-viewer/docs/index.ts +++ b/dist/samples/dds-region-viewer/docs/index.ts @@ -13,7 +13,7 @@ // [START maps_dds_region_viewer] const mapElement = document.querySelector('gmp-map')!; let placeAutocomplete; -let innerMap; +let innerMap: google.maps.Map; let countryMenu: HTMLSelectElement; let featureMenu: HTMLSelectElement; let searchInputOption: HTMLInputElement; @@ -33,7 +33,7 @@ let selectedPlaceId: string; import * as countries from './src/countries.json'; -async function initMap() { +async function init() { await Promise.all([ google.maps.importLibrary('maps'), google.maps.importLibrary('places'), @@ -270,6 +270,7 @@ function applyStyle(placeid?) { // Populate the countries menu. function buildMenu() { + // eslint-disable-next-line @typescript-eslint/no-explicit-any for (const item of (countries as any).default) { const countryOption = document.createElement('option'); countryOption.textContent = item.name; @@ -310,6 +311,7 @@ function updateFeatureMenuAvailability(countryCode: string) { // Return a map of feature availability for a country. function getFeatureAvailability(countryName) { // Return the data for the selected country. + // eslint-disable-next-line @typescript-eslint/no-explicit-any const selectedCountry = (countries as any).default.find((country) => { return country.code === countryName; }); @@ -400,7 +402,7 @@ async function showSelectedPolygon(placeid, mode) { featureMenu.value ); } - const viewport = place.viewport; + const viewport = place.viewport!; innerMap.fitBounds(viewport, 155); // Build the HTML. @@ -446,5 +448,5 @@ async function showSelectedPolygon(placeid, mode) { applyStyle(placeid); } -void initMap(); +void init(); // [END maps_dds_region_viewer] diff --git a/dist/samples/dds-region-viewer/jsfiddle/demo.js b/dist/samples/dds-region-viewer/jsfiddle/demo.js index 31d34adf3..28a789474 100644 --- a/dist/samples/dds-region-viewer/jsfiddle/demo.js +++ b/dist/samples/dds-region-viewer/jsfiddle/demo.js @@ -32,7 +32,7 @@ let selectedPlaceId; import * as countries from './src/countries.json'; -async function initMap() { +async function init() { await Promise.all([ google.maps.importLibrary('maps'), google.maps.importLibrary('places'), @@ -299,6 +299,7 @@ function updateFeatureMenuAvailability(countryCode) { // Return a map of feature availability for a country. function getFeatureAvailability(countryName) { // Return the data for the selected country. + const selectedCountry = countries.default.find((country) => { return country.code === countryName; }); @@ -435,4 +436,4 @@ async function showSelectedPolygon(placeid, mode) { applyStyle(placeid); } -void initMap(); +void init(); diff --git a/dist/samples/deckgl-arclayer/app/index.ts b/dist/samples/deckgl-arclayer/app/index.ts index 96a4dc499..38b24307e 100644 --- a/dist/samples/deckgl-arclayer/app/index.ts +++ b/dist/samples/deckgl-arclayer/app/index.ts @@ -12,7 +12,7 @@ import type * as GeoJSON from 'geojson'; type Properties = { scalerank: number }; type Feature = GeoJSON.Feature; -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -33,7 +33,9 @@ async function initMap() { const flightsLayer = new ArcLayer({ id: 'flights', data: dataUrl, + // eslint-disable-next-line @typescript-eslint/no-explicit-any dataTransform: (data: any) => + // eslint-disable-next-line @typescript-eslint/no-explicit-any data.features.filter((f: any) => f.properties.scalerank < 4), getSourcePosition: () => [14.42076, 50.08804], // Prague getTargetPosition: (f: Feature) => @@ -51,5 +53,5 @@ async function initMap() { overlay.setMap(innerMap); } -void initMap(); +void init(); // [END maps_deckgl_arclayer] diff --git a/dist/samples/deckgl-arclayer/docs/index.js b/dist/samples/deckgl-arclayer/docs/index.js index 71cdc5656..811a45a3c 100644 --- a/dist/samples/deckgl-arclayer/docs/index.js +++ b/dist/samples/deckgl-arclayer/docs/index.js @@ -8,7 +8,7 @@ import { GoogleMapsOverlay } from '@deck.gl/google-maps'; import { ArcLayer } from '@deck.gl/layers'; -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -29,6 +29,7 @@ async function initMap() { const flightsLayer = new ArcLayer({ id: 'flights', data: dataUrl, + dataTransform: (data) => data.features.filter((f) => f.properties.scalerank < 4), getSourcePosition: () => [14.42076, 50.08804], // Prague @@ -46,5 +47,5 @@ async function initMap() { overlay.setMap(innerMap); } -void initMap(); +void init(); // [END maps_deckgl_arclayer] diff --git a/dist/samples/deckgl-arclayer/docs/index.ts b/dist/samples/deckgl-arclayer/docs/index.ts index 96a4dc499..38b24307e 100644 --- a/dist/samples/deckgl-arclayer/docs/index.ts +++ b/dist/samples/deckgl-arclayer/docs/index.ts @@ -12,7 +12,7 @@ import type * as GeoJSON from 'geojson'; type Properties = { scalerank: number }; type Feature = GeoJSON.Feature; -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -33,7 +33,9 @@ async function initMap() { const flightsLayer = new ArcLayer({ id: 'flights', data: dataUrl, + // eslint-disable-next-line @typescript-eslint/no-explicit-any dataTransform: (data: any) => + // eslint-disable-next-line @typescript-eslint/no-explicit-any data.features.filter((f: any) => f.properties.scalerank < 4), getSourcePosition: () => [14.42076, 50.08804], // Prague getTargetPosition: (f: Feature) => @@ -51,5 +53,5 @@ async function initMap() { overlay.setMap(innerMap); } -void initMap(); +void init(); // [END maps_deckgl_arclayer] diff --git a/dist/samples/deckgl-arclayer/jsfiddle/demo.js b/dist/samples/deckgl-arclayer/jsfiddle/demo.js index b1da03e77..88a4ecc88 100644 --- a/dist/samples/deckgl-arclayer/jsfiddle/demo.js +++ b/dist/samples/deckgl-arclayer/jsfiddle/demo.js @@ -7,7 +7,7 @@ import { GoogleMapsOverlay } from '@deck.gl/google-maps'; import { ArcLayer } from '@deck.gl/layers'; -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -28,6 +28,7 @@ async function initMap() { const flightsLayer = new ArcLayer({ id: 'flights', data: dataUrl, + dataTransform: (data) => data.features.filter((f) => f.properties.scalerank < 4), getSourcePosition: () => [14.42076, 50.08804], // Prague @@ -45,4 +46,4 @@ async function initMap() { overlay.setMap(innerMap); } -void initMap(); +void init(); diff --git a/dist/samples/deckgl-heatmap/app/index.ts b/dist/samples/deckgl-heatmap/app/index.ts index d8228f67c..31d967175 100644 --- a/dist/samples/deckgl-heatmap/app/index.ts +++ b/dist/samples/deckgl-heatmap/app/index.ts @@ -4,6 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +/* eslint-disable @typescript-eslint/no-explicit-any */ + /* [START maps_deckgl_heatmap] */ // Initialize and add the map let map: google.maps.Map; @@ -29,7 +31,7 @@ declare namespace deck { // Add other Deck.gl types used globally if needed } -async function initMap(): Promise { +async function init(): Promise { // Progress bar logic moved from index.html let progress; const progressDiv = document.querySelector('.mdc-linear-progress')!; @@ -200,5 +202,5 @@ async function initMap(): Promise { } } -void initMap(); +void init(); /* [END maps_deckgl_heatmap] */ diff --git a/dist/samples/deckgl-heatmap/docs/index.js b/dist/samples/deckgl-heatmap/docs/index.js index d53a65e53..2ec595454 100644 --- a/dist/samples/deckgl-heatmap/docs/index.js +++ b/dist/samples/deckgl-heatmap/docs/index.js @@ -14,14 +14,14 @@ let googleMapsOverlay; let marker; let infoWindow; -async function initMap() { +async function init() { // Progress bar logic moved from index.html let progress; const progressDiv = document.querySelector('.mdc-linear-progress'); if (progressDiv) { // Assuming 'mdc' is globally available, potentially loaded via a script tag // If not, you might need to import it or add type definitions. - // @ts-expect-error: mdc not typed + progress = new mdc.linearProgress.MDCLinearProgress(progressDiv); progress.open(); progress.determinate = false; @@ -185,5 +185,5 @@ async function initMap() { } } -void initMap(); +void init(); /* [END maps_deckgl_heatmap] */ diff --git a/dist/samples/deckgl-heatmap/docs/index.ts b/dist/samples/deckgl-heatmap/docs/index.ts index d8228f67c..31d967175 100644 --- a/dist/samples/deckgl-heatmap/docs/index.ts +++ b/dist/samples/deckgl-heatmap/docs/index.ts @@ -4,6 +4,8 @@ * SPDX-License-Identifier: Apache-2.0 */ +/* eslint-disable @typescript-eslint/no-explicit-any */ + /* [START maps_deckgl_heatmap] */ // Initialize and add the map let map: google.maps.Map; @@ -29,7 +31,7 @@ declare namespace deck { // Add other Deck.gl types used globally if needed } -async function initMap(): Promise { +async function init(): Promise { // Progress bar logic moved from index.html let progress; const progressDiv = document.querySelector('.mdc-linear-progress')!; @@ -200,5 +202,5 @@ async function initMap(): Promise { } } -void initMap(); +void init(); /* [END maps_deckgl_heatmap] */ diff --git a/dist/samples/deckgl-heatmap/jsfiddle/demo.js b/dist/samples/deckgl-heatmap/jsfiddle/demo.js index e29be79b9..fc1a2f09c 100644 --- a/dist/samples/deckgl-heatmap/jsfiddle/demo.js +++ b/dist/samples/deckgl-heatmap/jsfiddle/demo.js @@ -13,14 +13,14 @@ let googleMapsOverlay; let marker; let infoWindow; -async function initMap() { +async function init() { // Progress bar logic moved from index.html let progress; const progressDiv = document.querySelector('.mdc-linear-progress'); if (progressDiv) { // Assuming 'mdc' is globally available, potentially loaded via a script tag // If not, you might need to import it or add type definitions. - // @ts-expect-error: mdc not typed + progress = new mdc.linearProgress.MDCLinearProgress(progressDiv); progress.open(); progress.determinate = false; @@ -184,4 +184,4 @@ async function initMap() { } } -void initMap(); +void init(); diff --git a/dist/samples/deckgl-kml-updated/app/index.ts b/dist/samples/deckgl-kml-updated/app/index.ts index 3fa2db646..cfe49f60a 100644 --- a/dist/samples/deckgl-kml-updated/app/index.ts +++ b/dist/samples/deckgl-kml-updated/app/index.ts @@ -3,6 +3,9 @@ * Copyright 2025 Google LLC. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ + +/* eslint-disable @typescript-eslint/no-explicit-any */ + /* [START maps_deckgl_kml_updated] */ // Import necessary loader import { KMLLoader } from '@loaders.gl/kml'; @@ -46,7 +49,7 @@ let map: google.maps.Map; let geojsonLayer: deck.GeoJsonLayer; let googleMapsOverlay: deck.GoogleMapsOverlay; -async function initMap(): Promise { +async function init(): Promise { // Progress bar logic moved from index.html let progress; const progressDiv = document.querySelector('.mdc-linear-progress')!; @@ -235,5 +238,5 @@ async function initMap(): Promise { } } -void initMap(); +void init(); /* [END maps_deckgl_kml_updated] */ diff --git a/dist/samples/deckgl-kml-updated/docs/index.js b/dist/samples/deckgl-kml-updated/docs/index.js index cf38f19b1..b3b5c2403 100644 --- a/dist/samples/deckgl-kml-updated/docs/index.js +++ b/dist/samples/deckgl-kml-updated/docs/index.js @@ -3,6 +3,7 @@ * Copyright 2025 Google LLC. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ + /* [START maps_deckgl_kml_updated] */ // Import necessary loader import { KMLLoader } from '@loaders.gl/kml'; @@ -12,14 +13,14 @@ let map; let geojsonLayer; let googleMapsOverlay; -async function initMap() { +async function init() { // Progress bar logic moved from index.html let progress; const progressDiv = document.querySelector('.mdc-linear-progress'); if (progressDiv) { // Assuming 'mdc' is globally available, potentially loaded via a script tag // If not, you might need to import it or add type definitions. - // @ts-expect-error: mdc not typed + progress = new mdc.linearProgress.MDCLinearProgress(progressDiv); progress.open(); progress.determinate = false; @@ -201,5 +202,5 @@ async function initMap() { } } -void initMap(); +void init(); /* [END maps_deckgl_kml_updated] */ diff --git a/dist/samples/deckgl-kml-updated/docs/index.ts b/dist/samples/deckgl-kml-updated/docs/index.ts index 3fa2db646..cfe49f60a 100644 --- a/dist/samples/deckgl-kml-updated/docs/index.ts +++ b/dist/samples/deckgl-kml-updated/docs/index.ts @@ -3,6 +3,9 @@ * Copyright 2025 Google LLC. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ + +/* eslint-disable @typescript-eslint/no-explicit-any */ + /* [START maps_deckgl_kml_updated] */ // Import necessary loader import { KMLLoader } from '@loaders.gl/kml'; @@ -46,7 +49,7 @@ let map: google.maps.Map; let geojsonLayer: deck.GeoJsonLayer; let googleMapsOverlay: deck.GoogleMapsOverlay; -async function initMap(): Promise { +async function init(): Promise { // Progress bar logic moved from index.html let progress; const progressDiv = document.querySelector('.mdc-linear-progress')!; @@ -235,5 +238,5 @@ async function initMap(): Promise { } } -void initMap(); +void init(); /* [END maps_deckgl_kml_updated] */ diff --git a/dist/samples/deckgl-kml-updated/jsfiddle/demo.js b/dist/samples/deckgl-kml-updated/jsfiddle/demo.js index 5048879cf..881bd95b0 100644 --- a/dist/samples/deckgl-kml-updated/jsfiddle/demo.js +++ b/dist/samples/deckgl-kml-updated/jsfiddle/demo.js @@ -12,14 +12,14 @@ let map; let geojsonLayer; let googleMapsOverlay; -async function initMap() { +async function init() { // Progress bar logic moved from index.html let progress; const progressDiv = document.querySelector('.mdc-linear-progress'); if (progressDiv) { // Assuming 'mdc' is globally available, potentially loaded via a script tag // If not, you might need to import it or add type definitions. - // @ts-expect-error: mdc not typed + progress = new mdc.linearProgress.MDCLinearProgress(progressDiv); progress.open(); progress.determinate = false; @@ -201,4 +201,4 @@ async function initMap() { } } -void initMap(); +void init(); diff --git a/dist/samples/deckgl-kml/app/index.ts b/dist/samples/deckgl-kml/app/index.ts index 1400cb906..f0c1a7ba2 100644 --- a/dist/samples/deckgl-kml/app/index.ts +++ b/dist/samples/deckgl-kml/app/index.ts @@ -3,6 +3,9 @@ * Copyright 2025 Google LLC. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ + +/* eslint-disable @typescript-eslint/no-explicit-any */ + /* [START maps_deckgl_kml] */ // Import necessary loader import { KMLLoader } from '@loaders.gl/kml'; @@ -45,7 +48,7 @@ let map: google.maps.Map; let geojsonLayer: deck.GeoJsonLayer; let googleMapsOverlay: deck.GoogleMapsOverlay; -async function initMap(): Promise { +async function init(): Promise { // Progress bar logic moved from index.html let progress; const progressDiv = document.querySelector('.mdc-linear-progress')!; @@ -63,7 +66,7 @@ async function initMap(): Promise { } // The location for the map center (adjust as needed for the KML data) - const position = { lat: 41.8692576, lng: -87.689769 }; + const center = { lat: 41.8692576, lng: -87.689769 }; // Request needed libraries. const { Map } = await google.maps.importLibrary('maps'); @@ -77,7 +80,7 @@ async function initMap(): Promise { // The map, centered at the specified position map = new Map(mapDiv, { zoom: 11, // Adjust zoom as needed - center: position, + center, // mapId: '6a17c323f461e521', // Replace with your Map ID mapId: '6a17c323f461e521', zoomControl: true, @@ -221,5 +224,5 @@ function hexOrAabbggrrToRgba(color: string): number[] | null { return null; // Invalid format } -void initMap(); +void init(); /* [END maps_deckgl_kml] */ diff --git a/dist/samples/deckgl-kml/docs/index.js b/dist/samples/deckgl-kml/docs/index.js index d566c7259..f3151e327 100644 --- a/dist/samples/deckgl-kml/docs/index.js +++ b/dist/samples/deckgl-kml/docs/index.js @@ -3,6 +3,7 @@ * Copyright 2025 Google LLC. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ + /* [START maps_deckgl_kml] */ // Import necessary loader import { KMLLoader } from '@loaders.gl/kml'; @@ -12,14 +13,14 @@ let map; let geojsonLayer; let googleMapsOverlay; -async function initMap() { +async function init() { // Progress bar logic moved from index.html let progress; const progressDiv = document.querySelector('.mdc-linear-progress'); if (progressDiv) { // Assuming 'mdc' is globally available, potentially loaded via a script tag // If not, you might need to import it or add type definitions. - // @ts-expect-error: mdc not typed + progress = new mdc.linearProgress.MDCLinearProgress(progressDiv); progress.open(); progress.determinate = false; @@ -30,7 +31,7 @@ async function initMap() { } // The location for the map center (adjust as needed for the KML data) - const position = { lat: 41.8692576, lng: -87.689769 }; + const center = { lat: 41.8692576, lng: -87.689769 }; // Request needed libraries. const { Map } = await google.maps.importLibrary('maps'); @@ -44,7 +45,7 @@ async function initMap() { // The map, centered at the specified position map = new Map(mapDiv, { zoom: 11, // Adjust zoom as needed - center: position, + center, // mapId: '6a17c323f461e521', // Replace with your Map ID mapId: '6a17c323f461e521', zoomControl: true, @@ -188,5 +189,5 @@ function hexOrAabbggrrToRgba(color) { return null; // Invalid format } -void initMap(); +void init(); /* [END maps_deckgl_kml] */ diff --git a/dist/samples/deckgl-kml/docs/index.ts b/dist/samples/deckgl-kml/docs/index.ts index 1400cb906..f0c1a7ba2 100644 --- a/dist/samples/deckgl-kml/docs/index.ts +++ b/dist/samples/deckgl-kml/docs/index.ts @@ -3,6 +3,9 @@ * Copyright 2025 Google LLC. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ + +/* eslint-disable @typescript-eslint/no-explicit-any */ + /* [START maps_deckgl_kml] */ // Import necessary loader import { KMLLoader } from '@loaders.gl/kml'; @@ -45,7 +48,7 @@ let map: google.maps.Map; let geojsonLayer: deck.GeoJsonLayer; let googleMapsOverlay: deck.GoogleMapsOverlay; -async function initMap(): Promise { +async function init(): Promise { // Progress bar logic moved from index.html let progress; const progressDiv = document.querySelector('.mdc-linear-progress')!; @@ -63,7 +66,7 @@ async function initMap(): Promise { } // The location for the map center (adjust as needed for the KML data) - const position = { lat: 41.8692576, lng: -87.689769 }; + const center = { lat: 41.8692576, lng: -87.689769 }; // Request needed libraries. const { Map } = await google.maps.importLibrary('maps'); @@ -77,7 +80,7 @@ async function initMap(): Promise { // The map, centered at the specified position map = new Map(mapDiv, { zoom: 11, // Adjust zoom as needed - center: position, + center, // mapId: '6a17c323f461e521', // Replace with your Map ID mapId: '6a17c323f461e521', zoomControl: true, @@ -221,5 +224,5 @@ function hexOrAabbggrrToRgba(color: string): number[] | null { return null; // Invalid format } -void initMap(); +void init(); /* [END maps_deckgl_kml] */ diff --git a/dist/samples/deckgl-kml/jsfiddle/demo.js b/dist/samples/deckgl-kml/jsfiddle/demo.js index 875314dcd..32ed8a0ac 100644 --- a/dist/samples/deckgl-kml/jsfiddle/demo.js +++ b/dist/samples/deckgl-kml/jsfiddle/demo.js @@ -12,14 +12,14 @@ let map; let geojsonLayer; let googleMapsOverlay; -async function initMap() { +async function init() { // Progress bar logic moved from index.html let progress; const progressDiv = document.querySelector('.mdc-linear-progress'); if (progressDiv) { // Assuming 'mdc' is globally available, potentially loaded via a script tag // If not, you might need to import it or add type definitions. - // @ts-expect-error: mdc not typed + progress = new mdc.linearProgress.MDCLinearProgress(progressDiv); progress.open(); progress.determinate = false; @@ -30,7 +30,7 @@ async function initMap() { } // The location for the map center (adjust as needed for the KML data) - const position = { lat: 41.8692576, lng: -87.689769 }; + const center = { lat: 41.8692576, lng: -87.689769 }; // Request needed libraries. const { Map } = await google.maps.importLibrary('maps'); @@ -44,7 +44,7 @@ async function initMap() { // The map, centered at the specified position map = new Map(mapDiv, { zoom: 11, // Adjust zoom as needed - center: position, + center, // mapId: '6a17c323f461e521', // Replace with your Map ID mapId: '6a17c323f461e521', zoomControl: true, @@ -188,4 +188,4 @@ function hexOrAabbggrrToRgba(color) { return null; // Invalid format } -void initMap(); +void init(); diff --git a/dist/samples/deckgl-points/app/index.ts b/dist/samples/deckgl-points/app/index.ts index 6872cc5fd..fd1759434 100644 --- a/dist/samples/deckgl-points/app/index.ts +++ b/dist/samples/deckgl-points/app/index.ts @@ -27,12 +27,13 @@ function isEarthquake( return ( f.properties !== null && typeof f.properties === 'object' && + // eslint-disable-next-line @typescript-eslint/no-explicit-any typeof (f.properties as any).mag === 'number' ); } // Initialize and add the map -async function initMap() { +async function init() { // Request the needed libraries. await google.maps.importLibrary('maps'); @@ -77,5 +78,5 @@ async function initMap() { deckOverlay.setMap(innerMap); } -void initMap(); +void init(); // [END maps_deckgl_points] diff --git a/dist/samples/deckgl-points/docs/index.js b/dist/samples/deckgl-points/docs/index.js index a070085e1..d293bf323 100644 --- a/dist/samples/deckgl-points/docs/index.js +++ b/dist/samples/deckgl-points/docs/index.js @@ -23,7 +23,7 @@ function isEarthquake(f) { } // Initialize and add the map -async function initMap() { +async function init() { // Request the needed libraries. await google.maps.importLibrary('maps'); @@ -68,5 +68,5 @@ async function initMap() { deckOverlay.setMap(innerMap); } -void initMap(); +void init(); // [END maps_deckgl_points] diff --git a/dist/samples/deckgl-points/docs/index.ts b/dist/samples/deckgl-points/docs/index.ts index 6872cc5fd..fd1759434 100644 --- a/dist/samples/deckgl-points/docs/index.ts +++ b/dist/samples/deckgl-points/docs/index.ts @@ -27,12 +27,13 @@ function isEarthquake( return ( f.properties !== null && typeof f.properties === 'object' && + // eslint-disable-next-line @typescript-eslint/no-explicit-any typeof (f.properties as any).mag === 'number' ); } // Initialize and add the map -async function initMap() { +async function init() { // Request the needed libraries. await google.maps.importLibrary('maps'); @@ -77,5 +78,5 @@ async function initMap() { deckOverlay.setMap(innerMap); } -void initMap(); +void init(); // [END maps_deckgl_points] diff --git a/dist/samples/deckgl-points/jsfiddle/demo.js b/dist/samples/deckgl-points/jsfiddle/demo.js index 355418186..5ad5f4ffc 100644 --- a/dist/samples/deckgl-points/jsfiddle/demo.js +++ b/dist/samples/deckgl-points/jsfiddle/demo.js @@ -23,7 +23,7 @@ function isEarthquake(f) { } // Initialize and add the map -async function initMap() { +async function init() { // Request the needed libraries. await google.maps.importLibrary('maps'); @@ -68,4 +68,4 @@ async function initMap() { deckOverlay.setMap(innerMap); } -void initMap(); +void init(); diff --git a/dist/samples/deckgl-polygon/app/index.ts b/dist/samples/deckgl-polygon/app/index.ts index ef62f311d..f345fd6b5 100644 --- a/dist/samples/deckgl-polygon/app/index.ts +++ b/dist/samples/deckgl-polygon/app/index.ts @@ -3,6 +3,9 @@ * Copyright 2025 Google LLC. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ + +/* eslint-disable @typescript-eslint/no-explicit-any */ + /* [START maps_deckgl_polygon] */ // Initialize and add the map let map: google.maps.Map; @@ -12,25 +15,20 @@ let googleMapsOverlay: deck.GoogleMapsOverlay; // Declare googleMapsOverlay outs // Declare global namespace for Deck.gl to satisfy TypeScript compiler declare namespace deck { class PolygonLayer { - // eslint-disable-next-line @typescript-eslint/no-explicit-any constructor(props: any); - // eslint-disable-next-line @typescript-eslint/no-explicit-any props: any; - // eslint-disable-next-line @typescript-eslint/no-explicit-any clone(props: any): PolygonLayer; pickable: boolean; // Added pickable property } class GoogleMapsOverlay { - // eslint-disable-next-line @typescript-eslint/no-explicit-any constructor(props: any); setMap(map: google.maps.Map | null): void; - // eslint-disable-next-line @typescript-eslint/no-explicit-any setProps(props: any): void; } // Add other Deck.gl types used globally if needed } -async function initMap(): Promise { +async function init(): Promise { // Progress bar logic moved from index.html let progress; const progressDiv = document.querySelector('.mdc-linear-progress')!; @@ -76,11 +74,8 @@ async function initMap(): Promise { id: 'PolygonLayer', data: 'https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/sf-zipcodes.json', - // eslint-disable-next-line @typescript-eslint/no-explicit-any getPolygon: (d: any) => d.contour, // Use 'any' for simplicity - // eslint-disable-next-line @typescript-eslint/no-explicit-any getElevation: (d: any) => d.population / d.area / 10, // Use 'any' for simplicity - // eslint-disable-next-line @typescript-eslint/no-explicit-any getFillColor: (d: any) => [d.population / d.area / 60, 140, 0], // Use 'any' for simplicity getLineColor: [255, 255, 255], getLineWidth: 20, @@ -97,7 +92,6 @@ async function initMap(): Promise { }, 100); // 100ms delay } }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any onHover: ({ object, x, y }: { object: any; x: number; y: number }) => { // Use 'any' for object for simplicity const tooltip = document.getElementById('tooltip'); @@ -159,5 +153,5 @@ async function initMap(): Promise { } } -void initMap(); +void init(); /* [END maps_deckgl_polygon] */ diff --git a/dist/samples/deckgl-polygon/docs/index.js b/dist/samples/deckgl-polygon/docs/index.js index 968c6c86d..75be61fc2 100644 --- a/dist/samples/deckgl-polygon/docs/index.js +++ b/dist/samples/deckgl-polygon/docs/index.js @@ -4,20 +4,21 @@ * Copyright 2025 Google LLC. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ + /* [START maps_deckgl_polygon] */ // Initialize and add the map let map; let polygonLayer; // Declare polygonLayer outside for button access let googleMapsOverlay; // Declare googleMapsOverlay outside for button access -async function initMap() { +async function init() { // Progress bar logic moved from index.html let progress; const progressDiv = document.querySelector('.mdc-linear-progress'); if (progressDiv) { // Assuming 'mdc' is globally available, potentially loaded via a script tag // If not, you might need to import it or add type definitions. - // @ts-expect-error: mdc not typed + progress = new mdc.linearProgress.MDCLinearProgress(progressDiv); progress.open(); progress.determinate = false; @@ -56,11 +57,8 @@ async function initMap() { id: 'PolygonLayer', data: 'https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/sf-zipcodes.json', - // eslint-disable-next-line @typescript-eslint/no-explicit-any getPolygon: (d) => d.contour, // Use 'any' for simplicity - // eslint-disable-next-line @typescript-eslint/no-explicit-any getElevation: (d) => d.population / d.area / 10, // Use 'any' for simplicity - // eslint-disable-next-line @typescript-eslint/no-explicit-any getFillColor: (d) => [d.population / d.area / 60, 140, 0], // Use 'any' for simplicity getLineColor: [255, 255, 255], getLineWidth: 20, @@ -77,7 +75,6 @@ async function initMap() { }, 100); // 100ms delay } }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any onHover: ({ object, x, y }) => { // Use 'any' for object for simplicity const tooltip = document.getElementById('tooltip'); @@ -139,5 +136,5 @@ async function initMap() { } } -void initMap(); +void init(); /* [END maps_deckgl_polygon] */ diff --git a/dist/samples/deckgl-polygon/docs/index.ts b/dist/samples/deckgl-polygon/docs/index.ts index ef62f311d..f345fd6b5 100644 --- a/dist/samples/deckgl-polygon/docs/index.ts +++ b/dist/samples/deckgl-polygon/docs/index.ts @@ -3,6 +3,9 @@ * Copyright 2025 Google LLC. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ + +/* eslint-disable @typescript-eslint/no-explicit-any */ + /* [START maps_deckgl_polygon] */ // Initialize and add the map let map: google.maps.Map; @@ -12,25 +15,20 @@ let googleMapsOverlay: deck.GoogleMapsOverlay; // Declare googleMapsOverlay outs // Declare global namespace for Deck.gl to satisfy TypeScript compiler declare namespace deck { class PolygonLayer { - // eslint-disable-next-line @typescript-eslint/no-explicit-any constructor(props: any); - // eslint-disable-next-line @typescript-eslint/no-explicit-any props: any; - // eslint-disable-next-line @typescript-eslint/no-explicit-any clone(props: any): PolygonLayer; pickable: boolean; // Added pickable property } class GoogleMapsOverlay { - // eslint-disable-next-line @typescript-eslint/no-explicit-any constructor(props: any); setMap(map: google.maps.Map | null): void; - // eslint-disable-next-line @typescript-eslint/no-explicit-any setProps(props: any): void; } // Add other Deck.gl types used globally if needed } -async function initMap(): Promise { +async function init(): Promise { // Progress bar logic moved from index.html let progress; const progressDiv = document.querySelector('.mdc-linear-progress')!; @@ -76,11 +74,8 @@ async function initMap(): Promise { id: 'PolygonLayer', data: 'https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/sf-zipcodes.json', - // eslint-disable-next-line @typescript-eslint/no-explicit-any getPolygon: (d: any) => d.contour, // Use 'any' for simplicity - // eslint-disable-next-line @typescript-eslint/no-explicit-any getElevation: (d: any) => d.population / d.area / 10, // Use 'any' for simplicity - // eslint-disable-next-line @typescript-eslint/no-explicit-any getFillColor: (d: any) => [d.population / d.area / 60, 140, 0], // Use 'any' for simplicity getLineColor: [255, 255, 255], getLineWidth: 20, @@ -97,7 +92,6 @@ async function initMap(): Promise { }, 100); // 100ms delay } }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any onHover: ({ object, x, y }: { object: any; x: number; y: number }) => { // Use 'any' for object for simplicity const tooltip = document.getElementById('tooltip'); @@ -159,5 +153,5 @@ async function initMap(): Promise { } } -void initMap(); +void init(); /* [END maps_deckgl_polygon] */ diff --git a/dist/samples/deckgl-polygon/jsfiddle/demo.js b/dist/samples/deckgl-polygon/jsfiddle/demo.js index d167c3174..43833352c 100644 --- a/dist/samples/deckgl-polygon/jsfiddle/demo.js +++ b/dist/samples/deckgl-polygon/jsfiddle/demo.js @@ -10,14 +10,14 @@ let map; let polygonLayer; // Declare polygonLayer outside for button access let googleMapsOverlay; // Declare googleMapsOverlay outside for button access -async function initMap() { +async function init() { // Progress bar logic moved from index.html let progress; const progressDiv = document.querySelector('.mdc-linear-progress'); if (progressDiv) { // Assuming 'mdc' is globally available, potentially loaded via a script tag // If not, you might need to import it or add type definitions. - // @ts-expect-error: mdc not typed + progress = new mdc.linearProgress.MDCLinearProgress(progressDiv); progress.open(); progress.determinate = false; @@ -56,11 +56,8 @@ async function initMap() { id: 'PolygonLayer', data: 'https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/sf-zipcodes.json', - // eslint-disable-next-line @typescript-eslint/no-explicit-any getPolygon: (d) => d.contour, // Use 'any' for simplicity - // eslint-disable-next-line @typescript-eslint/no-explicit-any getElevation: (d) => d.population / d.area / 10, // Use 'any' for simplicity - // eslint-disable-next-line @typescript-eslint/no-explicit-any getFillColor: (d) => [d.population / d.area / 60, 140, 0], // Use 'any' for simplicity getLineColor: [255, 255, 255], getLineWidth: 20, @@ -77,7 +74,6 @@ async function initMap() { }, 100); // 100ms delay } }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any onHover: ({ object, x, y }) => { // Use 'any' for object for simplicity const tooltip = document.getElementById('tooltip'); @@ -139,4 +135,4 @@ async function initMap() { } } -void initMap(); +void init(); diff --git a/dist/samples/deckgl-tripslayer/app/index.ts b/dist/samples/deckgl-tripslayer/app/index.ts index 7a5647095..eeef08617 100644 --- a/dist/samples/deckgl-tripslayer/app/index.ts +++ b/dist/samples/deckgl-tripslayer/app/index.ts @@ -23,7 +23,7 @@ const VENDOR_COLORS: Color[] = [ [0, 0, 255], // vendor #1 ]; -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -71,5 +71,5 @@ async function initMap() { overlay.setMap(innerMap); } -void initMap(); +void init(); // [END maps_deckgl_tripslayer] diff --git a/dist/samples/deckgl-tripslayer/docs/index.js b/dist/samples/deckgl-tripslayer/docs/index.js index ed9b1b29b..6586507cc 100644 --- a/dist/samples/deckgl-tripslayer/docs/index.js +++ b/dist/samples/deckgl-tripslayer/docs/index.js @@ -16,7 +16,7 @@ const VENDOR_COLORS = [ [0, 0, 255], // vendor #1 ]; -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -64,5 +64,5 @@ async function initMap() { overlay.setMap(innerMap); } -void initMap(); +void init(); // [END maps_deckgl_tripslayer] diff --git a/dist/samples/deckgl-tripslayer/docs/index.ts b/dist/samples/deckgl-tripslayer/docs/index.ts index 7a5647095..eeef08617 100644 --- a/dist/samples/deckgl-tripslayer/docs/index.ts +++ b/dist/samples/deckgl-tripslayer/docs/index.ts @@ -23,7 +23,7 @@ const VENDOR_COLORS: Color[] = [ [0, 0, 255], // vendor #1 ]; -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -71,5 +71,5 @@ async function initMap() { overlay.setMap(innerMap); } -void initMap(); +void init(); // [END maps_deckgl_tripslayer] diff --git a/dist/samples/deckgl-tripslayer/jsfiddle/demo.js b/dist/samples/deckgl-tripslayer/jsfiddle/demo.js index 7c0610af6..c155a54b1 100644 --- a/dist/samples/deckgl-tripslayer/jsfiddle/demo.js +++ b/dist/samples/deckgl-tripslayer/jsfiddle/demo.js @@ -16,7 +16,7 @@ const VENDOR_COLORS = [ [0, 0, 255], // vendor #1 ]; -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -64,4 +64,4 @@ async function initMap() { overlay.setMap(innerMap); } -void initMap(); +void init(); diff --git a/dist/samples/event-arguments/app/index.ts b/dist/samples/event-arguments/app/index.ts index 6d9def40b..f81dd1d6b 100644 --- a/dist/samples/event-arguments/app/index.ts +++ b/dist/samples/event-arguments/app/index.ts @@ -5,11 +5,11 @@ */ // [START maps_event_arguments] -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map')!; @@ -24,5 +24,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_event_arguments] diff --git a/dist/samples/event-arguments/dist/assets/index-DLnAWehh.js b/dist/samples/event-arguments/dist/assets/index-l7pdboKs.js similarity index 72% rename from dist/samples/event-arguments/dist/assets/index-DLnAWehh.js rename to dist/samples/event-arguments/dist/assets/index-l7pdboKs.js index 6aaa1b6a1..5a6deba4f 100644 --- a/dist/samples/event-arguments/dist/assets/index-DLnAWehh.js +++ b/dist/samples/event-arguments/dist/assets/index-l7pdboKs.js @@ -1 +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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`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[,{AdvancedMarkerElement:e}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`marker`)]),t=document.querySelector(`gmp-map`).innerMap;t.addListener(`click`,n=>{new e({position:n.latLng,map:t}),t.panTo(n.latLng)})}e(); \ No newline at end of file +(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`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[{AdvancedMarkerElement:e}]=await Promise.all([google.maps.importLibrary(`marker`),google.maps.importLibrary(`maps`)]),t=document.querySelector(`gmp-map`).innerMap;t.addListener(`click`,n=>{new e({position:n.latLng,map:t}),t.panTo(n.latLng)})}e(); \ No newline at end of file diff --git a/dist/samples/event-arguments/dist/index.html b/dist/samples/event-arguments/dist/index.html index 98fe4d2d2..9e56f9100 100644 --- a/dist/samples/event-arguments/dist/index.html +++ b/dist/samples/event-arguments/dist/index.html @@ -15,7 +15,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/event-arguments/docs/index.js b/dist/samples/event-arguments/docs/index.js index 536a364ef..c1c542160 100644 --- a/dist/samples/event-arguments/docs/index.js +++ b/dist/samples/event-arguments/docs/index.js @@ -6,11 +6,11 @@ */ // [START maps_event_arguments] -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map'); @@ -25,5 +25,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_event_arguments] diff --git a/dist/samples/event-arguments/docs/index.ts b/dist/samples/event-arguments/docs/index.ts index 6d9def40b..f81dd1d6b 100644 --- a/dist/samples/event-arguments/docs/index.ts +++ b/dist/samples/event-arguments/docs/index.ts @@ -5,11 +5,11 @@ */ // [START maps_event_arguments] -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map')!; @@ -24,5 +24,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_event_arguments] diff --git a/dist/samples/event-arguments/jsfiddle/demo.js b/dist/samples/event-arguments/jsfiddle/demo.js index 4446864aa..0f74b5bf7 100644 --- a/dist/samples/event-arguments/jsfiddle/demo.js +++ b/dist/samples/event-arguments/jsfiddle/demo.js @@ -5,11 +5,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map'); @@ -24,4 +24,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/event-click-latlng/app/index.ts b/dist/samples/event-click-latlng/app/index.ts index d314408f8..13a3c14f0 100644 --- a/dist/samples/event-click-latlng/app/index.ts +++ b/dist/samples/event-click-latlng/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_event_click_latlng] -async function initMap() { +async function init() { // Request needed libraries. const { InfoWindow } = await google.maps.importLibrary('maps'); @@ -42,5 +42,5 @@ async function initMap() { // [END maps_event_click_latlng_listener] } -void initMap(); +void init(); // [END maps_event_click_latlng] diff --git a/dist/samples/event-click-latlng/docs/index.js b/dist/samples/event-click-latlng/docs/index.js index 760e8d91e..f1dca86d7 100644 --- a/dist/samples/event-click-latlng/docs/index.js +++ b/dist/samples/event-click-latlng/docs/index.js @@ -6,7 +6,7 @@ */ // [START maps_event_click_latlng] -async function initMap() { +async function init() { // Request needed libraries. const { InfoWindow } = await google.maps.importLibrary('maps'); @@ -43,5 +43,5 @@ async function initMap() { // [END maps_event_click_latlng_listener] } -void initMap(); +void init(); // [END maps_event_click_latlng] diff --git a/dist/samples/event-click-latlng/docs/index.ts b/dist/samples/event-click-latlng/docs/index.ts index d314408f8..13a3c14f0 100644 --- a/dist/samples/event-click-latlng/docs/index.ts +++ b/dist/samples/event-click-latlng/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_event_click_latlng] -async function initMap() { +async function init() { // Request needed libraries. const { InfoWindow } = await google.maps.importLibrary('maps'); @@ -42,5 +42,5 @@ async function initMap() { // [END maps_event_click_latlng_listener] } -void initMap(); +void init(); // [END maps_event_click_latlng] diff --git a/dist/samples/event-click-latlng/jsfiddle/demo.js b/dist/samples/event-click-latlng/jsfiddle/demo.js index 7ebdfa0b8..7ce1ed979 100644 --- a/dist/samples/event-click-latlng/jsfiddle/demo.js +++ b/dist/samples/event-click-latlng/jsfiddle/demo.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { // Request needed libraries. const { InfoWindow } = await google.maps.importLibrary('maps'); @@ -40,4 +40,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/event-closure/app/index.ts b/dist/samples/event-closure/app/index.ts index 1670f2180..ac473084e 100644 --- a/dist/samples/event-closure/app/index.ts +++ b/dist/samples/event-closure/app/index.ts @@ -5,11 +5,11 @@ */ // [START maps_event_closure] -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map')!; @@ -63,5 +63,5 @@ async function attachSecretMessage( }); } -void initMap(); +void init(); // [END maps_event_closure] diff --git a/dist/samples/event-closure/dist/assets/index-CguLmy-g.js b/dist/samples/event-closure/dist/assets/index-CguLmy-g.js new file mode 100644 index 000000000..e166b4214 --- /dev/null +++ b/dist/samples/event-closure/dist/assets/index-CguLmy-g.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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`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[{AdvancedMarkerElement:e}]=await Promise.all([google.maps.importLibrary(`marker`),google.maps.importLibrary(`maps`)]),n=document.querySelector(`gmp-map`).innerMap,r={north:-25.363882,south:-31.203405,east:131.044922,west:125.244141};n.fitBounds(r);let i=[`This`,`is`,`the`,`secret`,`message`],a=r.east-r.west,o=r.north-r.south;for(let s=0;s{r.open(e.map,e)})}e(); \ No newline at end of file diff --git a/dist/samples/event-closure/dist/assets/index-Drl7MJNE.js b/dist/samples/event-closure/dist/assets/index-Drl7MJNE.js deleted file mode 100644 index c7e3e9022..000000000 --- a/dist/samples/event-closure/dist/assets/index-Drl7MJNE.js +++ /dev/null @@ -1 +0,0 @@ -(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`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[,{AdvancedMarkerElement:e}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`marker`)]),n=document.querySelector(`gmp-map`).innerMap,r={north:-25.363882,south:-31.203405,east:131.044922,west:125.244141};n.fitBounds(r);let i=[`This`,`is`,`the`,`secret`,`message`],a=r.east-r.west,o=r.north-r.south;for(let s=0;s{r.open(e.map,e)})}e(); \ No newline at end of file diff --git a/dist/samples/event-closure/dist/index.html b/dist/samples/event-closure/dist/index.html index f09f706dc..80dc4336b 100644 --- a/dist/samples/event-closure/dist/index.html +++ b/dist/samples/event-closure/dist/index.html @@ -15,7 +15,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/event-closure/docs/index.js b/dist/samples/event-closure/docs/index.js index 7766a804d..492879058 100644 --- a/dist/samples/event-closure/docs/index.js +++ b/dist/samples/event-closure/docs/index.js @@ -6,11 +6,11 @@ */ // [START maps_event_closure] -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map'); @@ -61,5 +61,5 @@ async function attachSecretMessage(marker, secretMessage) { }); } -void initMap(); +void init(); // [END maps_event_closure] diff --git a/dist/samples/event-closure/docs/index.ts b/dist/samples/event-closure/docs/index.ts index 1670f2180..ac473084e 100644 --- a/dist/samples/event-closure/docs/index.ts +++ b/dist/samples/event-closure/docs/index.ts @@ -5,11 +5,11 @@ */ // [START maps_event_closure] -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map')!; @@ -63,5 +63,5 @@ async function attachSecretMessage( }); } -void initMap(); +void init(); // [END maps_event_closure] diff --git a/dist/samples/event-closure/jsfiddle/demo.js b/dist/samples/event-closure/jsfiddle/demo.js index bdb11b748..cd5c929d6 100644 --- a/dist/samples/event-closure/jsfiddle/demo.js +++ b/dist/samples/event-closure/jsfiddle/demo.js @@ -5,11 +5,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map'); @@ -60,4 +60,4 @@ async function attachSecretMessage(marker, secretMessage) { }); } -void initMap(); +void init(); diff --git a/dist/samples/event-poi/app/index.ts b/dist/samples/event-poi/app/index.ts index 580ad5569..81883fd38 100644 --- a/dist/samples/event-poi/app/index.ts +++ b/dist/samples/event-poi/app/index.ts @@ -5,9 +5,9 @@ */ // [START maps_event_poi] -let innerMap; +let innerMap: google.maps.Map; -async function initMap() { +async function init() { // Request the needed libraries. void google.maps.importLibrary('core'); // preload const { InfoWindow } = await google.maps.importLibrary('maps'); @@ -68,7 +68,7 @@ async function showInfoWindow( content: content, }); - innerMap.panTo(event.latLng); + innerMap.panTo(event.latLng!); infoWindow.open(innerMap); } @@ -94,5 +94,5 @@ function isIconMouseEvent( return 'placeId' in e; } -void initMap(); +void init(); // [END maps_event_poi] diff --git a/dist/samples/event-poi/docs/index.js b/dist/samples/event-poi/docs/index.js index 7822d466b..7403d338b 100644 --- a/dist/samples/event-poi/docs/index.js +++ b/dist/samples/event-poi/docs/index.js @@ -8,7 +8,7 @@ // [START maps_event_poi] let innerMap; -async function initMap() { +async function init() { // Request the needed libraries. void google.maps.importLibrary('core'); // preload const { InfoWindow } = await google.maps.importLibrary('maps'); @@ -90,5 +90,5 @@ function isIconMouseEvent(e) { return 'placeId' in e; } -void initMap(); +void init(); // [END maps_event_poi] diff --git a/dist/samples/event-poi/docs/index.ts b/dist/samples/event-poi/docs/index.ts index 580ad5569..81883fd38 100644 --- a/dist/samples/event-poi/docs/index.ts +++ b/dist/samples/event-poi/docs/index.ts @@ -5,9 +5,9 @@ */ // [START maps_event_poi] -let innerMap; +let innerMap: google.maps.Map; -async function initMap() { +async function init() { // Request the needed libraries. void google.maps.importLibrary('core'); // preload const { InfoWindow } = await google.maps.importLibrary('maps'); @@ -68,7 +68,7 @@ async function showInfoWindow( content: content, }); - innerMap.panTo(event.latLng); + innerMap.panTo(event.latLng!); infoWindow.open(innerMap); } @@ -94,5 +94,5 @@ function isIconMouseEvent( return 'placeId' in e; } -void initMap(); +void init(); // [END maps_event_poi] diff --git a/dist/samples/event-poi/jsfiddle/demo.js b/dist/samples/event-poi/jsfiddle/demo.js index 1f33cd961..3f6b1ba24 100644 --- a/dist/samples/event-poi/jsfiddle/demo.js +++ b/dist/samples/event-poi/jsfiddle/demo.js @@ -7,7 +7,7 @@ let innerMap; -async function initMap() { +async function init() { // Request the needed libraries. void google.maps.importLibrary('core'); // preload const { InfoWindow } = await google.maps.importLibrary('maps'); @@ -89,4 +89,4 @@ function isIconMouseEvent(e) { return 'placeId' in e; } -void initMap(); +void init(); diff --git a/dist/samples/event-properties/app/index.ts b/dist/samples/event-properties/app/index.ts index 96822d0f9..5d92767c0 100644 --- a/dist/samples/event-properties/app/index.ts +++ b/dist/samples/event-properties/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_event_properties] -async function initMap() { +async function init() { // Request needed libraries. const { InfoWindow } = await google.maps.importLibrary('maps'); @@ -24,5 +24,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_event_properties] diff --git a/dist/samples/event-properties/docs/index.js b/dist/samples/event-properties/docs/index.js index 82d868caf..3b0f09376 100644 --- a/dist/samples/event-properties/docs/index.js +++ b/dist/samples/event-properties/docs/index.js @@ -6,7 +6,7 @@ */ // [START maps_event_properties] -async function initMap() { +async function init() { // Request needed libraries. const { InfoWindow } = await google.maps.importLibrary('maps'); @@ -25,5 +25,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_event_properties] diff --git a/dist/samples/event-properties/docs/index.ts b/dist/samples/event-properties/docs/index.ts index 96822d0f9..5d92767c0 100644 --- a/dist/samples/event-properties/docs/index.ts +++ b/dist/samples/event-properties/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_event_properties] -async function initMap() { +async function init() { // Request needed libraries. const { InfoWindow } = await google.maps.importLibrary('maps'); @@ -24,5 +24,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_event_properties] diff --git a/dist/samples/event-properties/jsfiddle/demo.js b/dist/samples/event-properties/jsfiddle/demo.js index 050dece6e..8ae7864ae 100644 --- a/dist/samples/event-properties/jsfiddle/demo.js +++ b/dist/samples/event-properties/jsfiddle/demo.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { // Request needed libraries. const { InfoWindow } = await google.maps.importLibrary('maps'); @@ -24,4 +24,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/event-simple/app/index.ts b/dist/samples/event-simple/app/index.ts index 8cdbee2dd..9a62b0a19 100644 --- a/dist/samples/event-simple/app/index.ts +++ b/dist/samples/event-simple/app/index.ts @@ -5,12 +5,12 @@ */ // [START maps_event_simple] -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }, { LatLng }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }, { LatLng }] = await Promise.all([ google.maps.importLibrary('marker'), google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); // Retrieve the map element. @@ -43,5 +43,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_event_simple] diff --git a/dist/samples/event-simple/dist/assets/index-9XSPUjum.js b/dist/samples/event-simple/dist/assets/index-4-R800gu.js similarity index 60% rename from dist/samples/event-simple/dist/assets/index-9XSPUjum.js rename to dist/samples/event-simple/dist/assets/index-4-R800gu.js index b673610e5..9e8ddfbc4 100644 --- a/dist/samples/event-simple/dist/assets/index-9XSPUjum.js +++ b/dist/samples/event-simple/dist/assets/index-4-R800gu.js @@ -1 +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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`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[,{AdvancedMarkerElement:e},{LatLng:t}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`marker`),google.maps.importLibrary(`core`)]),n=document.querySelector(`gmp-map`),r=n.innerMap,i=new t(n.center),a=new e({position:i,map:r,title:`Click to zoom`,gmpClickable:!0});r.addListener(`center_changed`,()=>{window.setTimeout(()=>{r.panTo(i)},3e3)}),a.addEventListener(`gmp-click`,()=>{r.setZoom(8),r.setCenter(i)})}e(); \ No newline at end of file +(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`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[{AdvancedMarkerElement:e},{LatLng:t}]=await Promise.all([google.maps.importLibrary(`marker`),google.maps.importLibrary(`core`),google.maps.importLibrary(`maps`)]),n=document.querySelector(`gmp-map`),r=n.innerMap,i=new t(n.center),a=new e({position:i,map:r,title:`Click to zoom`,gmpClickable:!0});r.addListener(`center_changed`,()=>{window.setTimeout(()=>{r.panTo(i)},3e3)}),a.addEventListener(`gmp-click`,()=>{r.setZoom(8),r.setCenter(i)})}e(); \ No newline at end of file diff --git a/dist/samples/event-simple/dist/index.html b/dist/samples/event-simple/dist/index.html index 26200a548..cff5ade5c 100644 --- a/dist/samples/event-simple/dist/index.html +++ b/dist/samples/event-simple/dist/index.html @@ -15,7 +15,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/event-simple/docs/index.js b/dist/samples/event-simple/docs/index.js index dd4986e8d..9bb15a05c 100644 --- a/dist/samples/event-simple/docs/index.js +++ b/dist/samples/event-simple/docs/index.js @@ -6,12 +6,12 @@ */ // [START maps_event_simple] -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }, { LatLng }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }, { LatLng }] = await Promise.all([ google.maps.importLibrary('marker'), google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); // Retrieve the map element. @@ -44,5 +44,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_event_simple] diff --git a/dist/samples/event-simple/docs/index.ts b/dist/samples/event-simple/docs/index.ts index 8cdbee2dd..9a62b0a19 100644 --- a/dist/samples/event-simple/docs/index.ts +++ b/dist/samples/event-simple/docs/index.ts @@ -5,12 +5,12 @@ */ // [START maps_event_simple] -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }, { LatLng }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }, { LatLng }] = await Promise.all([ google.maps.importLibrary('marker'), google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); // Retrieve the map element. @@ -43,5 +43,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_event_simple] diff --git a/dist/samples/event-simple/jsfiddle/demo.js b/dist/samples/event-simple/jsfiddle/demo.js index 40f798028..11002b0a8 100644 --- a/dist/samples/event-simple/jsfiddle/demo.js +++ b/dist/samples/event-simple/jsfiddle/demo.js @@ -5,12 +5,12 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { // Request needed libraries. - const [, { AdvancedMarkerElement }, { LatLng }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }, { LatLng }] = await Promise.all([ google.maps.importLibrary('marker'), google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); // Retrieve the map element. @@ -43,4 +43,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/geocoding-component-restriction/app/index.ts b/dist/samples/geocoding-component-restriction/app/index.ts index 3ef85a4fb..5aeb30bce 100644 --- a/dist/samples/geocoding-component-restriction/app/index.ts +++ b/dist/samples/geocoding-component-restriction/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_geocoding_component_restriction] -async function initMap(): Promise { +async function init(): Promise { const [{ Geocoder }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('geocoding'), google.maps.importLibrary('marker'), @@ -33,5 +33,5 @@ async function initMap(): Promise { }); } -void initMap(); +void init(); // [END maps_geocoding_component_restriction] diff --git a/dist/samples/geocoding-component-restriction/docs/index.js b/dist/samples/geocoding-component-restriction/docs/index.js index 881405833..136dd9c70 100644 --- a/dist/samples/geocoding-component-restriction/docs/index.js +++ b/dist/samples/geocoding-component-restriction/docs/index.js @@ -6,7 +6,7 @@ */ // [START maps_geocoding_component_restriction] -async function initMap() { +async function init() { const [{ Geocoder }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('geocoding'), google.maps.importLibrary('marker'), @@ -34,5 +34,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_geocoding_component_restriction] diff --git a/dist/samples/geocoding-component-restriction/docs/index.ts b/dist/samples/geocoding-component-restriction/docs/index.ts index 3ef85a4fb..5aeb30bce 100644 --- a/dist/samples/geocoding-component-restriction/docs/index.ts +++ b/dist/samples/geocoding-component-restriction/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_geocoding_component_restriction] -async function initMap(): Promise { +async function init(): Promise { const [{ Geocoder }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('geocoding'), google.maps.importLibrary('marker'), @@ -33,5 +33,5 @@ async function initMap(): Promise { }); } -void initMap(); +void init(); // [END maps_geocoding_component_restriction] diff --git a/dist/samples/geocoding-component-restriction/jsfiddle/demo.js b/dist/samples/geocoding-component-restriction/jsfiddle/demo.js index 5a5478b73..bf5dd81d0 100644 --- a/dist/samples/geocoding-component-restriction/jsfiddle/demo.js +++ b/dist/samples/geocoding-component-restriction/jsfiddle/demo.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { const [{ Geocoder }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('geocoding'), google.maps.importLibrary('marker'), @@ -33,4 +33,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/geocoding-place-id/app/index.ts b/dist/samples/geocoding-place-id/app/index.ts index 852bbbc20..86aad9fd5 100644 --- a/dist/samples/geocoding-place-id/app/index.ts +++ b/dist/samples/geocoding-place-id/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_geocoding_place_id] // Initialize the map. -async function initMap(): Promise { +async function init(): Promise { const [{ Geocoder }, { InfoWindow }] = await Promise.all([ google.maps.importLibrary('geocoding'), google.maps.importLibrary('maps'), @@ -50,5 +50,5 @@ async function geocodePlaceId( } } -void initMap(); +void init(); // [END maps_geocoding_place_id] diff --git a/dist/samples/geocoding-place-id/docs/index.js b/dist/samples/geocoding-place-id/docs/index.js index 9fd18b0cb..7497cd946 100644 --- a/dist/samples/geocoding-place-id/docs/index.js +++ b/dist/samples/geocoding-place-id/docs/index.js @@ -6,7 +6,7 @@ */ // [START maps_geocoding_place_id] // Initialize the map. -async function initMap() { +async function init() { const [{ Geocoder }, { InfoWindow }] = await Promise.all([ google.maps.importLibrary('geocoding'), google.maps.importLibrary('maps'), @@ -46,5 +46,5 @@ async function geocodePlaceId(geocoder, map, infoWindow) { } } -void initMap(); +void init(); // [END maps_geocoding_place_id] diff --git a/dist/samples/geocoding-place-id/docs/index.ts b/dist/samples/geocoding-place-id/docs/index.ts index 852bbbc20..86aad9fd5 100644 --- a/dist/samples/geocoding-place-id/docs/index.ts +++ b/dist/samples/geocoding-place-id/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_geocoding_place_id] // Initialize the map. -async function initMap(): Promise { +async function init(): Promise { const [{ Geocoder }, { InfoWindow }] = await Promise.all([ google.maps.importLibrary('geocoding'), google.maps.importLibrary('maps'), @@ -50,5 +50,5 @@ async function geocodePlaceId( } } -void initMap(); +void init(); // [END maps_geocoding_place_id] diff --git a/dist/samples/geocoding-place-id/jsfiddle/demo.js b/dist/samples/geocoding-place-id/jsfiddle/demo.js index 2fb6e0b9c..9c4e5e33f 100644 --- a/dist/samples/geocoding-place-id/jsfiddle/demo.js +++ b/dist/samples/geocoding-place-id/jsfiddle/demo.js @@ -6,7 +6,7 @@ */ // Initialize the map. -async function initMap() { +async function init() { const [{ Geocoder }, { InfoWindow }] = await Promise.all([ google.maps.importLibrary('geocoding'), google.maps.importLibrary('maps'), @@ -46,4 +46,4 @@ async function geocodePlaceId(geocoder, map, infoWindow) { } } -void initMap(); +void init(); diff --git a/dist/samples/geocoding-region-es/app/index.ts b/dist/samples/geocoding-region-es/app/index.ts index ecba8adc5..efba60e92 100644 --- a/dist/samples/geocoding-region-es/app/index.ts +++ b/dist/samples/geocoding-region-es/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_js_geocoding_region_es] -async function initMap(): Promise { +async function init(): Promise { const [{ Geocoder }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('geocoding'), google.maps.importLibrary('marker'), @@ -34,5 +34,5 @@ async function initMap(): Promise { ); } -void initMap(); +void init(); // [END maps_js_geocoding_region_es] diff --git a/dist/samples/geocoding-region-es/docs/index.js b/dist/samples/geocoding-region-es/docs/index.js index a7c2c498f..0cf113609 100644 --- a/dist/samples/geocoding-region-es/docs/index.js +++ b/dist/samples/geocoding-region-es/docs/index.js @@ -6,7 +6,7 @@ */ // [START maps_js_geocoding_region_es] -async function initMap() { +async function init() { const [{ Geocoder }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('geocoding'), google.maps.importLibrary('marker'), @@ -35,5 +35,5 @@ async function initMap() { ); } -void initMap(); +void init(); // [END maps_js_geocoding_region_es] diff --git a/dist/samples/geocoding-region-es/docs/index.ts b/dist/samples/geocoding-region-es/docs/index.ts index ecba8adc5..efba60e92 100644 --- a/dist/samples/geocoding-region-es/docs/index.ts +++ b/dist/samples/geocoding-region-es/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_js_geocoding_region_es] -async function initMap(): Promise { +async function init(): Promise { const [{ Geocoder }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('geocoding'), google.maps.importLibrary('marker'), @@ -34,5 +34,5 @@ async function initMap(): Promise { ); } -void initMap(); +void init(); // [END maps_js_geocoding_region_es] diff --git a/dist/samples/geocoding-region-es/jsfiddle/demo.js b/dist/samples/geocoding-region-es/jsfiddle/demo.js index d64aae268..75027070d 100644 --- a/dist/samples/geocoding-region-es/jsfiddle/demo.js +++ b/dist/samples/geocoding-region-es/jsfiddle/demo.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { const [{ Geocoder }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('geocoding'), google.maps.importLibrary('marker'), @@ -34,4 +34,4 @@ async function initMap() { ); } -void initMap(); +void init(); diff --git a/dist/samples/geocoding-region-us/app/index.ts b/dist/samples/geocoding-region-us/app/index.ts index 7a385e7e7..ae853934e 100644 --- a/dist/samples/geocoding-region-us/app/index.ts +++ b/dist/samples/geocoding-region-us/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_js_geocoding_region_us] -async function initMap(): Promise { +async function init(): Promise { const [{ Geocoder }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('geocoding'), google.maps.importLibrary('marker'), @@ -34,5 +34,5 @@ async function initMap(): Promise { ); } -void initMap(); +void init(); // [END maps_js_geocoding_region_us] diff --git a/dist/samples/geocoding-region-us/docs/index.js b/dist/samples/geocoding-region-us/docs/index.js index 4b990a2f2..7f5745296 100644 --- a/dist/samples/geocoding-region-us/docs/index.js +++ b/dist/samples/geocoding-region-us/docs/index.js @@ -6,7 +6,7 @@ */ // [START maps_js_geocoding_region_us] -async function initMap() { +async function init() { const [{ Geocoder }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('geocoding'), google.maps.importLibrary('marker'), @@ -35,5 +35,5 @@ async function initMap() { ); } -void initMap(); +void init(); // [END maps_js_geocoding_region_us] diff --git a/dist/samples/geocoding-region-us/docs/index.ts b/dist/samples/geocoding-region-us/docs/index.ts index 7a385e7e7..ae853934e 100644 --- a/dist/samples/geocoding-region-us/docs/index.ts +++ b/dist/samples/geocoding-region-us/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_js_geocoding_region_us] -async function initMap(): Promise { +async function init(): Promise { const [{ Geocoder }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('geocoding'), google.maps.importLibrary('marker'), @@ -34,5 +34,5 @@ async function initMap(): Promise { ); } -void initMap(); +void init(); // [END maps_js_geocoding_region_us] diff --git a/dist/samples/geocoding-region-us/jsfiddle/demo.js b/dist/samples/geocoding-region-us/jsfiddle/demo.js index d64aae268..75027070d 100644 --- a/dist/samples/geocoding-region-us/jsfiddle/demo.js +++ b/dist/samples/geocoding-region-us/jsfiddle/demo.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { const [{ Geocoder }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('geocoding'), google.maps.importLibrary('marker'), @@ -34,4 +34,4 @@ async function initMap() { ); } -void initMap(); +void init(); diff --git a/dist/samples/geocoding-reverse/app/index.ts b/dist/samples/geocoding-reverse/app/index.ts index f311b9417..ec13dce92 100644 --- a/dist/samples/geocoding-reverse/app/index.ts +++ b/dist/samples/geocoding-reverse/app/index.ts @@ -6,7 +6,7 @@ // [START maps_geocoding_reverse] let marker; -async function initMap() { +async function init() { // Request the needed libraries. const [{ InfoWindow }, { Geocoder }, { AdvancedMarkerElement }] = await Promise.all([ @@ -87,5 +87,5 @@ async function geocodeLatLng( } } -void initMap(); +void init(); // [END maps_geocoding_reverse] diff --git a/dist/samples/geocoding-reverse/docs/index.js b/dist/samples/geocoding-reverse/docs/index.js index 9720c0bb6..54fe0d20c 100644 --- a/dist/samples/geocoding-reverse/docs/index.js +++ b/dist/samples/geocoding-reverse/docs/index.js @@ -7,7 +7,7 @@ // [START maps_geocoding_reverse] let marker; -async function initMap() { +async function init() { // Request the needed libraries. const [{ InfoWindow }, { Geocoder }, { AdvancedMarkerElement }] = await Promise.all([ @@ -84,5 +84,5 @@ async function geocodeLatLng(geocoder, map, infoWindow) { } } -void initMap(); +void init(); // [END maps_geocoding_reverse] diff --git a/dist/samples/geocoding-reverse/docs/index.ts b/dist/samples/geocoding-reverse/docs/index.ts index f311b9417..ec13dce92 100644 --- a/dist/samples/geocoding-reverse/docs/index.ts +++ b/dist/samples/geocoding-reverse/docs/index.ts @@ -6,7 +6,7 @@ // [START maps_geocoding_reverse] let marker; -async function initMap() { +async function init() { // Request the needed libraries. const [{ InfoWindow }, { Geocoder }, { AdvancedMarkerElement }] = await Promise.all([ @@ -87,5 +87,5 @@ async function geocodeLatLng( } } -void initMap(); +void init(); // [END maps_geocoding_reverse] diff --git a/dist/samples/geocoding-reverse/jsfiddle/demo.js b/dist/samples/geocoding-reverse/jsfiddle/demo.js index 8f64b80d6..f8d4bb23a 100644 --- a/dist/samples/geocoding-reverse/jsfiddle/demo.js +++ b/dist/samples/geocoding-reverse/jsfiddle/demo.js @@ -7,7 +7,7 @@ let marker; -async function initMap() { +async function init() { // Request the needed libraries. const [{ InfoWindow }, { Geocoder }, { AdvancedMarkerElement }] = await Promise.all([ @@ -84,4 +84,4 @@ async function geocodeLatLng(geocoder, map, infoWindow) { } } -void initMap(); +void init(); diff --git a/dist/samples/geocoding-simple/app/index.ts b/dist/samples/geocoding-simple/app/index.ts index 9c2237ff3..79d5bcee4 100644 --- a/dist/samples/geocoding-simple/app/index.ts +++ b/dist/samples/geocoding-simple/app/index.ts @@ -7,19 +7,19 @@ // [START maps_geocoding_simple] let geocoder: google.maps.Geocoder; let mapElement; -let innerMap; +let innerMap: google.maps.Map; let marker; let responseDiv; let responsePre; -async function initMap() { +async function init() { // Request the needed libraries. - const [, { Geocoder }, { AdvancedMarkerElement }, { ControlPosition }] = + const [{ Geocoder }, { AdvancedMarkerElement }, { ControlPosition }] = await Promise.all([ - google.maps.importLibrary('maps'), google.maps.importLibrary('geocoding'), google.maps.importLibrary('marker'), google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); // Get the gmp-map element. @@ -93,5 +93,5 @@ async function geocode(request: google.maps.GeocoderRequest) { } // [END maps_geocoding_simple_request] -void initMap(); +void init(); // [END maps_geocoding_simple] diff --git a/dist/samples/geocoding-simple/dist/assets/index--Xf9s_0d.js b/dist/samples/geocoding-simple/dist/assets/index--Xf9s_0d.js deleted file mode 100644 index 9048d742b..000000000 --- a/dist/samples/geocoding-simple/dist/assets/index--Xf9s_0d.js +++ /dev/null @@ -1 +0,0 @@ -(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e,t,n,r,i,a;async function o(){let[,{Geocoder:o},{AdvancedMarkerElement:l},{ControlPosition:u}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`geocoding`),google.maps.importLibrary(`marker`),google.maps.importLibrary(`core`)]);t=document.querySelector(`gmp-map`),n=t.innerMap,n.setOptions({mapTypeControl:!1,fullscreenControl:!1,cameraControlOptions:{position:u.INLINE_START_BLOCK_END},draggableCursor:`crosshair`}),e=new o;let d=document.getElementById(`address`),f=document.getElementById(`submit`),p=document.getElementById(`clear`);i=document.getElementById(`response-container`),a=document.getElementById(`response`),r=new l({}),n.addListener(`click`,e=>{c({location:e.latLng})}),f.addEventListener(`click`,()=>{c({address:d.value})}),p.addEventListener(`click`,()=>{s()}),s()}function s(){r.setMap(null),i.style.display=`none`}async function c(o){s();let{LatLng:c}=await google.maps.importLibrary(`core`);try{let s=await e.geocode(o),{results:l}=s;return n.setCenter(l[0].geometry.location),r.position=new c(l[0].geometry.location),t.append(r),i.style.display=`block`,a.innerText=JSON.stringify(s,null,2),l}catch(e){alert(`Geocode was not successful for the following reason: `+String(e))}}o(); \ No newline at end of file diff --git a/dist/samples/geocoding-simple/dist/assets/index-TFN50Rj5.js b/dist/samples/geocoding-simple/dist/assets/index-TFN50Rj5.js new file mode 100644 index 000000000..93d2660a2 --- /dev/null +++ b/dist/samples/geocoding-simple/dist/assets/index-TFN50Rj5.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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e,t,n,r,i,a;async function o(){let[{Geocoder:o},{AdvancedMarkerElement:l},{ControlPosition:u}]=await Promise.all([google.maps.importLibrary(`geocoding`),google.maps.importLibrary(`marker`),google.maps.importLibrary(`core`),google.maps.importLibrary(`maps`)]);t=document.querySelector(`gmp-map`),n=t.innerMap,n.setOptions({mapTypeControl:!1,fullscreenControl:!1,cameraControlOptions:{position:u.INLINE_START_BLOCK_END},draggableCursor:`crosshair`}),e=new o;let d=document.getElementById(`address`),f=document.getElementById(`submit`),p=document.getElementById(`clear`);i=document.getElementById(`response-container`),a=document.getElementById(`response`),r=new l({}),n.addListener(`click`,e=>{c({location:e.latLng})}),f.addEventListener(`click`,()=>{c({address:d.value})}),p.addEventListener(`click`,()=>{s()}),s()}function s(){r.setMap(null),i.style.display=`none`}async function c(o){s();let{LatLng:c}=await google.maps.importLibrary(`core`);try{let s=await e.geocode(o),{results:l}=s;return n.setCenter(l[0].geometry.location),r.position=new c(l[0].geometry.location),t.append(r),i.style.display=`block`,a.innerText=JSON.stringify(s,null,2),l}catch(e){alert(`Geocode was not successful for the following reason: `+String(e))}}o(); \ No newline at end of file diff --git a/dist/samples/geocoding-simple/dist/index.html b/dist/samples/geocoding-simple/dist/index.html index 5ca9d57f6..3c51f54fc 100644 --- a/dist/samples/geocoding-simple/dist/index.html +++ b/dist/samples/geocoding-simple/dist/index.html @@ -15,7 +15,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/geocoding-simple/docs/index.js b/dist/samples/geocoding-simple/docs/index.js index 504821652..e462c184a 100644 --- a/dist/samples/geocoding-simple/docs/index.js +++ b/dist/samples/geocoding-simple/docs/index.js @@ -13,14 +13,14 @@ let marker; let responseDiv; let responsePre; -async function initMap() { +async function init() { // Request the needed libraries. - const [, { Geocoder }, { AdvancedMarkerElement }, { ControlPosition }] = + const [{ Geocoder }, { AdvancedMarkerElement }, { ControlPosition }] = await Promise.all([ - google.maps.importLibrary('maps'), google.maps.importLibrary('geocoding'), google.maps.importLibrary('marker'), google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); // Get the gmp-map element. @@ -92,5 +92,5 @@ async function geocode(request) { } // [END maps_geocoding_simple_request] -void initMap(); +void init(); // [END maps_geocoding_simple] diff --git a/dist/samples/geocoding-simple/docs/index.ts b/dist/samples/geocoding-simple/docs/index.ts index 9c2237ff3..79d5bcee4 100644 --- a/dist/samples/geocoding-simple/docs/index.ts +++ b/dist/samples/geocoding-simple/docs/index.ts @@ -7,19 +7,19 @@ // [START maps_geocoding_simple] let geocoder: google.maps.Geocoder; let mapElement; -let innerMap; +let innerMap: google.maps.Map; let marker; let responseDiv; let responsePre; -async function initMap() { +async function init() { // Request the needed libraries. - const [, { Geocoder }, { AdvancedMarkerElement }, { ControlPosition }] = + const [{ Geocoder }, { AdvancedMarkerElement }, { ControlPosition }] = await Promise.all([ - google.maps.importLibrary('maps'), google.maps.importLibrary('geocoding'), google.maps.importLibrary('marker'), google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); // Get the gmp-map element. @@ -93,5 +93,5 @@ async function geocode(request: google.maps.GeocoderRequest) { } // [END maps_geocoding_simple_request] -void initMap(); +void init(); // [END maps_geocoding_simple] diff --git a/dist/samples/geocoding-simple/jsfiddle/demo.js b/dist/samples/geocoding-simple/jsfiddle/demo.js index 83acb49af..91c675c18 100644 --- a/dist/samples/geocoding-simple/jsfiddle/demo.js +++ b/dist/samples/geocoding-simple/jsfiddle/demo.js @@ -12,14 +12,14 @@ let marker; let responseDiv; let responsePre; -async function initMap() { +async function init() { // Request the needed libraries. - const [, { Geocoder }, { AdvancedMarkerElement }, { ControlPosition }] = + const [{ Geocoder }, { AdvancedMarkerElement }, { ControlPosition }] = await Promise.all([ - google.maps.importLibrary('maps'), google.maps.importLibrary('geocoding'), google.maps.importLibrary('marker'), google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); // Get the gmp-map element. @@ -89,4 +89,4 @@ async function geocode(request) { } } -void initMap(); +void init(); diff --git a/dist/samples/hiding-features/app/index.ts b/dist/samples/hiding-features/app/index.ts index 760005688..1a4b7bd33 100644 --- a/dist/samples/hiding-features/app/index.ts +++ b/dist/samples/hiding-features/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_hiding_features] -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -51,5 +51,5 @@ const styles: Record = { ], }; -void initMap(); +void init(); // [END maps_hiding_features] diff --git a/dist/samples/hiding-features/docs/index.js b/dist/samples/hiding-features/docs/index.js index 752928c43..01e64d56a 100644 --- a/dist/samples/hiding-features/docs/index.js +++ b/dist/samples/hiding-features/docs/index.js @@ -6,7 +6,7 @@ */ // [START maps_hiding_features] -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -46,5 +46,5 @@ const styles = { ], }; -void initMap(); +void init(); // [END maps_hiding_features] diff --git a/dist/samples/hiding-features/docs/index.ts b/dist/samples/hiding-features/docs/index.ts index 760005688..1a4b7bd33 100644 --- a/dist/samples/hiding-features/docs/index.ts +++ b/dist/samples/hiding-features/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_hiding_features] -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -51,5 +51,5 @@ const styles: Record = { ], }; -void initMap(); +void init(); // [END maps_hiding_features] diff --git a/dist/samples/hiding-features/jsfiddle/demo.js b/dist/samples/hiding-features/jsfiddle/demo.js index 5eb457248..52e640ec4 100644 --- a/dist/samples/hiding-features/jsfiddle/demo.js +++ b/dist/samples/hiding-features/jsfiddle/demo.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -45,4 +45,4 @@ const styles = { ], }; -void initMap(); +void init(); diff --git a/dist/samples/infowindow-simple/app/index.ts b/dist/samples/infowindow-simple/app/index.ts index d2cfd0ce0..09a665f7c 100644 --- a/dist/samples/infowindow-simple/app/index.ts +++ b/dist/samples/infowindow-simple/app/index.ts @@ -8,7 +8,7 @@ // This example displays a marker at the center of Australia. // When the user clicks the marker, an info window opens. -async function initMap(): Promise { +async function init(): Promise { // Import the needed libraries. const [{ InfoWindow }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -77,5 +77,5 @@ async function initMap(): Promise { }); } -void initMap(); +void init(); // [END maps_infowindow_simple] diff --git a/dist/samples/infowindow-simple/docs/index.js b/dist/samples/infowindow-simple/docs/index.js index 3cd7595b7..7461aae05 100644 --- a/dist/samples/infowindow-simple/docs/index.js +++ b/dist/samples/infowindow-simple/docs/index.js @@ -9,7 +9,7 @@ // This example displays a marker at the center of Australia. // When the user clicks the marker, an info window opens. -async function initMap() { +async function init() { // Import the needed libraries. const [{ InfoWindow }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -78,5 +78,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_infowindow_simple] diff --git a/dist/samples/infowindow-simple/docs/index.ts b/dist/samples/infowindow-simple/docs/index.ts index d2cfd0ce0..09a665f7c 100644 --- a/dist/samples/infowindow-simple/docs/index.ts +++ b/dist/samples/infowindow-simple/docs/index.ts @@ -8,7 +8,7 @@ // This example displays a marker at the center of Australia. // When the user clicks the marker, an info window opens. -async function initMap(): Promise { +async function init(): Promise { // Import the needed libraries. const [{ InfoWindow }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -77,5 +77,5 @@ async function initMap(): Promise { }); } -void initMap(); +void init(); // [END maps_infowindow_simple] diff --git a/dist/samples/infowindow-simple/jsfiddle/demo.js b/dist/samples/infowindow-simple/jsfiddle/demo.js index b41fc79b1..c34ee640f 100644 --- a/dist/samples/infowindow-simple/jsfiddle/demo.js +++ b/dist/samples/infowindow-simple/jsfiddle/demo.js @@ -8,7 +8,7 @@ // This example displays a marker at the center of Australia. // When the user clicks the marker, an info window opens. -async function initMap() { +async function init() { // Import the needed libraries. const [{ InfoWindow }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -77,4 +77,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/js-api-loader-map/app/index.ts b/dist/samples/js-api-loader-map/app/index.ts index 265aeea49..db4c2a16a 100644 --- a/dist/samples/js-api-loader-map/app/index.ts +++ b/dist/samples/js-api-loader-map/app/index.ts @@ -12,7 +12,7 @@ import { setOptions, importLibrary } from '@googlemaps/js-api-loader'; const API_KEY = 'AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8'; -async function initMap(): Promise { +async function init(): Promise { // [START maps_js_api_loader_map_options] // Set loader options. setOptions({ @@ -33,5 +33,5 @@ async function initMap(): Promise { new Map(document.getElementById('map') as HTMLElement, mapOptions); } -void initMap(); +void init(); // [END maps_js_api_loader_map] diff --git a/dist/samples/js-api-loader-map/docs/index.js b/dist/samples/js-api-loader-map/docs/index.js index 4e6aef684..7b7b091ea 100644 --- a/dist/samples/js-api-loader-map/docs/index.js +++ b/dist/samples/js-api-loader-map/docs/index.js @@ -12,7 +12,7 @@ import { setOptions, importLibrary } from '@googlemaps/js-api-loader'; const API_KEY = 'AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8'; -async function initMap() { +async function init() { // [START maps_js_api_loader_map_options] // Set loader options. setOptions({ @@ -33,5 +33,5 @@ async function initMap() { new Map(document.getElementById('map'), mapOptions); } -void initMap(); +void init(); // [END maps_js_api_loader_map] diff --git a/dist/samples/js-api-loader-map/docs/index.ts b/dist/samples/js-api-loader-map/docs/index.ts index 265aeea49..db4c2a16a 100644 --- a/dist/samples/js-api-loader-map/docs/index.ts +++ b/dist/samples/js-api-loader-map/docs/index.ts @@ -12,7 +12,7 @@ import { setOptions, importLibrary } from '@googlemaps/js-api-loader'; const API_KEY = 'AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8'; -async function initMap(): Promise { +async function init(): Promise { // [START maps_js_api_loader_map_options] // Set loader options. setOptions({ @@ -33,5 +33,5 @@ async function initMap(): Promise { new Map(document.getElementById('map') as HTMLElement, mapOptions); } -void initMap(); +void init(); // [END maps_js_api_loader_map] diff --git a/dist/samples/js-api-loader-map/jsfiddle/demo.js b/dist/samples/js-api-loader-map/jsfiddle/demo.js index 604dfb381..97eef0b57 100644 --- a/dist/samples/js-api-loader-map/jsfiddle/demo.js +++ b/dist/samples/js-api-loader-map/jsfiddle/demo.js @@ -9,7 +9,7 @@ import { setOptions, importLibrary } from '@googlemaps/js-api-loader'; const API_KEY = 'AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8'; -async function initMap() { +async function init() { // Set loader options. setOptions({ key: API_KEY, @@ -28,4 +28,4 @@ async function initMap() { new Map(document.getElementById('map'), mapOptions); } -void initMap(); +void init(); diff --git a/dist/samples/layer-data-event/app/index.ts b/dist/samples/layer-data-event/app/index.ts index d677825c0..d729ef22a 100644 --- a/dist/samples/layer-data-event/app/index.ts +++ b/dist/samples/layer-data-event/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_layer_data_event] -async function initMap() { +async function init() { await google.maps.importLibrary('maps'); const mapElement = document.querySelector('gmp-map')!; @@ -32,5 +32,5 @@ async function initMap() { // [END maps_layer_data_event_snippet] } -void initMap(); +void init(); // [END maps_layer_data_event] diff --git a/dist/samples/layer-data-event/docs/index.js b/dist/samples/layer-data-event/docs/index.js index 9111cc2c1..1c1bbfb4a 100644 --- a/dist/samples/layer-data-event/docs/index.js +++ b/dist/samples/layer-data-event/docs/index.js @@ -6,7 +6,7 @@ */ // [START maps_layer_data_event] -async function initMap() { +async function init() { await google.maps.importLibrary('maps'); const mapElement = document.querySelector('gmp-map'); @@ -33,5 +33,5 @@ async function initMap() { // [END maps_layer_data_event_snippet] } -void initMap(); +void init(); // [END maps_layer_data_event] diff --git a/dist/samples/layer-data-event/docs/index.ts b/dist/samples/layer-data-event/docs/index.ts index d677825c0..d729ef22a 100644 --- a/dist/samples/layer-data-event/docs/index.ts +++ b/dist/samples/layer-data-event/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_layer_data_event] -async function initMap() { +async function init() { await google.maps.importLibrary('maps'); const mapElement = document.querySelector('gmp-map')!; @@ -32,5 +32,5 @@ async function initMap() { // [END maps_layer_data_event_snippet] } -void initMap(); +void init(); // [END maps_layer_data_event] diff --git a/dist/samples/layer-data-event/jsfiddle/demo.js b/dist/samples/layer-data-event/jsfiddle/demo.js index 135721310..f09b9e172 100644 --- a/dist/samples/layer-data-event/jsfiddle/demo.js +++ b/dist/samples/layer-data-event/jsfiddle/demo.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { await google.maps.importLibrary('maps'); const mapElement = document.querySelector('gmp-map'); @@ -30,4 +30,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/layer-data-quakes-red/app/index.ts b/dist/samples/layer-data-quakes-red/app/index.ts index c8960a5a6..eb45736f3 100644 --- a/dist/samples/layer-data-quakes-red/app/index.ts +++ b/dist/samples/layer-data-quakes-red/app/index.ts @@ -5,12 +5,12 @@ */ // [START maps_layer_data_quakes_red] -let innerMap; +let innerMap: google.maps.Map; -async function initMap() { - const [, { SymbolPath }] = await Promise.all([ - google.maps.importLibrary('maps'), +async function init() { + const [{ SymbolPath }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map')!; @@ -43,10 +43,11 @@ async function initMap() { } // Defines the callback function referenced in the jsonp file. +// eslint-disable-next-line @typescript-eslint/no-explicit-any function earthquakeDataLoad(data: any) { innerMap.data.addGeoJson(data); } window.earthquakeDataLoad = earthquakeDataLoad; -void initMap(); +void init(); // [END maps_layer_data_quakes_red] diff --git a/dist/samples/layer-data-quakes-red/dist/assets/index-wSCHVohg.js b/dist/samples/layer-data-quakes-red/dist/assets/index-OTMI4Tta.js similarity index 56% rename from dist/samples/layer-data-quakes-red/dist/assets/index-wSCHVohg.js rename to dist/samples/layer-data-quakes-red/dist/assets/index-OTMI4Tta.js index de4a7a864..c418b04ef 100644 --- a/dist/samples/layer-data-quakes-red/dist/assets/index-wSCHVohg.js +++ b/dist/samples/layer-data-quakes-red/dist/assets/index-OTMI4Tta.js @@ -1 +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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e;async function t(){let[,{SymbolPath:t}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`core`)]);e=document.querySelector(`gmp-map`).innerMap;let n=document.createElement(`script`);n.setAttribute(`src`,`quakes.geo.js`),document.getElementsByTagName(`head`)[0].appendChild(n),e.data.setStyle(e=>{let n=Math.exp(parseFloat(e.getProperty(`mag`)))*.1;return{icon:{path:t.CIRCLE,scale:n,fillColor:`#f00`,fillOpacity:.35,strokeWeight:0}}})}function n(t){e.data.addGeoJson(t)}window.earthquakeDataLoad=n,t(); \ No newline at end of file +(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e;async function t(){let[{SymbolPath:t}]=await Promise.all([google.maps.importLibrary(`core`),google.maps.importLibrary(`maps`)]);e=document.querySelector(`gmp-map`).innerMap;let n=document.createElement(`script`);n.setAttribute(`src`,`quakes.geo.js`),document.getElementsByTagName(`head`)[0].appendChild(n),e.data.setStyle(e=>{let n=Math.exp(parseFloat(e.getProperty(`mag`)))*.1;return{icon:{path:t.CIRCLE,scale:n,fillColor:`#f00`,fillOpacity:.35,strokeWeight:0}}})}function n(t){e.data.addGeoJson(t)}window.earthquakeDataLoad=n,t(); \ No newline at end of file diff --git a/dist/samples/layer-data-quakes-red/dist/index.html b/dist/samples/layer-data-quakes-red/dist/index.html index 63474bbb1..1f970887e 100644 --- a/dist/samples/layer-data-quakes-red/dist/index.html +++ b/dist/samples/layer-data-quakes-red/dist/index.html @@ -16,7 +16,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/layer-data-quakes-red/docs/index.js b/dist/samples/layer-data-quakes-red/docs/index.js index 1906b1c15..60c11d47d 100644 --- a/dist/samples/layer-data-quakes-red/docs/index.js +++ b/dist/samples/layer-data-quakes-red/docs/index.js @@ -8,10 +8,10 @@ // [START maps_layer_data_quakes_red] let innerMap; -async function initMap() { - const [, { SymbolPath }] = await Promise.all([ - google.maps.importLibrary('maps'), +async function init() { + const [{ SymbolPath }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map'); @@ -43,10 +43,11 @@ async function initMap() { } // Defines the callback function referenced in the jsonp file. + function earthquakeDataLoad(data) { innerMap.data.addGeoJson(data); } window.earthquakeDataLoad = earthquakeDataLoad; -void initMap(); +void init(); // [END maps_layer_data_quakes_red] diff --git a/dist/samples/layer-data-quakes-red/docs/index.ts b/dist/samples/layer-data-quakes-red/docs/index.ts index c8960a5a6..eb45736f3 100644 --- a/dist/samples/layer-data-quakes-red/docs/index.ts +++ b/dist/samples/layer-data-quakes-red/docs/index.ts @@ -5,12 +5,12 @@ */ // [START maps_layer_data_quakes_red] -let innerMap; +let innerMap: google.maps.Map; -async function initMap() { - const [, { SymbolPath }] = await Promise.all([ - google.maps.importLibrary('maps'), +async function init() { + const [{ SymbolPath }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map')!; @@ -43,10 +43,11 @@ async function initMap() { } // Defines the callback function referenced in the jsonp file. +// eslint-disable-next-line @typescript-eslint/no-explicit-any function earthquakeDataLoad(data: any) { innerMap.data.addGeoJson(data); } window.earthquakeDataLoad = earthquakeDataLoad; -void initMap(); +void init(); // [END maps_layer_data_quakes_red] diff --git a/dist/samples/layer-data-quakes-red/jsfiddle/demo.js b/dist/samples/layer-data-quakes-red/jsfiddle/demo.js index 90964a3b6..478a81a92 100644 --- a/dist/samples/layer-data-quakes-red/jsfiddle/demo.js +++ b/dist/samples/layer-data-quakes-red/jsfiddle/demo.js @@ -7,10 +7,10 @@ let innerMap; -async function initMap() { - const [, { SymbolPath }] = await Promise.all([ - google.maps.importLibrary('maps'), +async function init() { + const [{ SymbolPath }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map'); @@ -42,9 +42,10 @@ async function initMap() { } // Defines the callback function referenced in the jsonp file. + function earthquakeDataLoad(data) { innerMap.data.addGeoJson(data); } window.earthquakeDataLoad = earthquakeDataLoad; -void initMap(); +void init(); diff --git a/dist/samples/layer-data-quakes-simple/app/index.ts b/dist/samples/layer-data-quakes-simple/app/index.ts index f7271ac0d..4577de347 100644 --- a/dist/samples/layer-data-quakes-simple/app/index.ts +++ b/dist/samples/layer-data-quakes-simple/app/index.ts @@ -5,9 +5,9 @@ */ // [START maps_layer_data_quakes_simple] -let innerMap; +let innerMap: google.maps.Map; -async function initMap() { +async function init() { await google.maps.importLibrary('maps'); const mapElement = document.querySelector('gmp-map')!; @@ -25,10 +25,11 @@ async function initMap() { } // Defines the callback function referenced in the jsonp file. +// eslint-disable-next-line @typescript-eslint/no-explicit-any function earthquakeDataLoad(data: any) { innerMap.data.addGeoJson(data); } window.earthquakeDataLoad = earthquakeDataLoad; -void initMap(); +void init(); // [END maps_layer_data_quakes_simple] diff --git a/dist/samples/layer-data-quakes-simple/docs/index.js b/dist/samples/layer-data-quakes-simple/docs/index.js index 0168d8a17..5565dcf1e 100644 --- a/dist/samples/layer-data-quakes-simple/docs/index.js +++ b/dist/samples/layer-data-quakes-simple/docs/index.js @@ -8,7 +8,7 @@ // [START maps_layer_data_quakes_simple] let innerMap; -async function initMap() { +async function init() { await google.maps.importLibrary('maps'); const mapElement = document.querySelector('gmp-map'); @@ -26,10 +26,11 @@ async function initMap() { } // Defines the callback function referenced in the jsonp file. + function earthquakeDataLoad(data) { innerMap.data.addGeoJson(data); } window.earthquakeDataLoad = earthquakeDataLoad; -void initMap(); +void init(); // [END maps_layer_data_quakes_simple] diff --git a/dist/samples/layer-data-quakes-simple/docs/index.ts b/dist/samples/layer-data-quakes-simple/docs/index.ts index f7271ac0d..4577de347 100644 --- a/dist/samples/layer-data-quakes-simple/docs/index.ts +++ b/dist/samples/layer-data-quakes-simple/docs/index.ts @@ -5,9 +5,9 @@ */ // [START maps_layer_data_quakes_simple] -let innerMap; +let innerMap: google.maps.Map; -async function initMap() { +async function init() { await google.maps.importLibrary('maps'); const mapElement = document.querySelector('gmp-map')!; @@ -25,10 +25,11 @@ async function initMap() { } // Defines the callback function referenced in the jsonp file. +// eslint-disable-next-line @typescript-eslint/no-explicit-any function earthquakeDataLoad(data: any) { innerMap.data.addGeoJson(data); } window.earthquakeDataLoad = earthquakeDataLoad; -void initMap(); +void init(); // [END maps_layer_data_quakes_simple] diff --git a/dist/samples/layer-data-quakes-simple/jsfiddle/demo.js b/dist/samples/layer-data-quakes-simple/jsfiddle/demo.js index 600f4986e..c88617f5c 100644 --- a/dist/samples/layer-data-quakes-simple/jsfiddle/demo.js +++ b/dist/samples/layer-data-quakes-simple/jsfiddle/demo.js @@ -7,7 +7,7 @@ let innerMap; -async function initMap() { +async function init() { await google.maps.importLibrary('maps'); const mapElement = document.querySelector('gmp-map'); @@ -25,9 +25,10 @@ async function initMap() { } // Defines the callback function referenced in the jsonp file. + function earthquakeDataLoad(data) { innerMap.data.addGeoJson(data); } window.earthquakeDataLoad = earthquakeDataLoad; -void initMap(); +void init(); diff --git a/dist/samples/layer-data-simple/app/index.ts b/dist/samples/layer-data-simple/app/index.ts index e4858288f..5c89430e3 100644 --- a/dist/samples/layer-data-simple/app/index.ts +++ b/dist/samples/layer-data-simple/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_layer_data_simple] -async function initMap() { +async function init() { await google.maps.importLibrary('maps'); const mapElement = document.querySelector('gmp-map')!; @@ -15,5 +15,5 @@ async function initMap() { innerMap.data.loadGeoJson('google.json'); } -void initMap(); +void init(); // [END maps_layer_data_simple] diff --git a/dist/samples/layer-data-simple/docs/index.js b/dist/samples/layer-data-simple/docs/index.js index 94a37261f..593ba1523 100644 --- a/dist/samples/layer-data-simple/docs/index.js +++ b/dist/samples/layer-data-simple/docs/index.js @@ -6,7 +6,7 @@ */ // [START maps_layer_data_simple] -async function initMap() { +async function init() { await google.maps.importLibrary('maps'); const mapElement = document.querySelector('gmp-map'); @@ -16,5 +16,5 @@ async function initMap() { innerMap.data.loadGeoJson('google.json'); } -void initMap(); +void init(); // [END maps_layer_data_simple] diff --git a/dist/samples/layer-data-simple/docs/index.ts b/dist/samples/layer-data-simple/docs/index.ts index e4858288f..5c89430e3 100644 --- a/dist/samples/layer-data-simple/docs/index.ts +++ b/dist/samples/layer-data-simple/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_layer_data_simple] -async function initMap() { +async function init() { await google.maps.importLibrary('maps'); const mapElement = document.querySelector('gmp-map')!; @@ -15,5 +15,5 @@ async function initMap() { innerMap.data.loadGeoJson('google.json'); } -void initMap(); +void init(); // [END maps_layer_data_simple] diff --git a/dist/samples/layer-data-simple/jsfiddle/demo.js b/dist/samples/layer-data-simple/jsfiddle/demo.js index 4199094e6..5cd4f4242 100644 --- a/dist/samples/layer-data-simple/jsfiddle/demo.js +++ b/dist/samples/layer-data-simple/jsfiddle/demo.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { await google.maps.importLibrary('maps'); const mapElement = document.querySelector('gmp-map'); @@ -15,4 +15,4 @@ async function initMap() { innerMap.data.loadGeoJson('google.json'); } -void initMap(); +void init(); diff --git a/dist/samples/layer-data-style/app/index.ts b/dist/samples/layer-data-style/app/index.ts index bf43c6ff4..a64b5b65e 100644 --- a/dist/samples/layer-data-style/app/index.ts +++ b/dist/samples/layer-data-style/app/index.ts @@ -5,10 +5,10 @@ */ // [START maps_layer_data_style] -async function initMap() { - const [, { event }] = await Promise.all([ - google.maps.importLibrary('maps'), +async function init() { + const [{ event }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map')!; @@ -31,5 +31,5 @@ async function initMap() { // [END maps_layer_data_style_script_snippet_style] } -void initMap(); +void init(); // [END maps_layer_data_style] diff --git a/dist/samples/layer-data-style/dist/assets/index-CkmsX2aC.js b/dist/samples/layer-data-style/dist/assets/index-Cve1kyUF.js similarity index 71% rename from dist/samples/layer-data-style/dist/assets/index-CkmsX2aC.js rename to dist/samples/layer-data-style/dist/assets/index-Cve1kyUF.js index 1d11d0e47..1a9acb610 100644 --- a/dist/samples/layer-data-style/dist/assets/index-CkmsX2aC.js +++ b/dist/samples/layer-data-style/dist/assets/index-Cve1kyUF.js @@ -1 +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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`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[,{event:e}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`core`)]),t=document.querySelector(`gmp-map`).innerMap;e.addListenerOnce(t,`idle`,()=>{t.data.loadGeoJson(`google.json`)}),t.data.setStyle({fillColor:`green`,strokeWeight:1})}e(); \ No newline at end of file +(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`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[{event:e}]=await Promise.all([google.maps.importLibrary(`core`),google.maps.importLibrary(`maps`)]),t=document.querySelector(`gmp-map`).innerMap;e.addListenerOnce(t,`idle`,()=>{t.data.loadGeoJson(`google.json`)}),t.data.setStyle({fillColor:`green`,strokeWeight:1})}e(); \ No newline at end of file diff --git a/dist/samples/layer-data-style/dist/index.html b/dist/samples/layer-data-style/dist/index.html index fb34987f5..d111770a8 100644 --- a/dist/samples/layer-data-style/dist/index.html +++ b/dist/samples/layer-data-style/dist/index.html @@ -15,7 +15,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/layer-data-style/docs/index.js b/dist/samples/layer-data-style/docs/index.js index 04634aa67..6946678df 100644 --- a/dist/samples/layer-data-style/docs/index.js +++ b/dist/samples/layer-data-style/docs/index.js @@ -6,10 +6,10 @@ */ // [START maps_layer_data_style] -async function initMap() { - const [, { event }] = await Promise.all([ - google.maps.importLibrary('maps'), +async function init() { + const [{ event }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map'); @@ -32,5 +32,5 @@ async function initMap() { // [END maps_layer_data_style_script_snippet_style] } -void initMap(); +void init(); // [END maps_layer_data_style] diff --git a/dist/samples/layer-data-style/docs/index.ts b/dist/samples/layer-data-style/docs/index.ts index bf43c6ff4..a64b5b65e 100644 --- a/dist/samples/layer-data-style/docs/index.ts +++ b/dist/samples/layer-data-style/docs/index.ts @@ -5,10 +5,10 @@ */ // [START maps_layer_data_style] -async function initMap() { - const [, { event }] = await Promise.all([ - google.maps.importLibrary('maps'), +async function init() { + const [{ event }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map')!; @@ -31,5 +31,5 @@ async function initMap() { // [END maps_layer_data_style_script_snippet_style] } -void initMap(); +void init(); // [END maps_layer_data_style] diff --git a/dist/samples/layer-data-style/jsfiddle/demo.js b/dist/samples/layer-data-style/jsfiddle/demo.js index dde76ee26..a67de0213 100644 --- a/dist/samples/layer-data-style/jsfiddle/demo.js +++ b/dist/samples/layer-data-style/jsfiddle/demo.js @@ -5,10 +5,10 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { - const [, { event }] = await Promise.all([ - google.maps.importLibrary('maps'), +async function init() { + const [{ event }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); const mapElement = document.querySelector('gmp-map'); @@ -27,4 +27,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/map-events/app/index.ts b/dist/samples/map-events/app/index.ts index 5f86f1d69..3cdbe1b0e 100644 --- a/dist/samples/map-events/app/index.ts +++ b/dist/samples/map-events/app/index.ts @@ -38,7 +38,7 @@ function setupListener(map: google.maps.Map, name: string) { }); } -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -70,5 +70,5 @@ function populateTable() { } } -void initMap(); +void init(); // [END maps_map_events] diff --git a/dist/samples/map-events/docs/index.js b/dist/samples/map-events/docs/index.js index dfcf70df1..982ed9dc1 100644 --- a/dist/samples/map-events/docs/index.js +++ b/dist/samples/map-events/docs/index.js @@ -39,7 +39,7 @@ function setupListener(map, name) { }); } -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -71,5 +71,5 @@ function populateTable() { } } -void initMap(); +void init(); // [END maps_map_events] diff --git a/dist/samples/map-events/docs/index.ts b/dist/samples/map-events/docs/index.ts index 5f86f1d69..3cdbe1b0e 100644 --- a/dist/samples/map-events/docs/index.ts +++ b/dist/samples/map-events/docs/index.ts @@ -38,7 +38,7 @@ function setupListener(map: google.maps.Map, name: string) { }); } -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -70,5 +70,5 @@ function populateTable() { } } -void initMap(); +void init(); // [END maps_map_events] diff --git a/dist/samples/map-events/jsfiddle/demo.js b/dist/samples/map-events/jsfiddle/demo.js index be6a21f22..4af0c1dc2 100644 --- a/dist/samples/map-events/jsfiddle/demo.js +++ b/dist/samples/map-events/jsfiddle/demo.js @@ -38,7 +38,7 @@ function setupListener(map, name) { }); } -async function initMap() { +async function init() { // Request needed libraries. await google.maps.importLibrary('maps'); @@ -70,4 +70,4 @@ function populateTable() { } } -void initMap(); +void init(); diff --git a/dist/samples/map-projection-simple/app/index.ts b/dist/samples/map-projection-simple/app/index.ts index 386d5918a..64fe60505 100644 --- a/dist/samples/map-projection-simple/app/index.ts +++ b/dist/samples/map-projection-simple/app/index.ts @@ -11,7 +11,7 @@ const mapElement = document.querySelector('gmp-map')!; let innerMap: google.maps.Map; -async function initMap() { +async function init() { // Request the needed libraries. await google.maps.importLibrary('maps'); @@ -149,5 +149,5 @@ const cities = { ], }; -void initMap(); +void init(); // [END maps_map_projection_simple] diff --git a/dist/samples/map-projection-simple/docs/index.js b/dist/samples/map-projection-simple/docs/index.js index 44f1748f7..d3e017024 100644 --- a/dist/samples/map-projection-simple/docs/index.js +++ b/dist/samples/map-projection-simple/docs/index.js @@ -12,7 +12,7 @@ const mapElement = document.querySelector('gmp-map'); let innerMap; -async function initMap() { +async function init() { // Request the needed libraries. await google.maps.importLibrary('maps'); @@ -150,5 +150,5 @@ const cities = { ], }; -void initMap(); +void init(); // [END maps_map_projection_simple] diff --git a/dist/samples/map-projection-simple/docs/index.ts b/dist/samples/map-projection-simple/docs/index.ts index 386d5918a..64fe60505 100644 --- a/dist/samples/map-projection-simple/docs/index.ts +++ b/dist/samples/map-projection-simple/docs/index.ts @@ -11,7 +11,7 @@ const mapElement = document.querySelector('gmp-map')!; let innerMap: google.maps.Map; -async function initMap() { +async function init() { // Request the needed libraries. await google.maps.importLibrary('maps'); @@ -149,5 +149,5 @@ const cities = { ], }; -void initMap(); +void init(); // [END maps_map_projection_simple] diff --git a/dist/samples/map-projection-simple/jsfiddle/demo.js b/dist/samples/map-projection-simple/jsfiddle/demo.js index e7b9cf497..eebc54ce8 100644 --- a/dist/samples/map-projection-simple/jsfiddle/demo.js +++ b/dist/samples/map-projection-simple/jsfiddle/demo.js @@ -11,7 +11,7 @@ const mapElement = document.querySelector('gmp-map'); let innerMap; -async function initMap() { +async function init() { // Request the needed libraries. await google.maps.importLibrary('maps'); @@ -149,4 +149,4 @@ const cities = { ], }; -void initMap(); +void init(); diff --git a/dist/samples/map-simple-js/app/index.ts b/dist/samples/map-simple-js/app/index.ts index 2a3cadac8..3d95621c1 100644 --- a/dist/samples/map-simple-js/app/index.ts +++ b/dist/samples/map-simple-js/app/index.ts @@ -12,7 +12,7 @@ */ // [START maps_map_simple_js] let map: google.maps.Map; -async function initMap(): Promise { +async function init(): Promise { // Import the needed libraries const { Map } = await google.maps.importLibrary('maps'); @@ -26,5 +26,5 @@ async function initMap(): Promise { console.log(map); } -void initMap(); +void init(); // [END maps_map_simple_js] diff --git a/dist/samples/map-simple-js/docs/index.js b/dist/samples/map-simple-js/docs/index.js index 14e39c73e..d888d573e 100644 --- a/dist/samples/map-simple-js/docs/index.js +++ b/dist/samples/map-simple-js/docs/index.js @@ -13,7 +13,7 @@ */ // [START maps_map_simple_js] let map; -async function initMap() { +async function init() { // Import the needed libraries const { Map } = await google.maps.importLibrary('maps'); @@ -27,5 +27,5 @@ async function initMap() { console.log(map); } -void initMap(); +void init(); // [END maps_map_simple_js] diff --git a/dist/samples/map-simple-js/docs/index.ts b/dist/samples/map-simple-js/docs/index.ts index 2a3cadac8..3d95621c1 100644 --- a/dist/samples/map-simple-js/docs/index.ts +++ b/dist/samples/map-simple-js/docs/index.ts @@ -12,7 +12,7 @@ */ // [START maps_map_simple_js] let map: google.maps.Map; -async function initMap(): Promise { +async function init(): Promise { // Import the needed libraries const { Map } = await google.maps.importLibrary('maps'); @@ -26,5 +26,5 @@ async function initMap(): Promise { console.log(map); } -void initMap(); +void init(); // [END maps_map_simple_js] diff --git a/dist/samples/map-simple-js/jsfiddle/demo.js b/dist/samples/map-simple-js/jsfiddle/demo.js index 6b0390df6..2e659e874 100644 --- a/dist/samples/map-simple-js/jsfiddle/demo.js +++ b/dist/samples/map-simple-js/jsfiddle/demo.js @@ -13,7 +13,7 @@ */ let map; -async function initMap() { +async function init() { // Import the needed libraries const { Map } = await google.maps.importLibrary('maps'); @@ -27,4 +27,4 @@ async function initMap() { console.log(map); } -void initMap(); +void init(); diff --git a/dist/samples/map-simple/app/index.ts b/dist/samples/map-simple/app/index.ts index c3da1372a..6b5577b33 100644 --- a/dist/samples/map-simple/app/index.ts +++ b/dist/samples/map-simple/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_map_simple] -async function initMap(): Promise { +async function init(): Promise { // Import the needed libraries. await google.maps.importLibrary('maps'); @@ -17,5 +17,5 @@ async function initMap(): Promise { console.log({ mapElement, innerMap }); } -void initMap(); +void init(); // [END maps_map_simple] diff --git a/dist/samples/map-simple/docs/index.js b/dist/samples/map-simple/docs/index.js index 47bd99482..cd4fa0903 100644 --- a/dist/samples/map-simple/docs/index.js +++ b/dist/samples/map-simple/docs/index.js @@ -6,7 +6,7 @@ */ // [START maps_map_simple] -async function initMap() { +async function init() { // Import the needed libraries. await google.maps.importLibrary('maps'); @@ -18,5 +18,5 @@ async function initMap() { console.log({ mapElement, innerMap }); } -void initMap(); +void init(); // [END maps_map_simple] diff --git a/dist/samples/map-simple/docs/index.ts b/dist/samples/map-simple/docs/index.ts index c3da1372a..6b5577b33 100644 --- a/dist/samples/map-simple/docs/index.ts +++ b/dist/samples/map-simple/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_map_simple] -async function initMap(): Promise { +async function init(): Promise { // Import the needed libraries. await google.maps.importLibrary('maps'); @@ -17,5 +17,5 @@ async function initMap(): Promise { console.log({ mapElement, innerMap }); } -void initMap(); +void init(); // [END maps_map_simple] diff --git a/dist/samples/map-simple/jsfiddle/demo.js b/dist/samples/map-simple/jsfiddle/demo.js index 946881c00..cba2b1075 100644 --- a/dist/samples/map-simple/jsfiddle/demo.js +++ b/dist/samples/map-simple/jsfiddle/demo.js @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { // Import the needed libraries. await google.maps.importLibrary('maps'); @@ -17,4 +17,4 @@ async function initMap() { console.log({ mapElement, innerMap }); } -void initMap(); +void init(); diff --git a/dist/samples/place-autocomplete-basic-map/app/index.ts b/dist/samples/place-autocomplete-basic-map/app/index.ts index 952d32ec9..8fcea027c 100644 --- a/dist/samples/place-autocomplete-basic-map/app/index.ts +++ b/dist/samples/place-autocomplete-basic-map/app/index.ts @@ -14,14 +14,14 @@ const placeDetailsElement = document.querySelector( const placeDetailsParent = placeDetailsElement.parentElement as HTMLElement; const gmpMapElement = document.querySelector('gmp-map')!; -async function initMap(): Promise { +async function init(): Promise { // Asynchronously load required libraries from the Google Maps JS API. - const [, { AdvancedMarkerElement }, { InfoWindow, Circle }, { Size }] = + const [{ AdvancedMarkerElement }, { InfoWindow, Circle }, { Size }] = await Promise.all([ - google.maps.importLibrary('places'), google.maps.importLibrary('marker'), google.maps.importLibrary('maps'), google.maps.importLibrary('core'), + google.maps.importLibrary('places'), ]); // Get the initial center directly from the gmp-map element's property. @@ -55,7 +55,7 @@ async function initMap(): Promise { // [START maps_place_autocomplete_basic_map_listener] // Event listener for when a place is selected from the autocomplete list. - placeAutocompleteElement.addEventListener('gmp-select', (event: any) => { + placeAutocompleteElement.addEventListener('gmp-select', (event) => { // Reset marker and InfoWindow, and prepare the details element. placeDetailsParent.appendChild(placeDetailsElement); placeDetailsElement.style.display = 'block'; @@ -65,7 +65,7 @@ async function initMap(): Promise { // Request details for the selected place. const placeDetailsRequest = placeDetailsElement.querySelector( 'gmp-place-details-place-request' - ) as any; + )!; placeDetailsRequest.place = event.place.id; }); // [END maps_place_autocomplete_basic_map_listener] @@ -106,5 +106,5 @@ async function initMap(): Promise { }); } -void initMap(); +void init(); // [END maps_place_autocomplete_basic_map] diff --git a/dist/samples/place-autocomplete-basic-map/dist/assets/index-CwdUD2Am.js b/dist/samples/place-autocomplete-basic-map/dist/assets/index-CwdUD2Am.js new file mode 100644 index 000000000..deb470114 --- /dev/null +++ b/dist/samples/place-autocomplete-basic-map/dist/assets/index-CwdUD2Am.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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=document.querySelector(`gmp-basic-place-autocomplete`),t=document.querySelector(`gmp-place-details-compact`),n=t.parentElement,r=document.querySelector(`gmp-map`);async function i(){let[{AdvancedMarkerElement:i},{InfoWindow:a,Circle:o},{Size:s}]=await Promise.all([google.maps.importLibrary(`marker`),google.maps.importLibrary(`maps`),google.maps.importLibrary(`core`),google.maps.importLibrary(`places`)]);e.locationBias=r.center;let c=r.innerMap;c.setOptions({clickableIcons:!1,mapTypeControl:!1,streetViewControl:!1});let l=new i({map:c,collisionBehavior:`REQUIRED_AND_HIDES_OPTIONAL`}),u=new a({minWidth:360,disableAutoPan:!0,headerDisabled:!0,pixelOffset:new s(0,-10)});e.addEventListener(`gmp-select`,e=>{n.appendChild(t),t.style.display=`block`,l.position=null,u.close();let r=t.querySelector(`gmp-place-details-place-request`);r.place=e.place.id}),t.addEventListener(`gmp-load`,()=>{let e=t.place?.location;if(!e){l.position=null;return}l.position=e,u.setContent(t),u.open({map:c,anchor:l}),c.setCenter(e)}),c.addListener(`click`,()=>{u.close(),l.position=null}),c.addListener(`idle`,()=>{e.locationBias=new o({center:c.getCenter(),radius:1e4})})}i(); \ No newline at end of file diff --git a/dist/samples/place-autocomplete-basic-map/dist/assets/index-DeO0XQ2l.js b/dist/samples/place-autocomplete-basic-map/dist/assets/index-DeO0XQ2l.js deleted file mode 100644 index fef69abfb..000000000 --- a/dist/samples/place-autocomplete-basic-map/dist/assets/index-DeO0XQ2l.js +++ /dev/null @@ -1 +0,0 @@ -(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=document.querySelector(`gmp-basic-place-autocomplete`),t=document.querySelector(`gmp-place-details-compact`),n=t.parentElement,r=document.querySelector(`gmp-map`);async function i(){let[,{AdvancedMarkerElement:i},{InfoWindow:a,Circle:o},{Size:s}]=await Promise.all([google.maps.importLibrary(`places`),google.maps.importLibrary(`marker`),google.maps.importLibrary(`maps`),google.maps.importLibrary(`core`)]);e.locationBias=r.center;let c=r.innerMap;c.setOptions({clickableIcons:!1,mapTypeControl:!1,streetViewControl:!1});let l=new i({map:c,collisionBehavior:`REQUIRED_AND_HIDES_OPTIONAL`}),u=new a({minWidth:360,disableAutoPan:!0,headerDisabled:!0,pixelOffset:new s(0,-10)});e.addEventListener(`gmp-select`,e=>{n.appendChild(t),t.style.display=`block`,l.position=null,u.close();let r=t.querySelector(`gmp-place-details-place-request`);r.place=e.place.id}),t.addEventListener(`gmp-load`,()=>{let e=t.place?.location;if(!e){l.position=null;return}l.position=e,u.setContent(t),u.open({map:c,anchor:l}),c.setCenter(e)}),c.addListener(`click`,()=>{u.close(),l.position=null}),c.addListener(`idle`,()=>{e.locationBias=new o({center:c.getCenter(),radius:1e4})})}i(); \ No newline at end of file diff --git a/dist/samples/place-autocomplete-basic-map/dist/index.html b/dist/samples/place-autocomplete-basic-map/dist/index.html index f4ef5ce8c..551a1e814 100644 --- a/dist/samples/place-autocomplete-basic-map/dist/index.html +++ b/dist/samples/place-autocomplete-basic-map/dist/index.html @@ -15,7 +15,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/place-autocomplete-basic-map/docs/index.js b/dist/samples/place-autocomplete-basic-map/docs/index.js index 74e3cf25a..ce0fd055e 100644 --- a/dist/samples/place-autocomplete-basic-map/docs/index.js +++ b/dist/samples/place-autocomplete-basic-map/docs/index.js @@ -13,14 +13,14 @@ const placeDetailsElement = document.querySelector('gmp-place-details-compact'); const placeDetailsParent = placeDetailsElement.parentElement; const gmpMapElement = document.querySelector('gmp-map'); -async function initMap() { +async function init() { // Asynchronously load required libraries from the Google Maps JS API. - const [, { AdvancedMarkerElement }, { InfoWindow, Circle }, { Size }] = + const [{ AdvancedMarkerElement }, { InfoWindow, Circle }, { Size }] = await Promise.all([ - google.maps.importLibrary('places'), google.maps.importLibrary('marker'), google.maps.importLibrary('maps'), google.maps.importLibrary('core'), + google.maps.importLibrary('places'), ]); // Get the initial center directly from the gmp-map element's property. @@ -104,5 +104,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_place_autocomplete_basic_map] diff --git a/dist/samples/place-autocomplete-basic-map/docs/index.ts b/dist/samples/place-autocomplete-basic-map/docs/index.ts index 952d32ec9..8fcea027c 100644 --- a/dist/samples/place-autocomplete-basic-map/docs/index.ts +++ b/dist/samples/place-autocomplete-basic-map/docs/index.ts @@ -14,14 +14,14 @@ const placeDetailsElement = document.querySelector( const placeDetailsParent = placeDetailsElement.parentElement as HTMLElement; const gmpMapElement = document.querySelector('gmp-map')!; -async function initMap(): Promise { +async function init(): Promise { // Asynchronously load required libraries from the Google Maps JS API. - const [, { AdvancedMarkerElement }, { InfoWindow, Circle }, { Size }] = + const [{ AdvancedMarkerElement }, { InfoWindow, Circle }, { Size }] = await Promise.all([ - google.maps.importLibrary('places'), google.maps.importLibrary('marker'), google.maps.importLibrary('maps'), google.maps.importLibrary('core'), + google.maps.importLibrary('places'), ]); // Get the initial center directly from the gmp-map element's property. @@ -55,7 +55,7 @@ async function initMap(): Promise { // [START maps_place_autocomplete_basic_map_listener] // Event listener for when a place is selected from the autocomplete list. - placeAutocompleteElement.addEventListener('gmp-select', (event: any) => { + placeAutocompleteElement.addEventListener('gmp-select', (event) => { // Reset marker and InfoWindow, and prepare the details element. placeDetailsParent.appendChild(placeDetailsElement); placeDetailsElement.style.display = 'block'; @@ -65,7 +65,7 @@ async function initMap(): Promise { // Request details for the selected place. const placeDetailsRequest = placeDetailsElement.querySelector( 'gmp-place-details-place-request' - ) as any; + )!; placeDetailsRequest.place = event.place.id; }); // [END maps_place_autocomplete_basic_map_listener] @@ -106,5 +106,5 @@ async function initMap(): Promise { }); } -void initMap(); +void init(); // [END maps_place_autocomplete_basic_map] diff --git a/dist/samples/place-autocomplete-basic-map/jsfiddle/demo.js b/dist/samples/place-autocomplete-basic-map/jsfiddle/demo.js index 3b4f51f9e..c31879278 100644 --- a/dist/samples/place-autocomplete-basic-map/jsfiddle/demo.js +++ b/dist/samples/place-autocomplete-basic-map/jsfiddle/demo.js @@ -12,14 +12,14 @@ const placeDetailsElement = document.querySelector('gmp-place-details-compact'); const placeDetailsParent = placeDetailsElement.parentElement; const gmpMapElement = document.querySelector('gmp-map'); -async function initMap() { +async function init() { // Asynchronously load required libraries from the Google Maps JS API. - const [, { AdvancedMarkerElement }, { InfoWindow, Circle }, { Size }] = + const [{ AdvancedMarkerElement }, { InfoWindow, Circle }, { Size }] = await Promise.all([ - google.maps.importLibrary('places'), google.maps.importLibrary('marker'), google.maps.importLibrary('maps'), google.maps.importLibrary('core'), + google.maps.importLibrary('places'), ]); // Get the initial center directly from the gmp-map element's property. @@ -101,4 +101,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/place-autocomplete-element/app/index.ts b/dist/samples/place-autocomplete-element/app/index.ts index 8cf5abc60..24db2c6dc 100644 --- a/dist/samples/place-autocomplete-element/app/index.ts +++ b/dist/samples/place-autocomplete-element/app/index.ts @@ -5,7 +5,7 @@ */ // [START maps_place_autocomplete_element] -async function initMap(): Promise { +async function init(): Promise { // [START maps_place_autocomplete_element_add] // Request needed libraries. // @ts-expect-error - currently missing. bug fix pending @@ -45,5 +45,5 @@ async function initMap(): Promise { // [END maps_place_autocomplete_element_listener] } -void initMap(); +void init(); // [END maps_place_autocomplete_element] diff --git a/dist/samples/place-autocomplete-element/docs/index.js b/dist/samples/place-autocomplete-element/docs/index.js index 909632e0f..ccd457e7c 100644 --- a/dist/samples/place-autocomplete-element/docs/index.js +++ b/dist/samples/place-autocomplete-element/docs/index.js @@ -6,10 +6,10 @@ */ // [START maps_place_autocomplete_element] -async function initMap() { +async function init() { // [START maps_place_autocomplete_element_add] // Request needed libraries. - // @ts-expect-error - currently missing. bug fix pending + const { PlaceAutocompleteElement } = await google.maps.importLibrary('places'); // Create the input HTML element, and append it. @@ -46,5 +46,5 @@ async function initMap() { // [END maps_place_autocomplete_element_listener] } -void initMap(); +void init(); // [END maps_place_autocomplete_element] diff --git a/dist/samples/place-autocomplete-element/docs/index.ts b/dist/samples/place-autocomplete-element/docs/index.ts index 8cf5abc60..24db2c6dc 100644 --- a/dist/samples/place-autocomplete-element/docs/index.ts +++ b/dist/samples/place-autocomplete-element/docs/index.ts @@ -5,7 +5,7 @@ */ // [START maps_place_autocomplete_element] -async function initMap(): Promise { +async function init(): Promise { // [START maps_place_autocomplete_element_add] // Request needed libraries. // @ts-expect-error - currently missing. bug fix pending @@ -45,5 +45,5 @@ async function initMap(): Promise { // [END maps_place_autocomplete_element_listener] } -void initMap(); +void init(); // [END maps_place_autocomplete_element] diff --git a/dist/samples/place-autocomplete-element/jsfiddle/demo.js b/dist/samples/place-autocomplete-element/jsfiddle/demo.js index c6f5f5d42..05a323a11 100644 --- a/dist/samples/place-autocomplete-element/jsfiddle/demo.js +++ b/dist/samples/place-autocomplete-element/jsfiddle/demo.js @@ -5,9 +5,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -async function initMap() { +async function init() { // Request needed libraries. - // @ts-expect-error - currently missing. bug fix pending + const { PlaceAutocompleteElement } = await google.maps.importLibrary('places'); // Create the input HTML element, and append it. @@ -41,4 +41,4 @@ async function initMap() { ); } -void initMap(); +void init(); diff --git a/dist/samples/place-autocomplete-map/app/index.ts b/dist/samples/place-autocomplete-map/app/index.ts index 471f9d9eb..23778a69c 100644 --- a/dist/samples/place-autocomplete-map/app/index.ts +++ b/dist/samples/place-autocomplete-map/app/index.ts @@ -7,10 +7,10 @@ // [START maps_place_autocomplete_map] const mapElement = document.querySelector('gmp-map')!; const placeAutocomplete = document.querySelector('gmp-place-autocomplete')!; -let innerMap; +let innerMap: google.maps.Map; let marker: google.maps.marker.AdvancedMarkerElement; let infoWindow: google.maps.InfoWindow; -async function initMap(): Promise { +async function init(): Promise { // Request needed libraries. const [{ AdvancedMarkerElement }, { InfoWindow }] = await Promise.all([ google.maps.importLibrary('marker'), @@ -26,7 +26,7 @@ async function initMap(): Promise { // Use the bounds_changed event to restrict results to the current map bounds. innerMap.addListener('bounds_changed', () => { - placeAutocomplete.locationRestriction = innerMap.getBounds(); + placeAutocomplete.locationRestriction = innerMap.getBounds()!; }); // Create the marker and infoWindow. @@ -50,7 +50,7 @@ async function initMap(): Promise { if (place.viewport) { innerMap.fitBounds(place.viewport); } else { - innerMap.setCenter(place.location); + innerMap.setCenter(place.location!); innerMap.setZoom(17); } @@ -81,5 +81,5 @@ function updateInfoWindow(content, center) { }); } -void initMap(); +void init(); // [END maps_place_autocomplete_map] diff --git a/dist/samples/place-autocomplete-map/docs/index.js b/dist/samples/place-autocomplete-map/docs/index.js index c2b9e786a..ab9ff78ce 100644 --- a/dist/samples/place-autocomplete-map/docs/index.js +++ b/dist/samples/place-autocomplete-map/docs/index.js @@ -11,7 +11,7 @@ const placeAutocomplete = document.querySelector('gmp-place-autocomplete'); let innerMap; let marker; let infoWindow; -async function initMap() { +async function init() { // Request needed libraries. const [{ AdvancedMarkerElement }, { InfoWindow }] = await Promise.all([ google.maps.importLibrary('marker'), @@ -82,5 +82,5 @@ function updateInfoWindow(content, center) { }); } -void initMap(); +void init(); // [END maps_place_autocomplete_map] diff --git a/dist/samples/place-autocomplete-map/docs/index.ts b/dist/samples/place-autocomplete-map/docs/index.ts index 471f9d9eb..23778a69c 100644 --- a/dist/samples/place-autocomplete-map/docs/index.ts +++ b/dist/samples/place-autocomplete-map/docs/index.ts @@ -7,10 +7,10 @@ // [START maps_place_autocomplete_map] const mapElement = document.querySelector('gmp-map')!; const placeAutocomplete = document.querySelector('gmp-place-autocomplete')!; -let innerMap; +let innerMap: google.maps.Map; let marker: google.maps.marker.AdvancedMarkerElement; let infoWindow: google.maps.InfoWindow; -async function initMap(): Promise { +async function init(): Promise { // Request needed libraries. const [{ AdvancedMarkerElement }, { InfoWindow }] = await Promise.all([ google.maps.importLibrary('marker'), @@ -26,7 +26,7 @@ async function initMap(): Promise { // Use the bounds_changed event to restrict results to the current map bounds. innerMap.addListener('bounds_changed', () => { - placeAutocomplete.locationRestriction = innerMap.getBounds(); + placeAutocomplete.locationRestriction = innerMap.getBounds()!; }); // Create the marker and infoWindow. @@ -50,7 +50,7 @@ async function initMap(): Promise { if (place.viewport) { innerMap.fitBounds(place.viewport); } else { - innerMap.setCenter(place.location); + innerMap.setCenter(place.location!); innerMap.setZoom(17); } @@ -81,5 +81,5 @@ function updateInfoWindow(content, center) { }); } -void initMap(); +void init(); // [END maps_place_autocomplete_map] diff --git a/dist/samples/place-autocomplete-map/jsfiddle/demo.js b/dist/samples/place-autocomplete-map/jsfiddle/demo.js index f6e8f2cdd..f73290315 100644 --- a/dist/samples/place-autocomplete-map/jsfiddle/demo.js +++ b/dist/samples/place-autocomplete-map/jsfiddle/demo.js @@ -10,7 +10,7 @@ const placeAutocomplete = document.querySelector('gmp-place-autocomplete'); let innerMap; let marker; let infoWindow; -async function initMap() { +async function init() { // Request needed libraries. const [{ AdvancedMarkerElement }, { InfoWindow }] = await Promise.all([ google.maps.importLibrary('marker'), @@ -79,4 +79,4 @@ function updateInfoWindow(content, center) { }); } -void initMap(); +void init(); diff --git a/dist/samples/place-class/app/index.ts b/dist/samples/place-class/app/index.ts index 4a6e1bccc..130a3398c 100644 --- a/dist/samples/place-class/app/index.ts +++ b/dist/samples/place-class/app/index.ts @@ -6,10 +6,10 @@ // [START maps_place_class] const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; let infoWindow; -async function initMap() { +async function init() { const { InfoWindow } = await google.maps.importLibrary('maps'); innerMap = mapElement.innerMap; @@ -71,5 +71,5 @@ async function getPlaceDetails() { } // [END maps_place_class_fetchfields] -void initMap(); +void init(); // [END maps_place_class] diff --git a/dist/samples/place-class/docs/index.js b/dist/samples/place-class/docs/index.js index 7afa5aafc..69934b387 100644 --- a/dist/samples/place-class/docs/index.js +++ b/dist/samples/place-class/docs/index.js @@ -10,7 +10,7 @@ const mapElement = document.querySelector('gmp-map'); let innerMap; let infoWindow; -async function initMap() { +async function init() { const { InfoWindow } = await google.maps.importLibrary('maps'); innerMap = mapElement.innerMap; @@ -72,5 +72,5 @@ async function getPlaceDetails() { } // [END maps_place_class_fetchfields] -void initMap(); +void init(); // [END maps_place_class] diff --git a/dist/samples/place-class/docs/index.ts b/dist/samples/place-class/docs/index.ts index 4a6e1bccc..130a3398c 100644 --- a/dist/samples/place-class/docs/index.ts +++ b/dist/samples/place-class/docs/index.ts @@ -6,10 +6,10 @@ // [START maps_place_class] const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; let infoWindow; -async function initMap() { +async function init() { const { InfoWindow } = await google.maps.importLibrary('maps'); innerMap = mapElement.innerMap; @@ -71,5 +71,5 @@ async function getPlaceDetails() { } // [END maps_place_class_fetchfields] -void initMap(); +void init(); // [END maps_place_class] diff --git a/dist/samples/place-class/jsfiddle/demo.js b/dist/samples/place-class/jsfiddle/demo.js index 691db036c..5bdc39fea 100644 --- a/dist/samples/place-class/jsfiddle/demo.js +++ b/dist/samples/place-class/jsfiddle/demo.js @@ -9,7 +9,7 @@ const mapElement = document.querySelector('gmp-map'); let innerMap; let infoWindow; -async function initMap() { +async function init() { const { InfoWindow } = await google.maps.importLibrary('maps'); innerMap = mapElement.innerMap; @@ -69,4 +69,4 @@ async function getPlaceDetails() { }); } -void initMap(); +void init(); diff --git a/dist/samples/place-nearby-search/app/index.ts b/dist/samples/place-nearby-search/app/index.ts index d40c471cb..39b25ce16 100644 --- a/dist/samples/place-nearby-search/app/index.ts +++ b/dist/samples/place-nearby-search/app/index.ts @@ -6,12 +6,12 @@ // [START maps_place_nearby_search] const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; let center; let typeSelect; let infoWindow; -async function initMap() { +async function init() { const [{ InfoWindow }, { event }] = await Promise.all([ google.maps.importLibrary('maps'), google.maps.importLibrary('core'), @@ -49,9 +49,8 @@ async function nearbySearch() { // [START maps_place_nearby_search_request] // Get bounds and radius to constrain search. center = mapElement.center; - const bounds = innerMap.getBounds(); - const ne = bounds.getNorthEast(); - const sw = bounds.getSouthWest(); + const ne = innerMap.getBounds()!.getNorthEast(); + const sw = innerMap.getBounds()!.getSouthWest(); const diameter = spherical.computeDistanceBetween(ne, sw); const radius = Math.min(diameter / 2, 50000); // Radius cannot be more than 50000. @@ -112,7 +111,7 @@ async function nearbySearch() { } marker.addListener('gmp-click', () => { - innerMap.panTo(place.location); + innerMap.panTo(place.location!); updateInfoWindow(place.displayName, content, marker); }); }); @@ -131,5 +130,5 @@ function updateInfoWindow(title, content, anchor) { }); } -void initMap(); +void init(); // [END maps_place_nearby_search] diff --git a/dist/samples/place-nearby-search/dist/assets/index-hVCfAAP2.js b/dist/samples/place-nearby-search/dist/assets/index-CPlujCpF.js similarity index 52% rename from dist/samples/place-nearby-search/dist/assets/index-hVCfAAP2.js rename to dist/samples/place-nearby-search/dist/assets/index-CPlujCpF.js index 91a3411e3..805ea009d 100644 --- a/dist/samples/place-nearby-search/dist/assets/index-hVCfAAP2.js +++ b/dist/samples/place-nearby-search/dist/assets/index-CPlujCpF.js @@ -1 +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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=document.querySelector(`gmp-map`),t,n,r,i;async function a(){let[{InfoWindow:n},{event:a}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`core`)]);t=e.innerMap,t.setOptions({mapTypeControl:!1}),r=document.querySelector(`.type-select`),r.addEventListener(`change`,()=>{o()}),i=new n,a.addListenerOnce(t,`idle`,()=>{o()})}async function o(){let[{Place:i,SearchNearbyRankPreference:a},{AdvancedMarkerElement:o},{spherical:c}]=await Promise.all([google.maps.importLibrary(`places`),google.maps.importLibrary(`marker`),google.maps.importLibrary(`geometry`)]);n=e.center;let l=t.getBounds(),u=l.getNorthEast(),d=l.getSouthWest(),f=c.computeDistanceBetween(u,d),p=Math.min(f/2,5e4),m={fields:[`displayName`,`location`,`formattedAddress`,`googleMapsURI`],locationRestriction:{center:n,radius:p},includedPrimaryTypes:[r.value],maxResultCount:5,rankPreference:a.POPULARITY},{places:h}=await i.searchNearby(m);if(h.length){let{LatLngBounds:n}=await google.maps.importLibrary(`core`),r=new n;for(let t of e.querySelectorAll(`gmp-advanced-marker`))t.remove();h.forEach(e=>{if(!e.location)return;r.extend(e.location);let n=new o({map:t,position:e.location,title:e.displayName}),i=document.createElement(`div`),a=document.createElement(`div`);a.textContent=e.formattedAddress||``;let c=document.createElement(`div`);if(c.textContent=e.id,i.append(a,c),e.googleMapsURI){let t=document.createElement(`a`);t.href=e.googleMapsURI,t.target=`_blank`,t.textContent=`View Details on Google Maps`,i.appendChild(t)}n.addListener(`gmp-click`,()=>{t.panTo(e.location),s(e.displayName,i,n)})}),t.fitBounds(r,100)}else console.log(`No results`)}function s(e,t,n){i.setContent(t),i.setHeaderContent(e),i.open({anchor:n})}a(); \ No newline at end of file +(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=document.querySelector(`gmp-map`),t,n,r,i;async function a(){let[{InfoWindow:n},{event:a}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`core`)]);t=e.innerMap,t.setOptions({mapTypeControl:!1}),r=document.querySelector(`.type-select`),r.addEventListener(`change`,()=>{o()}),i=new n,a.addListenerOnce(t,`idle`,()=>{o()})}async function o(){let[{Place:i,SearchNearbyRankPreference:a},{AdvancedMarkerElement:o},{spherical:c}]=await Promise.all([google.maps.importLibrary(`places`),google.maps.importLibrary(`marker`),google.maps.importLibrary(`geometry`)]);n=e.center;let l=t.getBounds().getNorthEast(),u=t.getBounds().getSouthWest(),d=c.computeDistanceBetween(l,u),f=Math.min(d/2,5e4),p={fields:[`displayName`,`location`,`formattedAddress`,`googleMapsURI`],locationRestriction:{center:n,radius:f},includedPrimaryTypes:[r.value],maxResultCount:5,rankPreference:a.POPULARITY},{places:m}=await i.searchNearby(p);if(m.length){let{LatLngBounds:n}=await google.maps.importLibrary(`core`),r=new n;for(let t of e.querySelectorAll(`gmp-advanced-marker`))t.remove();m.forEach(e=>{if(!e.location)return;r.extend(e.location);let n=new o({map:t,position:e.location,title:e.displayName}),i=document.createElement(`div`),a=document.createElement(`div`);a.textContent=e.formattedAddress||``;let c=document.createElement(`div`);if(c.textContent=e.id,i.append(a,c),e.googleMapsURI){let t=document.createElement(`a`);t.href=e.googleMapsURI,t.target=`_blank`,t.textContent=`View Details on Google Maps`,i.appendChild(t)}n.addListener(`gmp-click`,()=>{t.panTo(e.location),s(e.displayName,i,n)})}),t.fitBounds(r,100)}else console.log(`No results`)}function s(e,t,n){i.setContent(t),i.setHeaderContent(e),i.open({anchor:n})}a(); \ No newline at end of file diff --git a/dist/samples/place-nearby-search/dist/index.html b/dist/samples/place-nearby-search/dist/index.html index b780ce636..77905d7d7 100644 --- a/dist/samples/place-nearby-search/dist/index.html +++ b/dist/samples/place-nearby-search/dist/index.html @@ -15,7 +15,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/place-nearby-search/docs/index.js b/dist/samples/place-nearby-search/docs/index.js index 3a110ca1f..8e7bec862 100644 --- a/dist/samples/place-nearby-search/docs/index.js +++ b/dist/samples/place-nearby-search/docs/index.js @@ -12,7 +12,7 @@ let center; let typeSelect; let infoWindow; -async function initMap() { +async function init() { const [{ InfoWindow }, { event }] = await Promise.all([ google.maps.importLibrary('maps'), google.maps.importLibrary('core'), @@ -50,9 +50,8 @@ async function nearbySearch() { // [START maps_place_nearby_search_request] // Get bounds and radius to constrain search. center = mapElement.center; - const bounds = innerMap.getBounds(); - const ne = bounds.getNorthEast(); - const sw = bounds.getSouthWest(); + const ne = innerMap.getBounds().getNorthEast(); + const sw = innerMap.getBounds().getSouthWest(); const diameter = spherical.computeDistanceBetween(ne, sw); const radius = Math.min(diameter / 2, 50000); // Radius cannot be more than 50000. @@ -132,5 +131,5 @@ function updateInfoWindow(title, content, anchor) { }); } -void initMap(); +void init(); // [END maps_place_nearby_search] diff --git a/dist/samples/place-nearby-search/docs/index.ts b/dist/samples/place-nearby-search/docs/index.ts index d40c471cb..39b25ce16 100644 --- a/dist/samples/place-nearby-search/docs/index.ts +++ b/dist/samples/place-nearby-search/docs/index.ts @@ -6,12 +6,12 @@ // [START maps_place_nearby_search] const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; let center; let typeSelect; let infoWindow; -async function initMap() { +async function init() { const [{ InfoWindow }, { event }] = await Promise.all([ google.maps.importLibrary('maps'), google.maps.importLibrary('core'), @@ -49,9 +49,8 @@ async function nearbySearch() { // [START maps_place_nearby_search_request] // Get bounds and radius to constrain search. center = mapElement.center; - const bounds = innerMap.getBounds(); - const ne = bounds.getNorthEast(); - const sw = bounds.getSouthWest(); + const ne = innerMap.getBounds()!.getNorthEast(); + const sw = innerMap.getBounds()!.getSouthWest(); const diameter = spherical.computeDistanceBetween(ne, sw); const radius = Math.min(diameter / 2, 50000); // Radius cannot be more than 50000. @@ -112,7 +111,7 @@ async function nearbySearch() { } marker.addListener('gmp-click', () => { - innerMap.panTo(place.location); + innerMap.panTo(place.location!); updateInfoWindow(place.displayName, content, marker); }); }); @@ -131,5 +130,5 @@ function updateInfoWindow(title, content, anchor) { }); } -void initMap(); +void init(); // [END maps_place_nearby_search] diff --git a/dist/samples/place-nearby-search/jsfiddle/demo.js b/dist/samples/place-nearby-search/jsfiddle/demo.js index a77fcd8f5..5fe97a1ab 100644 --- a/dist/samples/place-nearby-search/jsfiddle/demo.js +++ b/dist/samples/place-nearby-search/jsfiddle/demo.js @@ -11,7 +11,7 @@ let center; let typeSelect; let infoWindow; -async function initMap() { +async function init() { const [{ InfoWindow }, { event }] = await Promise.all([ google.maps.importLibrary('maps'), google.maps.importLibrary('core'), @@ -49,9 +49,8 @@ async function nearbySearch() { // Get bounds and radius to constrain search. center = mapElement.center; - const bounds = innerMap.getBounds(); - const ne = bounds.getNorthEast(); - const sw = bounds.getSouthWest(); + const ne = innerMap.getBounds().getNorthEast(); + const sw = innerMap.getBounds().getSouthWest(); const diameter = spherical.computeDistanceBetween(ne, sw); const radius = Math.min(diameter / 2, 50000); // Radius cannot be more than 50000. @@ -130,4 +129,4 @@ function updateInfoWindow(title, content, anchor) { }); } -void initMap(); +void init(); diff --git a/dist/samples/place-reviews/app/index.ts b/dist/samples/place-reviews/app/index.ts index b0e54c461..2ec24d416 100644 --- a/dist/samples/place-reviews/app/index.ts +++ b/dist/samples/place-reviews/app/index.ts @@ -5,11 +5,11 @@ */ // [START maps_place_reviews] -let innerMap; +let innerMap: google.maps.Map; let infoWindow; const mapElement = document.querySelector('gmp-map')!; -async function initMap() { +async function init() { // Import the needed libraries. const [{ InfoWindow }, { AdvancedMarkerElement }, { Place }] = await Promise.all([ @@ -79,7 +79,7 @@ async function initMap() { title: place.displayName, }); - innerMap.setCenter(place.location); + innerMap.setCenter(place.location!); // Show the info window. infoWindow.open({ @@ -88,5 +88,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_place_reviews] diff --git a/dist/samples/place-reviews/docs/index.js b/dist/samples/place-reviews/docs/index.js index 5f4758fe1..bbf8c00b2 100644 --- a/dist/samples/place-reviews/docs/index.js +++ b/dist/samples/place-reviews/docs/index.js @@ -10,7 +10,7 @@ let innerMap; let infoWindow; const mapElement = document.querySelector('gmp-map'); -async function initMap() { +async function init() { // Import the needed libraries. const [{ InfoWindow }, { AdvancedMarkerElement }, { Place }] = await Promise.all([ @@ -89,5 +89,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_place_reviews] diff --git a/dist/samples/place-reviews/docs/index.ts b/dist/samples/place-reviews/docs/index.ts index b0e54c461..2ec24d416 100644 --- a/dist/samples/place-reviews/docs/index.ts +++ b/dist/samples/place-reviews/docs/index.ts @@ -5,11 +5,11 @@ */ // [START maps_place_reviews] -let innerMap; +let innerMap: google.maps.Map; let infoWindow; const mapElement = document.querySelector('gmp-map')!; -async function initMap() { +async function init() { // Import the needed libraries. const [{ InfoWindow }, { AdvancedMarkerElement }, { Place }] = await Promise.all([ @@ -79,7 +79,7 @@ async function initMap() { title: place.displayName, }); - innerMap.setCenter(place.location); + innerMap.setCenter(place.location!); // Show the info window. infoWindow.open({ @@ -88,5 +88,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_place_reviews] diff --git a/dist/samples/place-reviews/jsfiddle/demo.js b/dist/samples/place-reviews/jsfiddle/demo.js index 4f8d6a287..14e25057a 100644 --- a/dist/samples/place-reviews/jsfiddle/demo.js +++ b/dist/samples/place-reviews/jsfiddle/demo.js @@ -9,7 +9,7 @@ let innerMap; let infoWindow; const mapElement = document.querySelector('gmp-map'); -async function initMap() { +async function init() { // Import the needed libraries. const [{ InfoWindow }, { AdvancedMarkerElement }, { Place }] = await Promise.all([ @@ -86,4 +86,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/place-text-search/app/index.ts b/dist/samples/place-text-search/app/index.ts index 5c2ae22e9..b5a1aefa7 100644 --- a/dist/samples/place-text-search/app/index.ts +++ b/dist/samples/place-text-search/app/index.ts @@ -9,7 +9,7 @@ let map; let markers = {}; let infoWindow; -async function initMap() { +async function init() { const [{ Map, InfoWindow }, { ControlPosition }] = await Promise.all([ google.maps.importLibrary('maps'), google.maps.importLibrary('core'), @@ -111,5 +111,5 @@ function updateInfoWindow(title, content, anchor) { }); } -void initMap(); +void init(); // [END maps_place_text_search] diff --git a/dist/samples/place-text-search/docs/index.js b/dist/samples/place-text-search/docs/index.js index 20a55a184..f26ba4d99 100644 --- a/dist/samples/place-text-search/docs/index.js +++ b/dist/samples/place-text-search/docs/index.js @@ -10,7 +10,7 @@ let map; let markers = {}; let infoWindow; -async function initMap() { +async function init() { const [{ Map, InfoWindow }, { ControlPosition }] = await Promise.all([ google.maps.importLibrary('maps'), google.maps.importLibrary('core'), @@ -110,5 +110,5 @@ function updateInfoWindow(title, content, anchor) { }); } -void initMap(); +void init(); // [END maps_place_text_search] diff --git a/dist/samples/place-text-search/docs/index.ts b/dist/samples/place-text-search/docs/index.ts index 5c2ae22e9..b5a1aefa7 100644 --- a/dist/samples/place-text-search/docs/index.ts +++ b/dist/samples/place-text-search/docs/index.ts @@ -9,7 +9,7 @@ let map; let markers = {}; let infoWindow; -async function initMap() { +async function init() { const [{ Map, InfoWindow }, { ControlPosition }] = await Promise.all([ google.maps.importLibrary('maps'), google.maps.importLibrary('core'), @@ -111,5 +111,5 @@ function updateInfoWindow(title, content, anchor) { }); } -void initMap(); +void init(); // [END maps_place_text_search] diff --git a/dist/samples/place-text-search/jsfiddle/demo.js b/dist/samples/place-text-search/jsfiddle/demo.js index 44c8ad5df..ce8d1ffee 100644 --- a/dist/samples/place-text-search/jsfiddle/demo.js +++ b/dist/samples/place-text-search/jsfiddle/demo.js @@ -9,7 +9,7 @@ let map; let markers = {}; let infoWindow; -async function initMap() { +async function init() { const [{ Map, InfoWindow }, { ControlPosition }] = await Promise.all([ google.maps.importLibrary('maps'), google.maps.importLibrary('core'), @@ -108,4 +108,4 @@ function updateInfoWindow(title, content, anchor) { }); } -void initMap(); +void init(); diff --git a/dist/samples/places-autocomplete-addressform/app/index.ts b/dist/samples/places-autocomplete-addressform/app/index.ts index 42c0c2e23..7737bacec 100644 --- a/dist/samples/places-autocomplete-addressform/app/index.ts +++ b/dist/samples/places-autocomplete-addressform/app/index.ts @@ -16,7 +16,7 @@ let address1Field: HTMLInputElement; let address2Field: HTMLInputElement; let postalField: HTMLInputElement; -async function initAutocomplete() { +async function init() { await google.maps.importLibrary('places'); placeAutocomplete = document.querySelector('gmp-place-autocomplete')!; @@ -102,5 +102,5 @@ async function fillInAddress(placePrediction) { } // [END maps_places_autocomplete_addressform_fillform] -void initAutocomplete(); +void init(); // [END maps_places_autocomplete_addressform] diff --git a/dist/samples/places-autocomplete-addressform/docs/index.js b/dist/samples/places-autocomplete-addressform/docs/index.js index 12f1924c2..1c05d8702 100644 --- a/dist/samples/places-autocomplete-addressform/docs/index.js +++ b/dist/samples/places-autocomplete-addressform/docs/index.js @@ -17,7 +17,7 @@ let address1Field; let address2Field; let postalField; -async function initAutocomplete() { +async function init() { await google.maps.importLibrary('places'); placeAutocomplete = document.querySelector('gmp-place-autocomplete'); @@ -100,5 +100,5 @@ async function fillInAddress(placePrediction) { } // [END maps_places_autocomplete_addressform_fillform] -void initAutocomplete(); +void init(); // [END maps_places_autocomplete_addressform] diff --git a/dist/samples/places-autocomplete-addressform/docs/index.ts b/dist/samples/places-autocomplete-addressform/docs/index.ts index 42c0c2e23..7737bacec 100644 --- a/dist/samples/places-autocomplete-addressform/docs/index.ts +++ b/dist/samples/places-autocomplete-addressform/docs/index.ts @@ -16,7 +16,7 @@ let address1Field: HTMLInputElement; let address2Field: HTMLInputElement; let postalField: HTMLInputElement; -async function initAutocomplete() { +async function init() { await google.maps.importLibrary('places'); placeAutocomplete = document.querySelector('gmp-place-autocomplete')!; @@ -102,5 +102,5 @@ async function fillInAddress(placePrediction) { } // [END maps_places_autocomplete_addressform_fillform] -void initAutocomplete(); +void init(); // [END maps_places_autocomplete_addressform] diff --git a/dist/samples/places-autocomplete-addressform/jsfiddle/demo.js b/dist/samples/places-autocomplete-addressform/jsfiddle/demo.js index 57b4f79b3..4a780c3b1 100644 --- a/dist/samples/places-autocomplete-addressform/jsfiddle/demo.js +++ b/dist/samples/places-autocomplete-addressform/jsfiddle/demo.js @@ -16,7 +16,7 @@ let address1Field; let address2Field; let postalField; -async function initAutocomplete() { +async function init() { await google.maps.importLibrary('places'); placeAutocomplete = document.querySelector('gmp-place-autocomplete'); @@ -97,4 +97,4 @@ async function fillInAddress(placePrediction) { address2Field.focus(); } -void initAutocomplete(); +void init(); diff --git a/dist/samples/places-placeid-finder/app/index.ts b/dist/samples/places-placeid-finder/app/index.ts index ac6092d85..60c87b795 100644 --- a/dist/samples/places-placeid-finder/app/index.ts +++ b/dist/samples/places-placeid-finder/app/index.ts @@ -10,7 +10,7 @@ // the place ID and other information about the place that the user has // selected. -async function initMap(): Promise { +async function init(): Promise { // Request needed libraries. const [{ InfoWindow }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -57,7 +57,7 @@ async function initMap(): Promise { placeAutocomplete.addEventListener( 'gmp-select', - async ({ placePrediction }: any) => { + async ({ placePrediction }) => { infoWindow.close(); const place = placePrediction.toPlace(); @@ -85,19 +85,19 @@ async function initMap(): Promise { infoWindowContent.children.namedItem( 'place-name' ) as HTMLElement - ).textContent = place.displayName as string; + ).textContent = place.displayName!; ( infoWindowContent.children.namedItem('place-id') as HTMLElement - ).textContent = place.id as string; + ).textContent = place.id; ( infoWindowContent.children.namedItem( 'place-address' ) as HTMLElement - ).textContent = place.formattedAddress as string; + ).textContent = place.formattedAddress!; infoWindow.open(map, marker); } ); } -void initMap(); +void init(); // [END maps_places_placeid_finder] diff --git a/dist/samples/places-placeid-finder/docs/index.js b/dist/samples/places-placeid-finder/docs/index.js index 505756649..e46e9c1f9 100644 --- a/dist/samples/places-placeid-finder/docs/index.js +++ b/dist/samples/places-placeid-finder/docs/index.js @@ -11,7 +11,7 @@ // the place ID and other information about the place that the user has // selected. -async function initMap() { +async function init() { // Request needed libraries. const [{ InfoWindow }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -91,5 +91,5 @@ async function initMap() { ); } -void initMap(); +void init(); // [END maps_places_placeid_finder] diff --git a/dist/samples/places-placeid-finder/docs/index.ts b/dist/samples/places-placeid-finder/docs/index.ts index ac6092d85..60c87b795 100644 --- a/dist/samples/places-placeid-finder/docs/index.ts +++ b/dist/samples/places-placeid-finder/docs/index.ts @@ -10,7 +10,7 @@ // the place ID and other information about the place that the user has // selected. -async function initMap(): Promise { +async function init(): Promise { // Request needed libraries. const [{ InfoWindow }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -57,7 +57,7 @@ async function initMap(): Promise { placeAutocomplete.addEventListener( 'gmp-select', - async ({ placePrediction }: any) => { + async ({ placePrediction }) => { infoWindow.close(); const place = placePrediction.toPlace(); @@ -85,19 +85,19 @@ async function initMap(): Promise { infoWindowContent.children.namedItem( 'place-name' ) as HTMLElement - ).textContent = place.displayName as string; + ).textContent = place.displayName!; ( infoWindowContent.children.namedItem('place-id') as HTMLElement - ).textContent = place.id as string; + ).textContent = place.id; ( infoWindowContent.children.namedItem( 'place-address' ) as HTMLElement - ).textContent = place.formattedAddress as string; + ).textContent = place.formattedAddress!; infoWindow.open(map, marker); } ); } -void initMap(); +void init(); // [END maps_places_placeid_finder] diff --git a/dist/samples/places-placeid-finder/jsfiddle/demo.js b/dist/samples/places-placeid-finder/jsfiddle/demo.js index 4a5ffe087..f872eaddd 100644 --- a/dist/samples/places-placeid-finder/jsfiddle/demo.js +++ b/dist/samples/places-placeid-finder/jsfiddle/demo.js @@ -10,7 +10,7 @@ // the place ID and other information about the place that the user has // selected. -async function initMap() { +async function init() { // Request needed libraries. const [{ InfoWindow }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -90,4 +90,4 @@ async function initMap() { ); } -void initMap(); +void init(); diff --git a/dist/samples/polyline-complex/app/index.ts b/dist/samples/polyline-complex/app/index.ts index f8bced9d4..06b179388 100644 --- a/dist/samples/polyline-complex/app/index.ts +++ b/dist/samples/polyline-complex/app/index.ts @@ -15,7 +15,7 @@ let poly: google.maps.Polyline; const mapElement = document.querySelector('gmp-map')!; let innerMap: google.maps.Map; -async function initMap() { +async function init() { // Import the needed libraries. const [{ Polyline }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -51,5 +51,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_polyline_complex] diff --git a/dist/samples/polyline-complex/docs/index.js b/dist/samples/polyline-complex/docs/index.js index 528ed36a0..272935215 100644 --- a/dist/samples/polyline-complex/docs/index.js +++ b/dist/samples/polyline-complex/docs/index.js @@ -16,7 +16,7 @@ let poly; const mapElement = document.querySelector('gmp-map'); let innerMap; -async function initMap() { +async function init() { // Import the needed libraries. const [{ Polyline }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -52,5 +52,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_polyline_complex] diff --git a/dist/samples/polyline-complex/docs/index.ts b/dist/samples/polyline-complex/docs/index.ts index f8bced9d4..06b179388 100644 --- a/dist/samples/polyline-complex/docs/index.ts +++ b/dist/samples/polyline-complex/docs/index.ts @@ -15,7 +15,7 @@ let poly: google.maps.Polyline; const mapElement = document.querySelector('gmp-map')!; let innerMap: google.maps.Map; -async function initMap() { +async function init() { // Import the needed libraries. const [{ Polyline }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -51,5 +51,5 @@ async function initMap() { }); } -void initMap(); +void init(); // [END maps_polyline_complex] diff --git a/dist/samples/polyline-complex/jsfiddle/demo.js b/dist/samples/polyline-complex/jsfiddle/demo.js index f0590fc8d..ccac7df1b 100644 --- a/dist/samples/polyline-complex/jsfiddle/demo.js +++ b/dist/samples/polyline-complex/jsfiddle/demo.js @@ -15,7 +15,7 @@ let poly; const mapElement = document.querySelector('gmp-map'); let innerMap; -async function initMap() { +async function init() { // Import the needed libraries. const [{ Polyline }, { AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -51,4 +51,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/polyline-remove/app/index.ts b/dist/samples/polyline-remove/app/index.ts index 49d3a4e90..fdcb0eb8f 100644 --- a/dist/samples/polyline-remove/app/index.ts +++ b/dist/samples/polyline-remove/app/index.ts @@ -10,9 +10,9 @@ let flightPath: google.maps.Polyline; const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; -async function initMap() { +async function init() { const { Polyline } = await google.maps.importLibrary('maps'); innerMap = mapElement.innerMap; @@ -48,5 +48,5 @@ function removeLine(): void { flightPath.setMap(null); } -void initMap(); +void init(); // [END maps_polyline_remove] diff --git a/dist/samples/polyline-remove/docs/index.js b/dist/samples/polyline-remove/docs/index.js index 2eb604bff..3a4553971 100644 --- a/dist/samples/polyline-remove/docs/index.js +++ b/dist/samples/polyline-remove/docs/index.js @@ -13,7 +13,7 @@ let flightPath; const mapElement = document.querySelector('gmp-map'); let innerMap; -async function initMap() { +async function init() { const { Polyline } = await google.maps.importLibrary('maps'); innerMap = mapElement.innerMap; @@ -49,5 +49,5 @@ function removeLine() { flightPath.setMap(null); } -void initMap(); +void init(); // [END maps_polyline_remove] diff --git a/dist/samples/polyline-remove/docs/index.ts b/dist/samples/polyline-remove/docs/index.ts index 49d3a4e90..fdcb0eb8f 100644 --- a/dist/samples/polyline-remove/docs/index.ts +++ b/dist/samples/polyline-remove/docs/index.ts @@ -10,9 +10,9 @@ let flightPath: google.maps.Polyline; const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; -async function initMap() { +async function init() { const { Polyline } = await google.maps.importLibrary('maps'); innerMap = mapElement.innerMap; @@ -48,5 +48,5 @@ function removeLine(): void { flightPath.setMap(null); } -void initMap(); +void init(); // [END maps_polyline_remove] diff --git a/dist/samples/polyline-remove/jsfiddle/demo.js b/dist/samples/polyline-remove/jsfiddle/demo.js index 5e475917e..7c9048667 100644 --- a/dist/samples/polyline-remove/jsfiddle/demo.js +++ b/dist/samples/polyline-remove/jsfiddle/demo.js @@ -12,7 +12,7 @@ let flightPath; const mapElement = document.querySelector('gmp-map'); let innerMap; -async function initMap() { +async function init() { const { Polyline } = await google.maps.importLibrary('maps'); innerMap = mapElement.innerMap; @@ -48,4 +48,4 @@ function removeLine() { flightPath.setMap(null); } -void initMap(); +void init(); diff --git a/dist/samples/polyline-simple/app/index.ts b/dist/samples/polyline-simple/app/index.ts index 3095ebc07..39b6aef14 100644 --- a/dist/samples/polyline-simple/app/index.ts +++ b/dist/samples/polyline-simple/app/index.ts @@ -9,9 +9,9 @@ // the first trans-Pacific flight between Oakland, CA, and Brisbane, // Australia which was made by Charles Kingsford Smith. const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; -async function initMap() { +async function init() { const { Polyline } = await google.maps.importLibrary('maps'); innerMap = mapElement.innerMap; @@ -32,5 +32,5 @@ async function initMap() { flightPath.setMap(innerMap); } -void initMap(); +void init(); // [END maps_polyline_simple] diff --git a/dist/samples/polyline-simple/docs/index.js b/dist/samples/polyline-simple/docs/index.js index 9a0d92eff..1681e8e28 100644 --- a/dist/samples/polyline-simple/docs/index.js +++ b/dist/samples/polyline-simple/docs/index.js @@ -12,7 +12,7 @@ const mapElement = document.querySelector('gmp-map'); let innerMap; -async function initMap() { +async function init() { const { Polyline } = await google.maps.importLibrary('maps'); innerMap = mapElement.innerMap; @@ -33,5 +33,5 @@ async function initMap() { flightPath.setMap(innerMap); } -void initMap(); +void init(); // [END maps_polyline_simple] diff --git a/dist/samples/polyline-simple/docs/index.ts b/dist/samples/polyline-simple/docs/index.ts index 3095ebc07..39b6aef14 100644 --- a/dist/samples/polyline-simple/docs/index.ts +++ b/dist/samples/polyline-simple/docs/index.ts @@ -9,9 +9,9 @@ // the first trans-Pacific flight between Oakland, CA, and Brisbane, // Australia which was made by Charles Kingsford Smith. const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; -async function initMap() { +async function init() { const { Polyline } = await google.maps.importLibrary('maps'); innerMap = mapElement.innerMap; @@ -32,5 +32,5 @@ async function initMap() { flightPath.setMap(innerMap); } -void initMap(); +void init(); // [END maps_polyline_simple] diff --git a/dist/samples/polyline-simple/jsfiddle/demo.js b/dist/samples/polyline-simple/jsfiddle/demo.js index b2519d706..14c64c6a1 100644 --- a/dist/samples/polyline-simple/jsfiddle/demo.js +++ b/dist/samples/polyline-simple/jsfiddle/demo.js @@ -11,7 +11,7 @@ const mapElement = document.querySelector('gmp-map'); let innerMap; -async function initMap() { +async function init() { const { Polyline } = await google.maps.importLibrary('maps'); innerMap = mapElement.innerMap; @@ -32,4 +32,4 @@ async function initMap() { flightPath.setMap(innerMap); } -void initMap(); +void init(); diff --git a/dist/samples/react-ui-kit-search-nearby/docs/app.tsx b/dist/samples/react-ui-kit-search-nearby/docs/app.tsx index 57058ea42..aecdd60ff 100644 --- a/dist/samples/react-ui-kit-search-nearby/docs/app.tsx +++ b/dist/samples/react-ui-kit-search-nearby/docs/app.tsx @@ -30,8 +30,10 @@ const App = () => ( const PlacesSearchLayout = () => { const [selectedType, setSelectedType] = useState(''); + // eslint-disable-next-line @typescript-eslint/no-explicit-any const [places, setPlaces] = useState([]); - const [selectedPlace, setSelectedPlace] = useState(null); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const [selectedPlace, setSelectedPlace] = useState(null); const placeSearchRef = useRef(null); @@ -88,9 +90,12 @@ const PlacesSearchLayout = () => { interface PlaceSearchControllerProps { placeSearchRef: RefObject; selectedType: string; + // eslint-disable-next-line @typescript-eslint/no-explicit-any setPlaces: (places: any[]) => void; - setSelectedPlace: (place: any | null) => void; - selectedPlace: any | null; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + setSelectedPlace: (place: any) => void; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + selectedPlace: any; } const PlaceSearchController = ({ @@ -105,6 +110,7 @@ const PlaceSearchController = ({ const markerLib = useMapsLibrary('marker'); const geometryLib = useMapsLibrary('geometry'); + // eslint-disable-next-line @typescript-eslint/no-explicit-any const placeRequestRef = useRef(null); const popupMarkerRef = useRef(null); @@ -166,22 +172,28 @@ const PlaceSearchController = ({ const diameter = geometryLib.spherical.computeDistanceBetween(ne, sw); const radius = Math.min(diameter / 2, 50000); + // eslint-disable-next-line @typescript-eslint/no-explicit-any (nearbyRequest as any).maxResultCount = 10; + // eslint-disable-next-line @typescript-eslint/no-explicit-any (nearbyRequest as any).locationRestriction = { center, radius }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any (nearbyRequest as any).includedTypes = [selectedType]; const handleLoad = () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any const newPlaces = (placeSearch as any).places || []; setPlaces(newPlaces); if (newPlaces.length > 0) { const newBounds = new coreLib.LatLngBounds(); newPlaces.forEach( + // eslint-disable-next-line @typescript-eslint/no-explicit-any (p: any) => p.location && newBounds.extend(p.location) ); if (!newBounds.isEmpty()) map.fitBounds(newBounds); } }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any const handleSelect = (event: any) => setSelectedPlace(event.place); placeSearch.addEventListener('gmp-load', handleLoad); diff --git a/dist/samples/react-ui-kit-search-text/docs/app.tsx b/dist/samples/react-ui-kit-search-text/docs/app.tsx index 64554e30e..8f214312d 100644 --- a/dist/samples/react-ui-kit-search-text/docs/app.tsx +++ b/dist/samples/react-ui-kit-search-text/docs/app.tsx @@ -34,8 +34,10 @@ const App = () => ( const PlacesSearchLayout = () => { const [query, setQuery] = useState(''); + // eslint-disable-next-line @typescript-eslint/no-explicit-any const [places, setPlaces] = useState([]); - const [selectedPlace, setSelectedPlace] = useState(null); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const [selectedPlace, setSelectedPlace] = useState(null); const placeSearchRef = useRef(null); const queryInputRef = useRef(null); @@ -94,9 +96,12 @@ const PlacesSearchLayout = () => { interface PlaceSearchControllerProps { placeSearchRef: RefObject; query: string; + // eslint-disable-next-line @typescript-eslint/no-explicit-any setPlaces: (places: any[]) => void; - setSelectedPlace: (place: any | null) => void; - selectedPlace: any | null; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + setSelectedPlace: (place: any) => void; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + selectedPlace: any; } const PlaceSearchController = ({ @@ -110,6 +115,7 @@ const PlaceSearchController = ({ const coreLib = useMapsLibrary('core'); const markerLib = useMapsLibrary('marker'); + // eslint-disable-next-line @typescript-eslint/no-explicit-any const placeRequestRef = useRef(null); const popupMarkerRef = useRef(null); @@ -163,7 +169,9 @@ const PlaceSearchController = ({ const textRequest = document.createElement( 'gmp-place-text-search-request' ); + // eslint-disable-next-line @typescript-eslint/no-explicit-any (textRequest as any).textQuery = query; + // eslint-disable-next-line @typescript-eslint/no-explicit-any (textRequest as any).locationBias = bounds; placeSearch.appendChild(textRequest); @@ -174,16 +182,19 @@ const PlaceSearchController = ({ placeSearchRef.current.appendChild(placeSearch); const handleLoad = () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any const newPlaces = (placeSearch as any).places || []; setPlaces(newPlaces); if (newPlaces.length > 0) { const newBounds = new coreLib.LatLngBounds(); newPlaces.forEach( + // eslint-disable-next-line @typescript-eslint/no-explicit-any (p: any) => p.location && newBounds.extend(p.location) ); if (!newBounds.isEmpty()) map.fitBounds(newBounds); } }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any const handleSelect = (event: any) => setSelectedPlace(event.place); placeSearch.addEventListener('gmp-load', handleLoad); diff --git a/dist/samples/rectangle-event/app/index.ts b/dist/samples/rectangle-event/app/index.ts index ac2b96989..7c6b42691 100644 --- a/dist/samples/rectangle-event/app/index.ts +++ b/dist/samples/rectangle-event/app/index.ts @@ -14,7 +14,7 @@ let innerMap: google.maps.Map; let infoWindow: google.maps.InfoWindow; -async function initMap(): Promise { +async function init(): Promise { const { Rectangle, InfoWindow } = await google.maps.importLibrary('maps'); const mapElement = document.querySelector('gmp-map')!; @@ -67,5 +67,5 @@ function showNewRect() { infoWindow.open(innerMap); } -void initMap(); +void init(); // [END maps_rectangle_event] diff --git a/dist/samples/rectangle-event/docs/index.js b/dist/samples/rectangle-event/docs/index.js index 278e67c57..bf8f31687 100644 --- a/dist/samples/rectangle-event/docs/index.js +++ b/dist/samples/rectangle-event/docs/index.js @@ -15,7 +15,7 @@ let innerMap; let infoWindow; -async function initMap() { +async function init() { const { Rectangle, InfoWindow } = await google.maps.importLibrary('maps'); const mapElement = document.querySelector('gmp-map'); @@ -68,5 +68,5 @@ function showNewRect() { infoWindow.open(innerMap); } -void initMap(); +void init(); // [END maps_rectangle_event] diff --git a/dist/samples/rectangle-event/docs/index.ts b/dist/samples/rectangle-event/docs/index.ts index ac2b96989..7c6b42691 100644 --- a/dist/samples/rectangle-event/docs/index.ts +++ b/dist/samples/rectangle-event/docs/index.ts @@ -14,7 +14,7 @@ let innerMap: google.maps.Map; let infoWindow: google.maps.InfoWindow; -async function initMap(): Promise { +async function init(): Promise { const { Rectangle, InfoWindow } = await google.maps.importLibrary('maps'); const mapElement = document.querySelector('gmp-map')!; @@ -67,5 +67,5 @@ function showNewRect() { infoWindow.open(innerMap); } -void initMap(); +void init(); // [END maps_rectangle_event] diff --git a/dist/samples/rectangle-event/jsfiddle/demo.js b/dist/samples/rectangle-event/jsfiddle/demo.js index 6d82410ee..299d70b8c 100644 --- a/dist/samples/rectangle-event/jsfiddle/demo.js +++ b/dist/samples/rectangle-event/jsfiddle/demo.js @@ -14,7 +14,7 @@ let innerMap; let infoWindow; -async function initMap() { +async function init() { const { Rectangle, InfoWindow } = await google.maps.importLibrary('maps'); const mapElement = document.querySelector('gmp-map'); @@ -67,4 +67,4 @@ function showNewRect() { infoWindow.open(innerMap); } -void initMap(); +void init(); diff --git a/dist/samples/routes-get-alternatives/app/index.ts b/dist/samples/routes-get-alternatives/app/index.ts index 2ce50c488..88ea67482 100644 --- a/dist/samples/routes-get-alternatives/app/index.ts +++ b/dist/samples/routes-get-alternatives/app/index.ts @@ -6,14 +6,14 @@ // [START maps_routes_get_alternatives] let mapPolylines: google.maps.Polyline[] = []; const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; // Initialize and add the map. -async function initMap() { +async function init() { // Request the needed libraries. - const [, { event }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ event }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); innerMap = mapElement.innerMap; @@ -99,5 +99,5 @@ function drawRoute(route, isPrimaryRoute) { ); } -void initMap(); +void init(); // [END maps_routes_get_alternatives] diff --git a/dist/samples/routes-get-alternatives/dist/assets/index-CYpnwxIJ.js b/dist/samples/routes-get-alternatives/dist/assets/index-CYpnwxIJ.js new file mode 100644 index 000000000..dd8b203b1 --- /dev/null +++ b/dist/samples/routes-get-alternatives/dist/assets/index-CYpnwxIJ.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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=[],t=document.querySelector(`gmp-map`),n;async function r(){let[{event:e}]=await Promise.all([google.maps.importLibrary(`core`),google.maps.importLibrary(`maps`)]);n=t.innerMap,n.setOptions({mapTypeControl:!1,mapId:`DEMO_MAP_ID`}),e.addListenerOnce(n,`idle`,()=>{i()})}async function i(){let[{Route:e,RouteLabel:t}]=await Promise.all([google.maps.importLibrary(`routes`)]),r=await e.computeRoutes({origin:`San Francisco, CA`,destination:`Sunset Dr Pacific Grove, CA 93950`,travelMode:`DRIVING`,computeAlternativeRoutes:!0,fields:[`path`,`routeLabels`,`viewport`]});if(!r.routes||r.routes.length===0){console.warn(`No routes found`);return}let i;for(let e of r.routes)e.routeLabels?.includes(t.DEFAULT_ROUTE)?i=e:a(e,!1);i&&(a(i,!0),await i.createWaypointAdvancedMarkers({map:n}),n.fitBounds(i.viewport,50),n.setHeading(70)),console.log(`Response:\n ${JSON.stringify(r,null,2)}`)}function a(t,r){e=e.concat(t.createPolylines({polylineOptions:r?{map:n,strokeWeight:5}:{map:n,strokeColor:`#669DF6`,strokeOpacity:.5,strokeWeight:5},colorScheme:n.get(`colorScheme`)}))}r(); \ No newline at end of file diff --git a/dist/samples/routes-get-alternatives/dist/assets/index-DUkkR9dP.js b/dist/samples/routes-get-alternatives/dist/assets/index-DUkkR9dP.js deleted file mode 100644 index 7b66d776e..000000000 --- a/dist/samples/routes-get-alternatives/dist/assets/index-DUkkR9dP.js +++ /dev/null @@ -1 +0,0 @@ -(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=[],t=document.querySelector(`gmp-map`),n;async function r(){let[,{event:e}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`core`)]);n=t.innerMap,n.setOptions({mapTypeControl:!1,mapId:`DEMO_MAP_ID`}),e.addListenerOnce(n,`idle`,()=>{i()})}async function i(){let[{Route:e,RouteLabel:t}]=await Promise.all([google.maps.importLibrary(`routes`)]),r=await e.computeRoutes({origin:`San Francisco, CA`,destination:`Sunset Dr Pacific Grove, CA 93950`,travelMode:`DRIVING`,computeAlternativeRoutes:!0,fields:[`path`,`routeLabels`,`viewport`]});if(!r.routes||r.routes.length===0){console.warn(`No routes found`);return}let i;for(let e of r.routes)e.routeLabels?.includes(t.DEFAULT_ROUTE)?i=e:a(e,!1);i&&(a(i,!0),await i.createWaypointAdvancedMarkers({map:n}),n.fitBounds(i.viewport,50),n.setHeading(70)),console.log(`Response:\n ${JSON.stringify(r,null,2)}`)}function a(t,r){e=e.concat(t.createPolylines({polylineOptions:r?{map:n,strokeWeight:5}:{map:n,strokeColor:`#669DF6`,strokeOpacity:.5,strokeWeight:5},colorScheme:n.get(`colorScheme`)}))}r(); \ No newline at end of file diff --git a/dist/samples/routes-get-alternatives/dist/index.html b/dist/samples/routes-get-alternatives/dist/index.html index 6ebdc60c6..d362525f0 100644 --- a/dist/samples/routes-get-alternatives/dist/index.html +++ b/dist/samples/routes-get-alternatives/dist/index.html @@ -15,7 +15,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/routes-get-alternatives/docs/index.js b/dist/samples/routes-get-alternatives/docs/index.js index 5a3f6e7a7..96434ccb2 100644 --- a/dist/samples/routes-get-alternatives/docs/index.js +++ b/dist/samples/routes-get-alternatives/docs/index.js @@ -10,11 +10,11 @@ const mapElement = document.querySelector('gmp-map'); let innerMap; // Initialize and add the map. -async function initMap() { +async function init() { // Request the needed libraries. - const [, { event }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ event }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); innerMap = mapElement.innerMap; @@ -100,5 +100,5 @@ function drawRoute(route, isPrimaryRoute) { ); } -void initMap(); +void init(); // [END maps_routes_get_alternatives] diff --git a/dist/samples/routes-get-alternatives/docs/index.ts b/dist/samples/routes-get-alternatives/docs/index.ts index 2ce50c488..88ea67482 100644 --- a/dist/samples/routes-get-alternatives/docs/index.ts +++ b/dist/samples/routes-get-alternatives/docs/index.ts @@ -6,14 +6,14 @@ // [START maps_routes_get_alternatives] let mapPolylines: google.maps.Polyline[] = []; const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; // Initialize and add the map. -async function initMap() { +async function init() { // Request the needed libraries. - const [, { event }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ event }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); innerMap = mapElement.innerMap; @@ -99,5 +99,5 @@ function drawRoute(route, isPrimaryRoute) { ); } -void initMap(); +void init(); // [END maps_routes_get_alternatives] diff --git a/dist/samples/routes-get-alternatives/jsfiddle/demo.js b/dist/samples/routes-get-alternatives/jsfiddle/demo.js index 71d0499e5..7173a79b2 100644 --- a/dist/samples/routes-get-alternatives/jsfiddle/demo.js +++ b/dist/samples/routes-get-alternatives/jsfiddle/demo.js @@ -10,11 +10,11 @@ const mapElement = document.querySelector('gmp-map'); let innerMap; // Initialize and add the map. -async function initMap() { +async function init() { // Request the needed libraries. - const [, { event }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ event }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); innerMap = mapElement.innerMap; @@ -95,4 +95,4 @@ function drawRoute(route, isPrimaryRoute) { ); } -void initMap(); +void init(); diff --git a/dist/samples/routes-get-directions-panel/app/index.ts b/dist/samples/routes-get-directions-panel/app/index.ts index d1e6b6307..3667cf5bb 100644 --- a/dist/samples/routes-get-directions-panel/app/index.ts +++ b/dist/samples/routes-get-directions-panel/app/index.ts @@ -10,7 +10,7 @@ let mapPolylines: google.maps.Polyline[] = []; const center = { lat: 37.447646, lng: -122.113878 }; // Palo Alto, CA // Initialize and add the map. -async function initMap(): Promise { +async function init(): Promise { // Request the needed libraries. const [{ Map }, { Route }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -143,5 +143,5 @@ async function fitMapToPath(path) { map.fitBounds(bounds); } -void initMap(); +void init(); // [END maps_routes_get_directions_panel] diff --git a/dist/samples/routes-get-directions-panel/docs/index.js b/dist/samples/routes-get-directions-panel/docs/index.js index 2a587fd17..034587a13 100644 --- a/dist/samples/routes-get-directions-panel/docs/index.js +++ b/dist/samples/routes-get-directions-panel/docs/index.js @@ -11,7 +11,7 @@ let mapPolylines = []; const center = { lat: 37.447646, lng: -122.113878 }; // Palo Alto, CA // Initialize and add the map. -async function initMap() { +async function init() { // Request the needed libraries. const [{ Map }, { Route }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -144,5 +144,5 @@ async function fitMapToPath(path) { map.fitBounds(bounds); } -void initMap(); +void init(); // [END maps_routes_get_directions_panel] diff --git a/dist/samples/routes-get-directions-panel/docs/index.ts b/dist/samples/routes-get-directions-panel/docs/index.ts index d1e6b6307..3667cf5bb 100644 --- a/dist/samples/routes-get-directions-panel/docs/index.ts +++ b/dist/samples/routes-get-directions-panel/docs/index.ts @@ -10,7 +10,7 @@ let mapPolylines: google.maps.Polyline[] = []; const center = { lat: 37.447646, lng: -122.113878 }; // Palo Alto, CA // Initialize and add the map. -async function initMap(): Promise { +async function init(): Promise { // Request the needed libraries. const [{ Map }, { Route }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -143,5 +143,5 @@ async function fitMapToPath(path) { map.fitBounds(bounds); } -void initMap(); +void init(); // [END maps_routes_get_directions_panel] diff --git a/dist/samples/routes-get-directions-panel/jsfiddle/demo.js b/dist/samples/routes-get-directions-panel/jsfiddle/demo.js index 7c2e26351..b0778f18a 100644 --- a/dist/samples/routes-get-directions-panel/jsfiddle/demo.js +++ b/dist/samples/routes-get-directions-panel/jsfiddle/demo.js @@ -11,7 +11,7 @@ let mapPolylines = []; const center = { lat: 37.447646, lng: -122.113878 }; // Palo Alto, CA // Initialize and add the map. -async function initMap() { +async function init() { // Request the needed libraries. const [{ Map }, { Route }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -143,4 +143,4 @@ async function fitMapToPath(path) { map.fitBounds(bounds); } -void initMap(); +void init(); diff --git a/dist/samples/routes-get-directions/app/index.ts b/dist/samples/routes-get-directions/app/index.ts index 46e256e6b..761cca0bf 100644 --- a/dist/samples/routes-get-directions/app/index.ts +++ b/dist/samples/routes-get-directions/app/index.ts @@ -10,7 +10,7 @@ let mapPolylines: google.maps.Polyline[] = []; const center = { lat: 37.447646, lng: -122.113878 }; // Palo Alto, CA // Initialize and add the map. -async function initMap(): Promise { +async function init(): Promise { // Request the needed libraries. const [{ Map }, { Place }, { Route }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -131,5 +131,5 @@ async function fitMapToPath(path) { map.fitBounds(bounds); } -void initMap(); +void init(); // [END maps_routes_get_directions] diff --git a/dist/samples/routes-get-directions/docs/index.js b/dist/samples/routes-get-directions/docs/index.js index 02502310c..59afbd615 100644 --- a/dist/samples/routes-get-directions/docs/index.js +++ b/dist/samples/routes-get-directions/docs/index.js @@ -11,7 +11,7 @@ let mapPolylines = []; const center = { lat: 37.447646, lng: -122.113878 }; // Palo Alto, CA // Initialize and add the map. -async function initMap() { +async function init() { // Request the needed libraries. const [{ Map }, { Place }, { Route }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -132,5 +132,5 @@ async function fitMapToPath(path) { map.fitBounds(bounds); } -void initMap(); +void init(); // [END maps_routes_get_directions] diff --git a/dist/samples/routes-get-directions/docs/index.ts b/dist/samples/routes-get-directions/docs/index.ts index 46e256e6b..761cca0bf 100644 --- a/dist/samples/routes-get-directions/docs/index.ts +++ b/dist/samples/routes-get-directions/docs/index.ts @@ -10,7 +10,7 @@ let mapPolylines: google.maps.Polyline[] = []; const center = { lat: 37.447646, lng: -122.113878 }; // Palo Alto, CA // Initialize and add the map. -async function initMap(): Promise { +async function init(): Promise { // Request the needed libraries. const [{ Map }, { Place }, { Route }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -131,5 +131,5 @@ async function fitMapToPath(path) { map.fitBounds(bounds); } -void initMap(); +void init(); // [END maps_routes_get_directions] diff --git a/dist/samples/routes-get-directions/jsfiddle/demo.js b/dist/samples/routes-get-directions/jsfiddle/demo.js index 27c388379..5de710efd 100644 --- a/dist/samples/routes-get-directions/jsfiddle/demo.js +++ b/dist/samples/routes-get-directions/jsfiddle/demo.js @@ -11,7 +11,7 @@ let mapPolylines = []; const center = { lat: 37.447646, lng: -122.113878 }; // Palo Alto, CA // Initialize and add the map. -async function initMap() { +async function init() { // Request the needed libraries. const [{ Map }, { Place }, { Route }] = await Promise.all([ google.maps.importLibrary('maps'), @@ -121,4 +121,4 @@ async function fitMapToPath(path) { map.fitBounds(bounds); } -void initMap(); +void init(); diff --git a/dist/samples/routes-markers/app/index.ts b/dist/samples/routes-markers/app/index.ts index 9bd3535d7..6a30f9253 100644 --- a/dist/samples/routes-markers/app/index.ts +++ b/dist/samples/routes-markers/app/index.ts @@ -6,14 +6,14 @@ // [START maps_routes_markers] let mapPolylines: google.maps.Polyline[] = []; const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; // Initialize and add the map. -async function initMap() { +async function init() { // Request the needed libraries. - const [, { event }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ event }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); innerMap = mapElement.innerMap; @@ -73,7 +73,7 @@ async function getDirections() { glyphColor: 'white', background: 'green', borderColor: 'green', - }).element, + }), }; } @@ -87,7 +87,7 @@ async function getDirections() { glyphColor: 'white', background: 'blue', borderColor: 'blue', - }).element, + }), }; } @@ -101,7 +101,7 @@ async function getDirections() { glyphColor: 'white', background: 'red', borderColor: 'red', - }).element, + }), }; } @@ -112,7 +112,7 @@ async function getDirections() { // [END maps_routes_markers_style_maker] // Fit the map to the route. - innerMap.fitBounds(result.routes[0].viewport); + innerMap.fitBounds(result.routes[0].viewport!); innerMap.setHeading(270); // Create polylines and add them to the map. @@ -120,5 +120,5 @@ async function getDirections() { mapPolylines.forEach((polyline) => polyline.setMap(innerMap)); } -void initMap(); +void init(); // [END maps_routes_markers] diff --git a/dist/samples/routes-markers/dist/assets/index-DeGHbAh6.js b/dist/samples/routes-markers/dist/assets/index-DeGHbAh6.js new file mode 100644 index 000000000..11b7c7eda --- /dev/null +++ b/dist/samples/routes-markers/dist/assets/index-DeGHbAh6.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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=[],t=document.querySelector(`gmp-map`),n;async function r(){let[{event:e}]=await Promise.all([google.maps.importLibrary(`core`),google.maps.importLibrary(`maps`)]);n=t.innerMap,n.setOptions({mapTypeControl:!1,mapId:`DEMO_MAP_ID`}),e.addListenerOnce(n,`idle`,()=>{i()})}async function i(){let[{Route:t},{PinElement:r}]=await Promise.all([google.maps.importLibrary(`routes`),google.maps.importLibrary(`marker`)]),i=await t.computeRoutes({origin:`Parking lot, Christmas Tree Point Rd, San Francisco, CA 94131`,destination:`100 Spinnaker Dr, Sausalito, CA 94965`,intermediates:[{location:`300 Finley Rd San Francisco, CA 94129`}],travelMode:`DRIVING`,fields:[`path`,`legs`,`viewport`]});if(!i.routes||i.routes.length===0){console.warn(`No routes found`);return}function a(e,t){let{index:i,totalMarkers:a}=t;return i===0?{...e,map:n,content:new r({glyphText:(i+1).toString(),glyphColor:`white`,background:`green`,borderColor:`green`})}:i===0||i===a-1?i===a-1?{...e,map:n,content:new r({glyphText:(i+1).toString(),glyphColor:`white`,background:`red`,borderColor:`red`})}:{...e,map:n}:{...e,map:n,content:new r({glyphText:(i+1).toString(),glyphColor:`white`,background:`blue`,borderColor:`blue`})}}await i.routes[0].createWaypointAdvancedMarkers(a),n.fitBounds(i.routes[0].viewport),n.setHeading(270),e=i.routes[0].createPolylines(),e.forEach(e=>e.setMap(n))}r(); \ No newline at end of file diff --git a/dist/samples/routes-markers/dist/assets/index-aTlOqFO0.js b/dist/samples/routes-markers/dist/assets/index-aTlOqFO0.js deleted file mode 100644 index 9486d7a52..000000000 --- a/dist/samples/routes-markers/dist/assets/index-aTlOqFO0.js +++ /dev/null @@ -1 +0,0 @@ -(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=[],t=document.querySelector(`gmp-map`),n;async function r(){let[,{event:e}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`core`)]);n=t.innerMap,n.setOptions({mapTypeControl:!1,mapId:`DEMO_MAP_ID`}),e.addListenerOnce(n,`idle`,()=>{i()})}async function i(){let[{Route:t},{PinElement:r}]=await Promise.all([google.maps.importLibrary(`routes`),google.maps.importLibrary(`marker`)]),i=await t.computeRoutes({origin:`Parking lot, Christmas Tree Point Rd, San Francisco, CA 94131`,destination:`100 Spinnaker Dr, Sausalito, CA 94965`,intermediates:[{location:`300 Finley Rd San Francisco, CA 94129`}],travelMode:`DRIVING`,fields:[`path`,`legs`,`viewport`]});if(!i.routes||i.routes.length===0){console.warn(`No routes found`);return}function a(e,t){let{index:i,totalMarkers:a}=t;return i===0?{...e,map:n,content:new r({glyphText:(i+1).toString(),glyphColor:`white`,background:`green`,borderColor:`green`}).element}:i===0||i===a-1?i===a-1?{...e,map:n,content:new r({glyphText:(i+1).toString(),glyphColor:`white`,background:`red`,borderColor:`red`}).element}:{...e,map:n}:{...e,map:n,content:new r({glyphText:(i+1).toString(),glyphColor:`white`,background:`blue`,borderColor:`blue`}).element}}await i.routes[0].createWaypointAdvancedMarkers(a),n.fitBounds(i.routes[0].viewport),n.setHeading(270),e=i.routes[0].createPolylines(),e.forEach(e=>e.setMap(n))}r(); \ No newline at end of file diff --git a/dist/samples/routes-markers/dist/index.html b/dist/samples/routes-markers/dist/index.html index 81053be34..9390e4972 100644 --- a/dist/samples/routes-markers/dist/index.html +++ b/dist/samples/routes-markers/dist/index.html @@ -15,7 +15,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/routes-markers/docs/index.js b/dist/samples/routes-markers/docs/index.js index 6f77d3db5..24bc4eb88 100644 --- a/dist/samples/routes-markers/docs/index.js +++ b/dist/samples/routes-markers/docs/index.js @@ -10,11 +10,11 @@ const mapElement = document.querySelector('gmp-map'); let innerMap; // Initialize and add the map. -async function initMap() { +async function init() { // Request the needed libraries. - const [, { event }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ event }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); innerMap = mapElement.innerMap; @@ -71,7 +71,7 @@ async function getDirections() { glyphColor: 'white', background: 'green', borderColor: 'green', - }).element, + }), }; } @@ -85,7 +85,7 @@ async function getDirections() { glyphColor: 'white', background: 'blue', borderColor: 'blue', - }).element, + }), }; } @@ -99,7 +99,7 @@ async function getDirections() { glyphColor: 'white', background: 'red', borderColor: 'red', - }).element, + }), }; } @@ -118,5 +118,5 @@ async function getDirections() { mapPolylines.forEach((polyline) => polyline.setMap(innerMap)); } -void initMap(); +void init(); // [END maps_routes_markers] diff --git a/dist/samples/routes-markers/docs/index.ts b/dist/samples/routes-markers/docs/index.ts index 9bd3535d7..6a30f9253 100644 --- a/dist/samples/routes-markers/docs/index.ts +++ b/dist/samples/routes-markers/docs/index.ts @@ -6,14 +6,14 @@ // [START maps_routes_markers] let mapPolylines: google.maps.Polyline[] = []; const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; // Initialize and add the map. -async function initMap() { +async function init() { // Request the needed libraries. - const [, { event }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ event }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); innerMap = mapElement.innerMap; @@ -73,7 +73,7 @@ async function getDirections() { glyphColor: 'white', background: 'green', borderColor: 'green', - }).element, + }), }; } @@ -87,7 +87,7 @@ async function getDirections() { glyphColor: 'white', background: 'blue', borderColor: 'blue', - }).element, + }), }; } @@ -101,7 +101,7 @@ async function getDirections() { glyphColor: 'white', background: 'red', borderColor: 'red', - }).element, + }), }; } @@ -112,7 +112,7 @@ async function getDirections() { // [END maps_routes_markers_style_maker] // Fit the map to the route. - innerMap.fitBounds(result.routes[0].viewport); + innerMap.fitBounds(result.routes[0].viewport!); innerMap.setHeading(270); // Create polylines and add them to the map. @@ -120,5 +120,5 @@ async function getDirections() { mapPolylines.forEach((polyline) => polyline.setMap(innerMap)); } -void initMap(); +void init(); // [END maps_routes_markers] diff --git a/dist/samples/routes-markers/jsfiddle/demo.js b/dist/samples/routes-markers/jsfiddle/demo.js index 9efbe52c8..c96f82d66 100644 --- a/dist/samples/routes-markers/jsfiddle/demo.js +++ b/dist/samples/routes-markers/jsfiddle/demo.js @@ -10,11 +10,11 @@ const mapElement = document.querySelector('gmp-map'); let innerMap; // Initialize and add the map. -async function initMap() { +async function init() { // Request the needed libraries. - const [, { event }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ event }] = await Promise.all([ google.maps.importLibrary('core'), + google.maps.importLibrary('maps'), ]); innerMap = mapElement.innerMap; @@ -66,7 +66,7 @@ async function getDirections() { glyphColor: 'white', background: 'green', borderColor: 'green', - }).element, + }), }; } @@ -80,7 +80,7 @@ async function getDirections() { glyphColor: 'white', background: 'blue', borderColor: 'blue', - }).element, + }), }; } @@ -94,7 +94,7 @@ async function getDirections() { glyphColor: 'white', background: 'red', borderColor: 'red', - }).element, + }), }; } @@ -112,4 +112,4 @@ async function getDirections() { mapPolylines.forEach((polyline) => polyline.setMap(innerMap)); } -void initMap(); +void init(); diff --git a/dist/samples/routes-route-matrix/app/index.ts b/dist/samples/routes-route-matrix/app/index.ts index 2e8ac2058..313af0a35 100644 --- a/dist/samples/routes-route-matrix/app/index.ts +++ b/dist/samples/routes-route-matrix/app/index.ts @@ -9,7 +9,7 @@ let map; const markers: google.maps.marker.AdvancedMarkerElement[] = []; const center = { lat: 51.55, lng: -1.8 }; -async function initMap(): Promise { +async function init(): Promise { // Request the needed libraries. const [ { Map }, @@ -111,7 +111,7 @@ async function initMap(): Promise { const marker = new AdvancedMarkerElement({ map, position: destination.location, - content: pin.element, + content: pin, title: `Destination: ${destination.displayName}`, }); @@ -124,5 +124,5 @@ async function initMap(): Promise { map.fitBounds(bounds); } -void initMap(); +void init(); // [END maps_routes_route_matrix] diff --git a/dist/samples/routes-route-matrix/dist/assets/index-TqnnJovY.js b/dist/samples/routes-route-matrix/dist/assets/index-BP2Te6Po.js similarity index 93% rename from dist/samples/routes-route-matrix/dist/assets/index-TqnnJovY.js rename to dist/samples/routes-route-matrix/dist/assets/index-BP2Te6Po.js index bdbe324e1..bd0ce6c39 100644 --- a/dist/samples/routes-route-matrix/dist/assets/index-TqnnJovY.js +++ b/dist/samples/routes-route-matrix/dist/assets/index-BP2Te6Po.js @@ -1 +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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e,t=[],n={lat:51.55,lng:-1.8};async function r(){let[{Map:r},{Place:i},{AdvancedMarkerElement:a,PinElement:o},{RouteMatrix:s},{LatLngBounds:c,UnitSystem:l}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`places`),google.maps.importLibrary(`marker`),google.maps.importLibrary(`routes`),google.maps.importLibrary(`core`)]),u=new c;e=new r(document.getElementById(`map`),{zoom:8,center:n,mapId:`DEMO_MAP_ID`});let d=new i({id:`ChIJ83WZp86p2EcRbMrkYqGncBQ`}),f=new i({id:`ChIJCSkVvleJc0gR8HHaTGpajKc`}),p=new i({id:`ChIJYdizgWaDcUgRH9eaSy6y5I4`}),m=new i({id:`ChIJ9VPsNNQCbkgRDmeGZdsGNBQ`});await Promise.all([d.fetchFields({fields:[`location`,`displayName`]}),f.fetchFields({fields:[`location`,`displayName`]}),p.fetchFields({fields:[`location`,`displayName`]}),m.fetchFields({fields:[`location`,`displayName`]})]);let h=[p,m],g=[d,f],_={origins:g,destinations:h,travelMode:`DRIVING`,units:l.METRIC,fields:[`distanceMeters`,`durationMillis`,`condition`]};document.getElementById(`request`).innerText=JSON.stringify(_,null,2);let v=await s.computeRouteMatrix(_);document.getElementById(`response`).innerText=JSON.stringify(v,null,2);for(let n of g)if(n.location){let r=new o({glyphText:`O`,glyphColor:`white`,background:`#137333`,borderColor:`white`}),i=new a({map:e,position:n.location,title:`Origin: ${n.displayName}`});i.append(r),t.push(i),u.extend(n.location)}for(let n=0;n{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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e,t=[],n={lat:51.55,lng:-1.8};async function r(){let[{Map:r},{Place:i},{AdvancedMarkerElement:a,PinElement:o},{RouteMatrix:s},{LatLngBounds:c,UnitSystem:l}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`places`),google.maps.importLibrary(`marker`),google.maps.importLibrary(`routes`),google.maps.importLibrary(`core`)]),u=new c;e=new r(document.getElementById(`map`),{zoom:8,center:n,mapId:`DEMO_MAP_ID`});let d=new i({id:`ChIJ83WZp86p2EcRbMrkYqGncBQ`}),f=new i({id:`ChIJCSkVvleJc0gR8HHaTGpajKc`}),p=new i({id:`ChIJYdizgWaDcUgRH9eaSy6y5I4`}),m=new i({id:`ChIJ9VPsNNQCbkgRDmeGZdsGNBQ`});await Promise.all([d.fetchFields({fields:[`location`,`displayName`]}),f.fetchFields({fields:[`location`,`displayName`]}),p.fetchFields({fields:[`location`,`displayName`]}),m.fetchFields({fields:[`location`,`displayName`]})]);let h=[p,m],g=[d,f],_={origins:g,destinations:h,travelMode:`DRIVING`,units:l.METRIC,fields:[`distanceMeters`,`durationMillis`,`condition`]};document.getElementById(`request`).innerText=JSON.stringify(_,null,2);let v=await s.computeRouteMatrix(_);document.getElementById(`response`).innerText=JSON.stringify(v,null,2);for(let n of g)if(n.location){let r=new o({glyphText:`O`,glyphColor:`white`,background:`#137333`,borderColor:`white`}),i=new a({map:e,position:n.location,title:`Origin: ${n.displayName}`});i.append(r),t.push(i),u.extend(n.location)}for(let n=0;n - + diff --git a/dist/samples/routes-route-matrix/docs/index.js b/dist/samples/routes-route-matrix/docs/index.js index b4908f100..467375c11 100644 --- a/dist/samples/routes-route-matrix/docs/index.js +++ b/dist/samples/routes-route-matrix/docs/index.js @@ -10,7 +10,7 @@ let map; const markers = []; const center = { lat: 51.55, lng: -1.8 }; -async function initMap() { +async function init() { // Request the needed libraries. const [ { Map }, @@ -118,7 +118,7 @@ async function initMap() { const marker = new AdvancedMarkerElement({ map, position: destination.location, - content: pin.element, + content: pin, title: `Destination: ${destination.displayName}`, }); @@ -131,5 +131,5 @@ async function initMap() { map.fitBounds(bounds); } -void initMap(); +void init(); // [END maps_routes_route_matrix] diff --git a/dist/samples/routes-route-matrix/docs/index.ts b/dist/samples/routes-route-matrix/docs/index.ts index 2e8ac2058..313af0a35 100644 --- a/dist/samples/routes-route-matrix/docs/index.ts +++ b/dist/samples/routes-route-matrix/docs/index.ts @@ -9,7 +9,7 @@ let map; const markers: google.maps.marker.AdvancedMarkerElement[] = []; const center = { lat: 51.55, lng: -1.8 }; -async function initMap(): Promise { +async function init(): Promise { // Request the needed libraries. const [ { Map }, @@ -111,7 +111,7 @@ async function initMap(): Promise { const marker = new AdvancedMarkerElement({ map, position: destination.location, - content: pin.element, + content: pin, title: `Destination: ${destination.displayName}`, }); @@ -124,5 +124,5 @@ async function initMap(): Promise { map.fitBounds(bounds); } -void initMap(); +void init(); // [END maps_routes_route_matrix] diff --git a/dist/samples/routes-route-matrix/jsfiddle/demo.js b/dist/samples/routes-route-matrix/jsfiddle/demo.js index 92120987d..48ebbf498 100644 --- a/dist/samples/routes-route-matrix/jsfiddle/demo.js +++ b/dist/samples/routes-route-matrix/jsfiddle/demo.js @@ -10,7 +10,7 @@ let map; const markers = []; const center = { lat: 51.55, lng: -1.8 }; -async function initMap() { +async function init() { // Request the needed libraries. const [ { Map }, @@ -116,7 +116,7 @@ async function initMap() { const marker = new AdvancedMarkerElement({ map, position: destination.location, - content: pin.element, + content: pin, title: `Destination: ${destination.displayName}`, }); @@ -129,4 +129,4 @@ async function initMap() { map.fitBounds(bounds); } -void initMap(); +void init(); diff --git a/dist/samples/streetview-overlays/app/index.ts b/dist/samples/streetview-overlays/app/index.ts index bb071be2e..58e7069ad 100644 --- a/dist/samples/streetview-overlays/app/index.ts +++ b/dist/samples/streetview-overlays/app/index.ts @@ -8,11 +8,11 @@ let panorama: google.maps.StreetViewPanorama; let innerMap: google.maps.Map; -async function initMap() { +async function init() { // Request needed libraries. - const [, { Marker }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ Marker }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); // Set the location of Astor Place. @@ -77,5 +77,5 @@ function toggleStreetView(): void { } } -void initMap(); +void init(); // [END maps_streetview_overlays] diff --git a/dist/samples/streetview-overlays/dist/assets/index-BdpLipIk.js b/dist/samples/streetview-overlays/dist/assets/index-BdpLipIk.js deleted file mode 100644 index d59e1a6d3..000000000 --- a/dist/samples/streetview-overlays/dist/assets/index-BdpLipIk.js +++ /dev/null @@ -1 +0,0 @@ -(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e,t;async function n(){let[,{Marker:n}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`marker`)]),i={lat:40.729884,lng:-73.990988};t=document.querySelector(`gmp-map`).innerMap,document.getElementById(`streetview-toggle-button`).addEventListener(`click`,r);let a=document.createElement(`img`);a.src=new URL(``+new URL(`../cafe_icon.svg`,import.meta.url).href,``+import.meta.url).href;let o=document.createElement(`img`);o.src=new URL(``+new URL(`../bank_icon.svg`,import.meta.url).href,``+import.meta.url).href;let s=document.createElement(`img`);s.src=new URL(``+new URL(`../bus_icon.svg`,import.meta.url).href,``+import.meta.url).href,new n({position:{lat:40.730031,lng:-73.991428},map:t,title:`Cafe`,icon:a.src}),new n({position:{lat:40.729681,lng:-73.991138},map:t,title:`Bank`,icon:o.src}),new n({position:{lat:40.729559,lng:-73.990741},map:t,title:`Bus Stop`,icon:s.src}),e=t.getStreetView(),e.setPosition(i),e.setPov({heading:265,pitch:0})}function r(){e.getVisible()==0?e.setVisible(!0):e.setVisible(!1)}n(); \ No newline at end of file diff --git a/dist/samples/streetview-overlays/dist/assets/index-tP85ksEQ.js b/dist/samples/streetview-overlays/dist/assets/index-tP85ksEQ.js new file mode 100644 index 000000000..5bbbd7c44 --- /dev/null +++ b/dist/samples/streetview-overlays/dist/assets/index-tP85ksEQ.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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e,t;async function n(){let[{Marker:n}]=await Promise.all([google.maps.importLibrary(`marker`),google.maps.importLibrary(`maps`)]),i={lat:40.729884,lng:-73.990988};t=document.querySelector(`gmp-map`).innerMap,document.getElementById(`streetview-toggle-button`).addEventListener(`click`,r);let a=document.createElement(`img`);a.src=new URL(``+new URL(`../cafe_icon.svg`,import.meta.url).href,``+import.meta.url).href;let o=document.createElement(`img`);o.src=new URL(``+new URL(`../bank_icon.svg`,import.meta.url).href,``+import.meta.url).href;let s=document.createElement(`img`);s.src=new URL(``+new URL(`../bus_icon.svg`,import.meta.url).href,``+import.meta.url).href,new n({position:{lat:40.730031,lng:-73.991428},map:t,title:`Cafe`,icon:a.src}),new n({position:{lat:40.729681,lng:-73.991138},map:t,title:`Bank`,icon:o.src}),new n({position:{lat:40.729559,lng:-73.990741},map:t,title:`Bus Stop`,icon:s.src}),e=t.getStreetView(),e.setPosition(i),e.setPov({heading:265,pitch:0})}function r(){e.getVisible()==0?e.setVisible(!0):e.setVisible(!1)}n(); \ No newline at end of file diff --git a/dist/samples/streetview-overlays/dist/index.html b/dist/samples/streetview-overlays/dist/index.html index eaab09cbc..596ea8360 100644 --- a/dist/samples/streetview-overlays/dist/index.html +++ b/dist/samples/streetview-overlays/dist/index.html @@ -15,7 +15,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/streetview-overlays/docs/index.js b/dist/samples/streetview-overlays/docs/index.js index 8b9f64131..e8b1fc80f 100644 --- a/dist/samples/streetview-overlays/docs/index.js +++ b/dist/samples/streetview-overlays/docs/index.js @@ -8,11 +8,11 @@ let panorama; let innerMap; -async function initMap() { +async function init() { // Request needed libraries. - const [, { Marker }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ Marker }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); // Set the location of Astor Place. @@ -77,6 +77,6 @@ function toggleStreetView() { } } -void initMap(); +void init(); export {}; // [END maps_streetview_overlays] diff --git a/dist/samples/streetview-overlays/docs/index.ts b/dist/samples/streetview-overlays/docs/index.ts index bb071be2e..58e7069ad 100644 --- a/dist/samples/streetview-overlays/docs/index.ts +++ b/dist/samples/streetview-overlays/docs/index.ts @@ -8,11 +8,11 @@ let panorama: google.maps.StreetViewPanorama; let innerMap: google.maps.Map; -async function initMap() { +async function init() { // Request needed libraries. - const [, { Marker }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ Marker }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); // Set the location of Astor Place. @@ -77,5 +77,5 @@ function toggleStreetView(): void { } } -void initMap(); +void init(); // [END maps_streetview_overlays] diff --git a/dist/samples/streetview-overlays/jsfiddle/demo.js b/dist/samples/streetview-overlays/jsfiddle/demo.js index 508c22689..7b1cd378b 100644 --- a/dist/samples/streetview-overlays/jsfiddle/demo.js +++ b/dist/samples/streetview-overlays/jsfiddle/demo.js @@ -7,11 +7,11 @@ let panorama; let innerMap; -async function initMap() { +async function init() { // Request needed libraries. - const [, { Marker }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ Marker }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); // Set the location of Astor Place. @@ -76,5 +76,5 @@ function toggleStreetView() { } } -void initMap(); +void init(); export {}; diff --git a/dist/samples/test-example/app/index.ts b/dist/samples/test-example/app/index.ts index 175acc0a0..be95543ea 100644 --- a/dist/samples/test-example/app/index.ts +++ b/dist/samples/test-example/app/index.ts @@ -13,15 +13,15 @@ // [START maps_test_example] // Declare the gmp-map element. const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; let center; -async function initMap() { +async function init() { // [START maps_test_example_instantiate_map] // Request the needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); // Get the inner map from the gmp-map element. @@ -47,5 +47,5 @@ async function initMap() { console.log("Say there Mac, why'd you choose me to test this change?"); // [END maps_test_example_why_me] } -void initMap(); +void init(); // [END maps_test_example] diff --git a/dist/samples/test-example/dist/assets/index-C8mA1EpW.js b/dist/samples/test-example/dist/assets/index-XpYzCYeX.js similarity index 66% rename from dist/samples/test-example/dist/assets/index-C8mA1EpW.js rename to dist/samples/test-example/dist/assets/index-XpYzCYeX.js index ed87b9aeb..7f6e7999e 100644 --- a/dist/samples/test-example/dist/assets/index-C8mA1EpW.js +++ b/dist/samples/test-example/dist/assets/index-XpYzCYeX.js @@ -1 +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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=document.querySelector(`gmp-map`),t,n;async function r(){let[,{AdvancedMarkerElement:r}]=await Promise.all([google.maps.importLibrary(`maps`),google.maps.importLibrary(`marker`)]);t=e.innerMap,t.setOptions({mapTypeControl:!1}),n=t.getCenter(),new r({map:t,position:n,title:`Uluru`}),console.log(`Say there Mac, why'd you choose me to test this change?`)}r(); \ No newline at end of file +(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=document.querySelector(`gmp-map`),t,n;async function r(){let[{AdvancedMarkerElement:r}]=await Promise.all([google.maps.importLibrary(`marker`),google.maps.importLibrary(`maps`)]);t=e.innerMap,t.setOptions({mapTypeControl:!1}),n=t.getCenter(),new r({map:t,position:n,title:`Uluru`}),console.log(`Say there Mac, why'd you choose me to test this change?`)}r(); \ No newline at end of file diff --git a/dist/samples/test-example/dist/index.html b/dist/samples/test-example/dist/index.html index ed03441a5..63a00d2f0 100644 --- a/dist/samples/test-example/dist/index.html +++ b/dist/samples/test-example/dist/index.html @@ -17,7 +17,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/test-example/docs/index.js b/dist/samples/test-example/docs/index.js index 558c92783..7a6839f05 100644 --- a/dist/samples/test-example/docs/index.js +++ b/dist/samples/test-example/docs/index.js @@ -17,12 +17,12 @@ const mapElement = document.querySelector('gmp-map'); let innerMap; let center; -async function initMap() { +async function init() { // [START maps_test_example_instantiate_map] // Request the needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); // Get the inner map from the gmp-map element. @@ -48,5 +48,5 @@ async function initMap() { console.log("Say there Mac, why'd you choose me to test this change?"); // [END maps_test_example_why_me] } -void initMap(); +void init(); // [END maps_test_example] diff --git a/dist/samples/test-example/docs/index.ts b/dist/samples/test-example/docs/index.ts index 175acc0a0..be95543ea 100644 --- a/dist/samples/test-example/docs/index.ts +++ b/dist/samples/test-example/docs/index.ts @@ -13,15 +13,15 @@ // [START maps_test_example] // Declare the gmp-map element. const mapElement = document.querySelector('gmp-map')!; -let innerMap; +let innerMap: google.maps.Map; let center; -async function initMap() { +async function init() { // [START maps_test_example_instantiate_map] // Request the needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); // Get the inner map from the gmp-map element. @@ -47,5 +47,5 @@ async function initMap() { console.log("Say there Mac, why'd you choose me to test this change?"); // [END maps_test_example_why_me] } -void initMap(); +void init(); // [END maps_test_example] diff --git a/dist/samples/test-example/jsfiddle/demo.js b/dist/samples/test-example/jsfiddle/demo.js index 0eb405fdb..c92bd8862 100644 --- a/dist/samples/test-example/jsfiddle/demo.js +++ b/dist/samples/test-example/jsfiddle/demo.js @@ -16,11 +16,11 @@ const mapElement = document.querySelector('gmp-map'); let innerMap; let center; -async function initMap() { +async function init() { // Request the needed libraries. - const [, { AdvancedMarkerElement }] = await Promise.all([ - google.maps.importLibrary('maps'), + const [{ AdvancedMarkerElement }] = await Promise.all([ google.maps.importLibrary('marker'), + google.maps.importLibrary('maps'), ]); // Get the inner map from the gmp-map element. @@ -41,4 +41,4 @@ async function initMap() { console.log("Say there Mac, why'd you choose me to test this change?"); } -void initMap(); +void init(); diff --git a/dist/samples/ui-kit-place-details-compact/app/index.ts b/dist/samples/ui-kit-place-details-compact/app/index.ts index 29fdf5227..632bde1d4 100644 --- a/dist/samples/ui-kit-place-details-compact/app/index.ts +++ b/dist/samples/ui-kit-place-details-compact/app/index.ts @@ -13,7 +13,7 @@ const placeDetailsRequest = document.querySelector( )!; const marker = document.querySelector('gmp-advanced-marker')!; /* [END maps_ui_kit_place_details_compact_query_selector] */ -async function initMap(): Promise { +async function init(): Promise { // Request needed libraries. void Promise.all([ google.maps.importLibrary('marker'), @@ -70,5 +70,5 @@ async function initMap(): Promise { }); } /* [END maps_ui_kit_place_details_compact_event] */ -void initMap(); +void init(); /* [END maps_ui_kit_place_details_compact] */ diff --git a/dist/samples/ui-kit-place-details-compact/docs/index.js b/dist/samples/ui-kit-place-details-compact/docs/index.js index 7c9dbb4bb..34c4300c3 100644 --- a/dist/samples/ui-kit-place-details-compact/docs/index.js +++ b/dist/samples/ui-kit-place-details-compact/docs/index.js @@ -14,7 +14,7 @@ const placeDetailsRequest = document.querySelector( ); const marker = document.querySelector('gmp-advanced-marker'); /* [END maps_ui_kit_place_details_compact_query_selector] */ -async function initMap() { +async function init() { // Request needed libraries. void Promise.all([ google.maps.importLibrary('marker'), @@ -71,5 +71,5 @@ async function initMap() { }); } /* [END maps_ui_kit_place_details_compact_event] */ -void initMap(); +void init(); /* [END maps_ui_kit_place_details_compact] */ diff --git a/dist/samples/ui-kit-place-details-compact/docs/index.ts b/dist/samples/ui-kit-place-details-compact/docs/index.ts index 29fdf5227..632bde1d4 100644 --- a/dist/samples/ui-kit-place-details-compact/docs/index.ts +++ b/dist/samples/ui-kit-place-details-compact/docs/index.ts @@ -13,7 +13,7 @@ const placeDetailsRequest = document.querySelector( )!; const marker = document.querySelector('gmp-advanced-marker')!; /* [END maps_ui_kit_place_details_compact_query_selector] */ -async function initMap(): Promise { +async function init(): Promise { // Request needed libraries. void Promise.all([ google.maps.importLibrary('marker'), @@ -70,5 +70,5 @@ async function initMap(): Promise { }); } /* [END maps_ui_kit_place_details_compact_event] */ -void initMap(); +void init(); /* [END maps_ui_kit_place_details_compact] */ diff --git a/dist/samples/ui-kit-place-details-compact/jsfiddle/demo.js b/dist/samples/ui-kit-place-details-compact/jsfiddle/demo.js index d581e3040..e32e36e32 100644 --- a/dist/samples/ui-kit-place-details-compact/jsfiddle/demo.js +++ b/dist/samples/ui-kit-place-details-compact/jsfiddle/demo.js @@ -14,7 +14,7 @@ const placeDetailsRequest = document.querySelector( ); const marker = document.querySelector('gmp-advanced-marker'); -async function initMap() { +async function init() { // Request needed libraries. void Promise.all([ google.maps.importLibrary('marker'), @@ -70,4 +70,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/ui-kit-place-details/app/index.ts b/dist/samples/ui-kit-place-details/app/index.ts index 4570b2d86..ad5a2ef0e 100644 --- a/dist/samples/ui-kit-place-details/app/index.ts +++ b/dist/samples/ui-kit-place-details/app/index.ts @@ -14,7 +14,7 @@ const placeDetailsRequest = document.querySelector( const marker = document.querySelector('gmp-advanced-marker')!; /* [END maps_ui_kit_place_details_query_selector] */ -async function initMap(): Promise { +async function init(): Promise { // Request needed libraries. await Promise.all([ google.maps.importLibrary('maps'), @@ -59,5 +59,5 @@ async function initMap(): Promise { } /* [END maps_ui_kit_place_details_event] */ -void initMap(); +void init(); /* [END maps_ui_kit_place_details] */ diff --git a/dist/samples/ui-kit-place-details/docs/index.js b/dist/samples/ui-kit-place-details/docs/index.js index 940f87bad..4d530d13c 100644 --- a/dist/samples/ui-kit-place-details/docs/index.js +++ b/dist/samples/ui-kit-place-details/docs/index.js @@ -15,7 +15,7 @@ const placeDetailsRequest = document.querySelector( const marker = document.querySelector('gmp-advanced-marker'); /* [END maps_ui_kit_place_details_query_selector] */ -async function initMap() { +async function init() { // Request needed libraries. await Promise.all([ google.maps.importLibrary('maps'), @@ -60,5 +60,5 @@ async function initMap() { } /* [END maps_ui_kit_place_details_event] */ -void initMap(); +void init(); /* [END maps_ui_kit_place_details] */ diff --git a/dist/samples/ui-kit-place-details/docs/index.ts b/dist/samples/ui-kit-place-details/docs/index.ts index 4570b2d86..ad5a2ef0e 100644 --- a/dist/samples/ui-kit-place-details/docs/index.ts +++ b/dist/samples/ui-kit-place-details/docs/index.ts @@ -14,7 +14,7 @@ const placeDetailsRequest = document.querySelector( const marker = document.querySelector('gmp-advanced-marker')!; /* [END maps_ui_kit_place_details_query_selector] */ -async function initMap(): Promise { +async function init(): Promise { // Request needed libraries. await Promise.all([ google.maps.importLibrary('maps'), @@ -59,5 +59,5 @@ async function initMap(): Promise { } /* [END maps_ui_kit_place_details_event] */ -void initMap(); +void init(); /* [END maps_ui_kit_place_details] */ diff --git a/dist/samples/ui-kit-place-details/jsfiddle/demo.js b/dist/samples/ui-kit-place-details/jsfiddle/demo.js index ad1357e5c..7a379d5fd 100644 --- a/dist/samples/ui-kit-place-details/jsfiddle/demo.js +++ b/dist/samples/ui-kit-place-details/jsfiddle/demo.js @@ -14,7 +14,7 @@ const placeDetailsRequest = document.querySelector( ); const marker = document.querySelector('gmp-advanced-marker'); -async function initMap() { +async function init() { // Request needed libraries. await Promise.all([ google.maps.importLibrary('maps'), @@ -57,4 +57,4 @@ async function initMap() { }); } -void initMap(); +void init(); diff --git a/dist/samples/ui-kit-place-search-nearby/app/index.ts b/dist/samples/ui-kit-place-search-nearby/app/index.ts index 682ad47c2..510425248 100644 --- a/dist/samples/ui-kit-place-search-nearby/app/index.ts +++ b/dist/samples/ui-kit-place-search-nearby/app/index.ts @@ -48,8 +48,8 @@ async function init(): Promise { // Add event listeners to the type select and place search elements. typeSelect.addEventListener('change', () => searchPlaces()); - placeSearch.addEventListener('gmp-select', (event: Event) => { - const { place } = event as any; + placeSearch.addEventListener('gmp-select', (event) => { + const { place } = event; markers.get(place.id)?.click(); }); placeSearch.addEventListener('gmp-load', () => { diff --git a/dist/samples/ui-kit-place-search-nearby/docs/index.ts b/dist/samples/ui-kit-place-search-nearby/docs/index.ts index 682ad47c2..510425248 100644 --- a/dist/samples/ui-kit-place-search-nearby/docs/index.ts +++ b/dist/samples/ui-kit-place-search-nearby/docs/index.ts @@ -48,8 +48,8 @@ async function init(): Promise { // Add event listeners to the type select and place search elements. typeSelect.addEventListener('change', () => searchPlaces()); - placeSearch.addEventListener('gmp-select', (event: Event) => { - const { place } = event as any; + placeSearch.addEventListener('gmp-select', (event) => { + const { place } = event; markers.get(place.id)?.click(); }); placeSearch.addEventListener('gmp-load', () => { diff --git a/dist/samples/ui-kit-place-search-text/app/index.ts b/dist/samples/ui-kit-place-search-text/app/index.ts index 896190769..0ff4fd78c 100644 --- a/dist/samples/ui-kit-place-search-text/app/index.ts +++ b/dist/samples/ui-kit-place-search-text/app/index.ts @@ -54,8 +54,8 @@ async function init(): Promise { } }); - placeSearch.addEventListener('gmp-select', (event: Event) => { - const { place } = event as any; + placeSearch.addEventListener('gmp-select', (event) => { + const { place } = event; markers.get(place.id)?.click(); }); placeSearch.addEventListener('gmp-load', () => { diff --git a/dist/samples/ui-kit-place-search-text/docs/index.ts b/dist/samples/ui-kit-place-search-text/docs/index.ts index 896190769..0ff4fd78c 100644 --- a/dist/samples/ui-kit-place-search-text/docs/index.ts +++ b/dist/samples/ui-kit-place-search-text/docs/index.ts @@ -54,8 +54,8 @@ async function init(): Promise { } }); - placeSearch.addEventListener('gmp-select', (event: Event) => { - const { place } = event as any; + placeSearch.addEventListener('gmp-select', (event) => { + const { place } = event; markers.get(place.id)?.click(); }); placeSearch.addEventListener('gmp-load', () => { diff --git a/dist/samples/weather-api-current-compact/app/index.ts b/dist/samples/weather-api-current-compact/app/index.ts index c8c51771a..836daa2e8 100644 --- a/dist/samples/weather-api-current-compact/app/index.ts +++ b/dist/samples/weather-api-current-compact/app/index.ts @@ -18,7 +18,7 @@ let activeWeatherWidget: SimpleWeatherWidget | null = null; // To keep track of let allMarkers: google.maps.marker.AdvancedMarkerElement[] = []; // To store all active markers let markersLoaded = false; // Flag to track if button markers are loaded -async function initMap(): Promise { +async function init(): Promise { void google.maps.importLibrary('marker'); // preload const { Map } = await google.maps.importLibrary('maps'); @@ -77,7 +77,7 @@ async function initMap(): Promise { activeWidgetContainer.classList.remove('highlight'); // Find the marker associated with the active widget and reset its zIndex const activeMarker = allMarkers.find( - (marker) => marker.content === activeWeatherWidget + (marker) => marker.firstElementChild === activeWeatherWidget ); if (activeMarker) { activeMarker.zIndex = null; @@ -87,6 +87,7 @@ async function initMap(): Promise { // Remove the previous dynamic marker if it exists const currentDynamicMarkerIndex = allMarkers.findIndex( + // eslint-disable-next-line @typescript-eslint/no-explicit-any (marker) => (marker as any).markerType === 'dynamic' ); if (currentDynamicMarkerIndex !== -1) { @@ -133,12 +134,13 @@ async function createAndAddMarker( const marker = new AdvancedMarkerElement({ map: map, position: { lat: location.lat, lng: location.lng }, - content: weatherWidget, title: location.name, // Add a title for accessibility gmpClickable: true, }); + marker.append(weatherWidget); // Store the marker type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (marker as any).markerType = markerType; // Fetch and update weather data for this location @@ -163,7 +165,7 @@ async function createAndAddMarker( activeWidgetContainer.classList.remove('highlight'); // Find the marker associated with the active widget and reset its zIndex const activeMarker = allMarkers.find( - (marker) => marker.content === activeWeatherWidget + (e) => e.firstElementChild === activeWeatherWidget ); if (activeMarker) { activeMarker.zIndex = null; @@ -234,8 +236,7 @@ async function toggleDarkMode() { for (const marker of markersToReAdd) { marker.map = map; // Add marker to the new map - const weatherWidget = marker.content as SimpleWeatherWidget; - const mapContainer = document.getElementById('map') as HTMLElement; // Re-get map container + const weatherWidget = marker.firstElementChild as SimpleWeatherWidget; if (mapContainer.classList.contains('dark-mode')) { weatherWidget.setMode('dark'); } else { @@ -276,7 +277,7 @@ async function toggleDarkMode() { activeWidgetContainer.classList.remove('highlight'); // Find the marker associated with the active widget and reset its zIndex const activeMarker = allMarkers.find( - (marker) => marker.content === activeWeatherWidget + (marker) => marker.firstElementChild === activeWeatherWidget ); if (activeMarker) { activeMarker.zIndex = null; @@ -286,6 +287,7 @@ async function toggleDarkMode() { // Remove the previous dynamic marker if it exists const currentDynamicMarkerIndex = allMarkers.findIndex( + // eslint-disable-next-line @typescript-eslint/no-explicit-any (marker) => (marker as any).markerType === 'dynamic' ); if (currentDynamicMarkerIndex !== -1) { @@ -329,7 +331,8 @@ function removeButtonMarkers(): void { if (activeWeatherWidget) { const buttonMarker = allMarkers.find( (marker) => - marker.content === activeWeatherWidget && + marker.firstElementChild === activeWeatherWidget && + // eslint-disable-next-line @typescript-eslint/no-explicit-any (marker as any).markerType === 'button' ); if (buttonMarker) { @@ -350,6 +353,7 @@ function removeButtonMarkers(): void { // Remove button markers from the map and the allMarkers array const markersToRemove = allMarkers.filter( + // eslint-disable-next-line @typescript-eslint/no-explicit-any (marker) => (marker as any).markerType === 'button' ); markersToRemove.forEach((marker) => { @@ -397,7 +401,7 @@ async function updateWeatherDisplayForMarker( } } -void initMap(); +void init(); // Wait for the custom element to be defined before adding the event listener void customElements.whenDefined('simple-weather-widget').then(() => { diff --git a/dist/samples/weather-api-current-compact/dist/assets/index-B5PxTHrN.js b/dist/samples/weather-api-current-compact/dist/assets/index-1mvsB7xh.js similarity index 72% rename from dist/samples/weather-api-current-compact/dist/assets/index-B5PxTHrN.js rename to dist/samples/weather-api-current-compact/dist/assets/index-1mvsB7xh.js index 619dc5033..81431a801 100644 --- a/dist/samples/weather-api-current-compact/dist/assets/index-B5PxTHrN.js +++ b/dist/samples/weather-api-current-compact/dist/assets/index-1mvsB7xh.js @@ -143,4 +143,4 @@ - `}set data(e){let t=this.shadowRoot.getElementById(`condition-icon`),n=this.shadowRoot.getElementById(`temperature`),r=this.shadowRoot.getElementById(`rain-probability`),i=this.shadowRoot.getElementById(`rain-qpf`),a=this.shadowRoot.getElementById(`rain-details`);if(!e||e.error){t.style.display=`none`,a.style.display=`none`,e&&e.error?(n.textContent=e.error,n.classList.add(`error-message`)):(n.textContent=`N/A`,n.classList.remove(`error-message`));return}let o=e.daytimeForecast||e.nighttimeForecast,s,c,l,u;if(o){let t=e;s=t.maxTemperature?.degrees,c=t.daytimeForecast?.weatherCondition?.iconBaseUri||t.nighttimeForecast?.weatherCondition?.iconBaseUri,l=t.precipitation?.probability?.percent,u=t.precipitation?.qpf?.quantity}else{let t=e;s=t.temperature?.degrees,c=t.weatherCondition?.iconBaseUri,l=t.precipitation?.probability?.percent,u=t.currentConditionsHistory?.qpf?.quantity===void 0?t.precipitation?.qpf?.quantity:t.currentConditionsHistory.qpf.quantity}let d=``;d=c?`${c}.svg`:`/icons/cloud-cover-white.svg`,t.style.display=`none`,t.onload=()=>{t.style.display=`inline-block`},t.onerror=()=>{console.error(`Failed to load weather icon:`,d),t.style.display=`none`},t.src=d,n.textContent=`${s===void 0?`N/A`:s.toFixed(0)}°C`,n.classList.remove(`error-message`),l==null?r.textContent=`0%`:r.textContent=`${l}%`,u==null?i.textContent=`0.0mm`:i.textContent=`${u.toFixed(1)}mm`}setMode(e){e===`dark`?this.classList.add(`dark-mode`):this.classList.remove(`dark-mode`)}};customElements.define(`simple-weather-widget`,e);var t=`https://weather.googleapis.com/v1/currentConditions:lookup`,n=`AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8`,r=`c306b3c6dd3ed8d9`,i=`6b73a9fe7e831a00`,a,o=null,s=[],c=!1;async function l(){google.maps.importLibrary(`marker`);let{Map:e}=await google.maps.importLibrary(`maps`);a=new e(document.getElementById(`map`),{center:{lat:48.8566,lng:2.3522},zoom:6,minZoom:5,disableDefaultUI:!0,mapId:`c306b3c6dd3ed8d9`,clickableIcons:!1});let t=a.getCenter();t&&await u({name:`Initial Location`,lat:t.lat(),lng:t.lng()},`dynamic`),a.addListener(`click`,async e=>{let t=e.domEvent.target,n=!1;for(;t;){if(t.tagName===`SIMPLE-WEATHER-WIDGET`||t.classList.contains(`gm-control-active`)){n=!0;break}t=t.parentElement}if(!n&&e.latLng){if(o){let e=o.shadowRoot.getElementById(`rain-details`);e.style.display=`none`,o.shadowRoot.querySelector(`.widget-container`).classList.remove(`highlight`);let t=s.find(e=>e.content===o);t&&(t.zIndex=null),o=null}let t=s.findIndex(e=>e.markerType===`dynamic`);t!==-1&&(s[t].map=null,s.splice(t,1)),await u({name:`Clicked Location`,lat:e.latLng.lat(),lng:e.latLng.lng()},`dynamic`)}})}async function u(e,t){let[{AdvancedMarkerElement:n},{LatLng:r}]=await Promise.all([google.maps.importLibrary(`marker`),google.maps.importLibrary(`core`)]),i=document.createElement(`simple-weather-widget`);document.getElementById(`map`).classList.contains(`dark-mode`)&&i.setMode(`dark`);let c=new n({map:a,position:{lat:e.lat,lng:e.lng},content:i,title:e.name,gmpClickable:!0});c.markerType=t,h(c,i,new r(e.lat,e.lng)),c.addEventListener(`gmp-click`,()=>{let e=i.shadowRoot.querySelector(`.widget-container`);if(o&&o!==i){o.shadowRoot.querySelector(`.widget-container`).classList.remove(`highlight`);let e=s.find(e=>e.content===o);e&&(e.zIndex=null)}e.classList.toggle(`highlight`),e.classList.contains(`highlight`)?(o=i,c.zIndex=1):(o=null,c.zIndex=null)}),s.push(c)}async function d(){let e=document.getElementById(`map`);e.classList.toggle(`dark-mode`);let t=document.getElementById(`mode-toggle`);t&&(e.classList.contains(`dark-mode`)?t.textContent=`Light Mode`:t.textContent=`Dark Mode`),s.forEach(e=>{e.map=null});let{Map:n}=await google.maps.importLibrary(`maps`);a=new n(e,{center:a.getCenter(),zoom:a.getZoom(),minZoom:5,disableDefaultUI:!0,mapId:e.classList.contains(`dark-mode`)?i:r,clickableIcons:!1});let c=[...s];s=[];for(let e of c){e.map=a;let t=e.content;document.getElementById(`map`).classList.contains(`dark-mode`)?t.setMode(`dark`):t.setMode(`light`),s.push(e)}a.addListener(`click`,async e=>{let t=e.domEvent.target,n=!1;for(;t;){if(t.tagName===`SIMPLE-WEATHER-WIDGET`||t.classList.contains(`gm-control-active`)){n=!0;break}t=t.parentElement}if(!n&&e.latLng){if(o){let e=o.shadowRoot.getElementById(`rain-details`);e.style.display=`none`,o.shadowRoot.querySelector(`.widget-container`).classList.remove(`highlight`);let t=s.find(e=>e.content===o);t&&(t.zIndex=null),o=null}let t=s.findIndex(e=>e.markerType===`dynamic`);t!==-1&&(s[t].map=null,s.splice(t,1)),await u({name:`Clicked Location`,lat:e.latLng.lat(),lng:e.latLng.lng()},`dynamic`)}})}var f=[{name:`London`,lat:51.5074,lng:-.1278},{name:`Brussels`,lat:50.8503,lng:4.3517},{name:`Luxembourg`,lat:49.8153,lng:6.1296},{name:`Amsterdam`,lat:52.3676,lng:4.9041},{name:`Berlin`,lat:52.52,lng:13.405},{name:`Rome`,lat:41.9028,lng:12.4964},{name:`Geneva`,lat:46.2044,lng:6.14324},{name:`Barcelona`,lat:41.3874,lng:-2.1686},{name:`Milan`,lat:45.4685,lng:9.1824}];async function p(){for(let e of f)await u(e,`button`)}function m(){if(o){let e=s.find(e=>e.content===o&&e.markerType===`button`);if(e){let t=o.shadowRoot.getElementById(`rain-details`);t.style.display=`none`,o.shadowRoot.querySelector(`.widget-container`).classList.remove(`highlight`),e.zIndex=null,o=null}}s.filter(e=>e.markerType===`button`).forEach(e=>{e.map=null;let t=s.indexOf(e);t>-1&&s.splice(t,1)})}async function h(e,r,i){let a=`${t}?key=${n}&location.latitude=${i.lat()}&location.longitude=${i.lng()}`;try{let e=await fetch(a);if(e.ok){let t=await e.json();console.log(`Weather data fetched for marker:`,t),r.data=t}else{let t=await e.json();if(console.error(`API error response:`,t),e.status===404&&t?.error?.status===`NOT_FOUND`)r.data={error:`Location not supported`};else throw Error(`HTTP error! status: ${e.status}`)}}catch(e){console.error(`Error fetching weather data for marker:`,e),r.data={error:`Failed to fetch weather data`}}}l(),customElements.whenDefined(`simple-weather-widget`).then(()=>{let e=document.getElementById(`mode-toggle`);e&&e.addEventListener(`click`,()=>{d()});let t=document.getElementById(`load-markers-button`);t&&t.addEventListener(`click`,()=>{c?(m(),c=!1,t.textContent=`Load Markers`):(p(),c=!0,t.textContent=`Remove Markers`)})}); \ No newline at end of file + `}set data(e){let t=this.shadowRoot.getElementById(`condition-icon`),n=this.shadowRoot.getElementById(`temperature`),r=this.shadowRoot.getElementById(`rain-probability`),i=this.shadowRoot.getElementById(`rain-qpf`),a=this.shadowRoot.getElementById(`rain-details`);if(!e||e.error){t.style.display=`none`,a.style.display=`none`,e&&e.error?(n.textContent=e.error,n.classList.add(`error-message`)):(n.textContent=`N/A`,n.classList.remove(`error-message`));return}let o=e.daytimeForecast||e.nighttimeForecast,s,c,l,u;if(o){let t=e;s=t.maxTemperature?.degrees,c=t.daytimeForecast?.weatherCondition?.iconBaseUri||t.nighttimeForecast?.weatherCondition?.iconBaseUri,l=t.precipitation?.probability?.percent,u=t.precipitation?.qpf?.quantity}else{let t=e;s=t.temperature?.degrees,c=t.weatherCondition?.iconBaseUri,l=t.precipitation?.probability?.percent,u=t.currentConditionsHistory?.qpf?.quantity===void 0?t.precipitation?.qpf?.quantity:t.currentConditionsHistory.qpf.quantity}let d=``;d=c?`${c}.svg`:`/icons/cloud-cover-white.svg`,t.style.display=`none`,t.onload=()=>{t.style.display=`inline-block`},t.onerror=()=>{console.error(`Failed to load weather icon:`,d),t.style.display=`none`},t.src=d,n.textContent=`${s===void 0?`N/A`:s.toFixed(0)}°C`,n.classList.remove(`error-message`),l==null?r.textContent=`0%`:r.textContent=`${l}%`,u==null?i.textContent=`0.0mm`:i.textContent=`${u.toFixed(1)}mm`}setMode(e){e===`dark`?this.classList.add(`dark-mode`):this.classList.remove(`dark-mode`)}};customElements.define(`simple-weather-widget`,e);var t=`https://weather.googleapis.com/v1/currentConditions:lookup`,n=`AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8`,r=`c306b3c6dd3ed8d9`,i=`6b73a9fe7e831a00`,a,o=null,s=[],c=!1;async function l(){google.maps.importLibrary(`marker`);let{Map:e}=await google.maps.importLibrary(`maps`);a=new e(document.getElementById(`map`),{center:{lat:48.8566,lng:2.3522},zoom:6,minZoom:5,disableDefaultUI:!0,mapId:`c306b3c6dd3ed8d9`,clickableIcons:!1});let t=a.getCenter();t&&await u({name:`Initial Location`,lat:t.lat(),lng:t.lng()},`dynamic`),a.addListener(`click`,async e=>{let t=e.domEvent.target,n=!1;for(;t;){if(t.tagName===`SIMPLE-WEATHER-WIDGET`||t.classList.contains(`gm-control-active`)){n=!0;break}t=t.parentElement}if(!n&&e.latLng){if(o){let e=o.shadowRoot.getElementById(`rain-details`);e.style.display=`none`,o.shadowRoot.querySelector(`.widget-container`).classList.remove(`highlight`);let t=s.find(e=>e.firstElementChild===o);t&&(t.zIndex=null),o=null}let t=s.findIndex(e=>e.markerType===`dynamic`);t!==-1&&(s[t].map=null,s.splice(t,1)),await u({name:`Clicked Location`,lat:e.latLng.lat(),lng:e.latLng.lng()},`dynamic`)}})}async function u(e,t){let[{AdvancedMarkerElement:n},{LatLng:r}]=await Promise.all([google.maps.importLibrary(`marker`),google.maps.importLibrary(`core`)]),i=document.createElement(`simple-weather-widget`);document.getElementById(`map`).classList.contains(`dark-mode`)&&i.setMode(`dark`);let c=new n({map:a,position:{lat:e.lat,lng:e.lng},title:e.name,gmpClickable:!0});c.append(i),c.markerType=t,h(c,i,new r(e.lat,e.lng)),c.addEventListener(`gmp-click`,()=>{let e=i.shadowRoot.querySelector(`.widget-container`);if(o&&o!==i){o.shadowRoot.querySelector(`.widget-container`).classList.remove(`highlight`);let e=s.find(e=>e.firstElementChild===o);e&&(e.zIndex=null)}e.classList.toggle(`highlight`),e.classList.contains(`highlight`)?(o=i,c.zIndex=1):(o=null,c.zIndex=null)}),s.push(c)}async function d(){let e=document.getElementById(`map`);e.classList.toggle(`dark-mode`);let t=document.getElementById(`mode-toggle`);t&&(e.classList.contains(`dark-mode`)?t.textContent=`Light Mode`:t.textContent=`Dark Mode`),s.forEach(e=>{e.map=null});let{Map:n}=await google.maps.importLibrary(`maps`);a=new n(e,{center:a.getCenter(),zoom:a.getZoom(),minZoom:5,disableDefaultUI:!0,mapId:e.classList.contains(`dark-mode`)?i:r,clickableIcons:!1});let c=[...s];s=[];for(let t of c){t.map=a;let n=t.firstElementChild;e.classList.contains(`dark-mode`)?n.setMode(`dark`):n.setMode(`light`),s.push(t)}a.addListener(`click`,async e=>{let t=e.domEvent.target,n=!1;for(;t;){if(t.tagName===`SIMPLE-WEATHER-WIDGET`||t.classList.contains(`gm-control-active`)){n=!0;break}t=t.parentElement}if(!n&&e.latLng){if(o){let e=o.shadowRoot.getElementById(`rain-details`);e.style.display=`none`,o.shadowRoot.querySelector(`.widget-container`).classList.remove(`highlight`);let t=s.find(e=>e.firstElementChild===o);t&&(t.zIndex=null),o=null}let t=s.findIndex(e=>e.markerType===`dynamic`);t!==-1&&(s[t].map=null,s.splice(t,1)),await u({name:`Clicked Location`,lat:e.latLng.lat(),lng:e.latLng.lng()},`dynamic`)}})}var f=[{name:`London`,lat:51.5074,lng:-.1278},{name:`Brussels`,lat:50.8503,lng:4.3517},{name:`Luxembourg`,lat:49.8153,lng:6.1296},{name:`Amsterdam`,lat:52.3676,lng:4.9041},{name:`Berlin`,lat:52.52,lng:13.405},{name:`Rome`,lat:41.9028,lng:12.4964},{name:`Geneva`,lat:46.2044,lng:6.14324},{name:`Barcelona`,lat:41.3874,lng:-2.1686},{name:`Milan`,lat:45.4685,lng:9.1824}];async function p(){for(let e of f)await u(e,`button`)}function m(){if(o){let e=s.find(e=>e.firstElementChild===o&&e.markerType===`button`);if(e){let t=o.shadowRoot.getElementById(`rain-details`);t.style.display=`none`,o.shadowRoot.querySelector(`.widget-container`).classList.remove(`highlight`),e.zIndex=null,o=null}}s.filter(e=>e.markerType===`button`).forEach(e=>{e.map=null;let t=s.indexOf(e);t>-1&&s.splice(t,1)})}async function h(e,r,i){let a=`${t}?key=${n}&location.latitude=${i.lat()}&location.longitude=${i.lng()}`;try{let e=await fetch(a);if(e.ok){let t=await e.json();console.log(`Weather data fetched for marker:`,t),r.data=t}else{let t=await e.json();if(console.error(`API error response:`,t),e.status===404&&t?.error?.status===`NOT_FOUND`)r.data={error:`Location not supported`};else throw Error(`HTTP error! status: ${e.status}`)}}catch(e){console.error(`Error fetching weather data for marker:`,e),r.data={error:`Failed to fetch weather data`}}}l(),customElements.whenDefined(`simple-weather-widget`).then(()=>{let e=document.getElementById(`mode-toggle`);e&&e.addEventListener(`click`,()=>{d()});let t=document.getElementById(`load-markers-button`);t&&t.addEventListener(`click`,()=>{c?(m(),c=!1,t.textContent=`Load Markers`):(p(),c=!0,t.textContent=`Remove Markers`)})}); \ No newline at end of file diff --git a/dist/samples/weather-api-current-compact/dist/index.html b/dist/samples/weather-api-current-compact/dist/index.html index 57235c7c9..5760e316f 100644 --- a/dist/samples/weather-api-current-compact/dist/index.html +++ b/dist/samples/weather-api-current-compact/dist/index.html @@ -16,7 +16,7 @@ key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8" }); - + diff --git a/dist/samples/weather-api-current-compact/docs/index.js b/dist/samples/weather-api-current-compact/docs/index.js index 12fa429e9..98a3191b6 100644 --- a/dist/samples/weather-api-current-compact/docs/index.js +++ b/dist/samples/weather-api-current-compact/docs/index.js @@ -18,7 +18,7 @@ let activeWeatherWidget = null; // To keep track of the currently active widget let allMarkers = []; // To store all active markers let markersLoaded = false; // Flag to track if button markers are loaded -async function initMap() { +async function init() { void google.maps.importLibrary('marker'); // preload const { Map } = await google.maps.importLibrary('maps'); @@ -77,7 +77,7 @@ async function initMap() { activeWidgetContainer.classList.remove('highlight'); // Find the marker associated with the active widget and reset its zIndex const activeMarker = allMarkers.find( - (marker) => marker.content === activeWeatherWidget + (marker) => marker.firstElementChild === activeWeatherWidget ); if (activeMarker) { activeMarker.zIndex = null; @@ -128,12 +128,13 @@ async function createAndAddMarker(location, markerType) { const marker = new AdvancedMarkerElement({ map: map, position: { lat: location.lat, lng: location.lng }, - content: weatherWidget, title: location.name, // Add a title for accessibility gmpClickable: true, }); + marker.append(weatherWidget); // Store the marker type + marker.markerType = markerType; // Fetch and update weather data for this location @@ -157,7 +158,7 @@ async function createAndAddMarker(location, markerType) { activeWidgetContainer.classList.remove('highlight'); // Find the marker associated with the active widget and reset its zIndex const activeMarker = allMarkers.find( - (marker) => marker.content === activeWeatherWidget + (e) => e.firstElementChild === activeWeatherWidget ); if (activeMarker) { activeMarker.zIndex = null; @@ -228,8 +229,7 @@ async function toggleDarkMode() { for (const marker of markersToReAdd) { marker.map = map; // Add marker to the new map - const weatherWidget = marker.content; - const mapContainer = document.getElementById('map'); // Re-get map container + const weatherWidget = marker.firstElementChild; if (mapContainer.classList.contains('dark-mode')) { weatherWidget.setMode('dark'); } else { @@ -270,7 +270,7 @@ async function toggleDarkMode() { activeWidgetContainer.classList.remove('highlight'); // Find the marker associated with the active widget and reset its zIndex const activeMarker = allMarkers.find( - (marker) => marker.content === activeWeatherWidget + (marker) => marker.firstElementChild === activeWeatherWidget ); if (activeMarker) { activeMarker.zIndex = null; @@ -323,7 +323,7 @@ function removeButtonMarkers() { if (activeWeatherWidget) { const buttonMarker = allMarkers.find( (marker) => - marker.content === activeWeatherWidget && + marker.firstElementChild === activeWeatherWidget && marker.markerType === 'button' ); if (buttonMarker) { @@ -385,7 +385,7 @@ async function updateWeatherDisplayForMarker(marker, widget, location) { } } -void initMap(); +void init(); // Wait for the custom element to be defined before adding the event listener void customElements.whenDefined('simple-weather-widget').then(() => { diff --git a/dist/samples/weather-api-current-compact/docs/index.ts b/dist/samples/weather-api-current-compact/docs/index.ts index c8c51771a..836daa2e8 100644 --- a/dist/samples/weather-api-current-compact/docs/index.ts +++ b/dist/samples/weather-api-current-compact/docs/index.ts @@ -18,7 +18,7 @@ let activeWeatherWidget: SimpleWeatherWidget | null = null; // To keep track of let allMarkers: google.maps.marker.AdvancedMarkerElement[] = []; // To store all active markers let markersLoaded = false; // Flag to track if button markers are loaded -async function initMap(): Promise { +async function init(): Promise { void google.maps.importLibrary('marker'); // preload const { Map } = await google.maps.importLibrary('maps'); @@ -77,7 +77,7 @@ async function initMap(): Promise { activeWidgetContainer.classList.remove('highlight'); // Find the marker associated with the active widget and reset its zIndex const activeMarker = allMarkers.find( - (marker) => marker.content === activeWeatherWidget + (marker) => marker.firstElementChild === activeWeatherWidget ); if (activeMarker) { activeMarker.zIndex = null; @@ -87,6 +87,7 @@ async function initMap(): Promise { // Remove the previous dynamic marker if it exists const currentDynamicMarkerIndex = allMarkers.findIndex( + // eslint-disable-next-line @typescript-eslint/no-explicit-any (marker) => (marker as any).markerType === 'dynamic' ); if (currentDynamicMarkerIndex !== -1) { @@ -133,12 +134,13 @@ async function createAndAddMarker( const marker = new AdvancedMarkerElement({ map: map, position: { lat: location.lat, lng: location.lng }, - content: weatherWidget, title: location.name, // Add a title for accessibility gmpClickable: true, }); + marker.append(weatherWidget); // Store the marker type + // eslint-disable-next-line @typescript-eslint/no-explicit-any (marker as any).markerType = markerType; // Fetch and update weather data for this location @@ -163,7 +165,7 @@ async function createAndAddMarker( activeWidgetContainer.classList.remove('highlight'); // Find the marker associated with the active widget and reset its zIndex const activeMarker = allMarkers.find( - (marker) => marker.content === activeWeatherWidget + (e) => e.firstElementChild === activeWeatherWidget ); if (activeMarker) { activeMarker.zIndex = null; @@ -234,8 +236,7 @@ async function toggleDarkMode() { for (const marker of markersToReAdd) { marker.map = map; // Add marker to the new map - const weatherWidget = marker.content as SimpleWeatherWidget; - const mapContainer = document.getElementById('map') as HTMLElement; // Re-get map container + const weatherWidget = marker.firstElementChild as SimpleWeatherWidget; if (mapContainer.classList.contains('dark-mode')) { weatherWidget.setMode('dark'); } else { @@ -276,7 +277,7 @@ async function toggleDarkMode() { activeWidgetContainer.classList.remove('highlight'); // Find the marker associated with the active widget and reset its zIndex const activeMarker = allMarkers.find( - (marker) => marker.content === activeWeatherWidget + (marker) => marker.firstElementChild === activeWeatherWidget ); if (activeMarker) { activeMarker.zIndex = null; @@ -286,6 +287,7 @@ async function toggleDarkMode() { // Remove the previous dynamic marker if it exists const currentDynamicMarkerIndex = allMarkers.findIndex( + // eslint-disable-next-line @typescript-eslint/no-explicit-any (marker) => (marker as any).markerType === 'dynamic' ); if (currentDynamicMarkerIndex !== -1) { @@ -329,7 +331,8 @@ function removeButtonMarkers(): void { if (activeWeatherWidget) { const buttonMarker = allMarkers.find( (marker) => - marker.content === activeWeatherWidget && + marker.firstElementChild === activeWeatherWidget && + // eslint-disable-next-line @typescript-eslint/no-explicit-any (marker as any).markerType === 'button' ); if (buttonMarker) { @@ -350,6 +353,7 @@ function removeButtonMarkers(): void { // Remove button markers from the map and the allMarkers array const markersToRemove = allMarkers.filter( + // eslint-disable-next-line @typescript-eslint/no-explicit-any (marker) => (marker as any).markerType === 'button' ); markersToRemove.forEach((marker) => { @@ -397,7 +401,7 @@ async function updateWeatherDisplayForMarker( } } -void initMap(); +void init(); // Wait for the custom element to be defined before adding the event listener void customElements.whenDefined('simple-weather-widget').then(() => { diff --git a/dist/samples/weather-api-current-compact/jsfiddle/demo.js b/dist/samples/weather-api-current-compact/jsfiddle/demo.js index 818c72f5c..0632b549a 100644 --- a/dist/samples/weather-api-current-compact/jsfiddle/demo.js +++ b/dist/samples/weather-api-current-compact/jsfiddle/demo.js @@ -17,7 +17,7 @@ let activeWeatherWidget = null; // To keep track of the currently active widget let allMarkers = []; // To store all active markers let markersLoaded = false; // Flag to track if button markers are loaded -async function initMap() { +async function init() { void google.maps.importLibrary('marker'); // preload const { Map } = await google.maps.importLibrary('maps'); @@ -76,7 +76,7 @@ async function initMap() { activeWidgetContainer.classList.remove('highlight'); // Find the marker associated with the active widget and reset its zIndex const activeMarker = allMarkers.find( - (marker) => marker.content === activeWeatherWidget + (marker) => marker.firstElementChild === activeWeatherWidget ); if (activeMarker) { activeMarker.zIndex = null; @@ -127,12 +127,13 @@ async function createAndAddMarker(location, markerType) { const marker = new AdvancedMarkerElement({ map: map, position: { lat: location.lat, lng: location.lng }, - content: weatherWidget, title: location.name, // Add a title for accessibility gmpClickable: true, }); + marker.append(weatherWidget); // Store the marker type + marker.markerType = markerType; // Fetch and update weather data for this location @@ -156,7 +157,7 @@ async function createAndAddMarker(location, markerType) { activeWidgetContainer.classList.remove('highlight'); // Find the marker associated with the active widget and reset its zIndex const activeMarker = allMarkers.find( - (marker) => marker.content === activeWeatherWidget + (e) => e.firstElementChild === activeWeatherWidget ); if (activeMarker) { activeMarker.zIndex = null; @@ -227,8 +228,7 @@ async function toggleDarkMode() { for (const marker of markersToReAdd) { marker.map = map; // Add marker to the new map - const weatherWidget = marker.content; - const mapContainer = document.getElementById('map'); // Re-get map container + const weatherWidget = marker.firstElementChild; if (mapContainer.classList.contains('dark-mode')) { weatherWidget.setMode('dark'); } else { @@ -269,7 +269,7 @@ async function toggleDarkMode() { activeWidgetContainer.classList.remove('highlight'); // Find the marker associated with the active widget and reset its zIndex const activeMarker = allMarkers.find( - (marker) => marker.content === activeWeatherWidget + (marker) => marker.firstElementChild === activeWeatherWidget ); if (activeMarker) { activeMarker.zIndex = null; @@ -322,7 +322,7 @@ function removeButtonMarkers() { if (activeWeatherWidget) { const buttonMarker = allMarkers.find( (marker) => - marker.content === activeWeatherWidget && + marker.firstElementChild === activeWeatherWidget && marker.markerType === 'button' ); if (buttonMarker) { @@ -384,7 +384,7 @@ async function updateWeatherDisplayForMarker(marker, widget, location) { } } -void initMap(); +void init(); // Wait for the custom element to be defined before adding the event listener void customElements.whenDefined('simple-weather-widget').then(() => { diff --git a/dist/samples/web-components-events/app/index.ts b/dist/samples/web-components-events/app/index.ts index e63667f0e..60eaf8c84 100644 --- a/dist/samples/web-components-events/app/index.ts +++ b/dist/samples/web-components-events/app/index.ts @@ -6,7 +6,7 @@ // [START maps_web_components_events] // This example adds a map using web components. -async function initMap(): Promise { +async function init(): Promise { void google.maps.importLibrary('marker'); // preload const { InfoWindow } = await google.maps.importLibrary('maps'); @@ -31,5 +31,5 @@ async function initMap(): Promise { } } -void initMap(); +void init(); // [END maps_web_components_events] diff --git a/dist/samples/web-components-events/docs/index.js b/dist/samples/web-components-events/docs/index.js index aabd4c774..b90f4153f 100644 --- a/dist/samples/web-components-events/docs/index.js +++ b/dist/samples/web-components-events/docs/index.js @@ -7,7 +7,7 @@ // [START maps_web_components_events] // This example adds a map using web components. -async function initMap() { +async function init() { void google.maps.importLibrary('marker'); // preload const { InfoWindow } = await google.maps.importLibrary('maps'); @@ -32,5 +32,5 @@ async function initMap() { } } -void initMap(); +void init(); // [END maps_web_components_events] diff --git a/dist/samples/web-components-events/docs/index.ts b/dist/samples/web-components-events/docs/index.ts index e63667f0e..60eaf8c84 100644 --- a/dist/samples/web-components-events/docs/index.ts +++ b/dist/samples/web-components-events/docs/index.ts @@ -6,7 +6,7 @@ // [START maps_web_components_events] // This example adds a map using web components. -async function initMap(): Promise { +async function init(): Promise { void google.maps.importLibrary('marker'); // preload const { InfoWindow } = await google.maps.importLibrary('maps'); @@ -31,5 +31,5 @@ async function initMap(): Promise { } } -void initMap(); +void init(); // [END maps_web_components_events] diff --git a/dist/samples/web-components-events/jsfiddle/demo.js b/dist/samples/web-components-events/jsfiddle/demo.js index 97fc3b7d9..843ee7722 100644 --- a/dist/samples/web-components-events/jsfiddle/demo.js +++ b/dist/samples/web-components-events/jsfiddle/demo.js @@ -6,7 +6,7 @@ */ // This example adds a map using web components. -async function initMap() { +async function init() { void google.maps.importLibrary('marker'); // preload const { InfoWindow } = await google.maps.importLibrary('maps'); @@ -31,4 +31,4 @@ async function initMap() { } } -void initMap(); +void init();