diff --git a/dist/samples/deckgl-polygon/app/index.ts b/dist/samples/deckgl-polygon/app/index.ts index 34c29964..5c27a689 100644 --- a/dist/samples/deckgl-polygon/app/index.ts +++ b/dist/samples/deckgl-polygon/app/index.ts @@ -4,6 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ /* [START maps_deckgl_polygon] */ +// Initialize and add the map +let map: google.maps.Map; +let polygonLayer: deck.PolygonLayer; // Declare polygonLayer outside for button access +let googleMapsOverlay: deck.GoogleMapsOverlay; // Declare googleMapsOverlay outside for button access + // Declare global namespace for Deck.gl to satisfy TypeScript compiler declare namespace deck { class PolygonLayer { @@ -20,11 +25,6 @@ declare namespace deck { // Add other Deck.gl types used globally if needed } -// Initialize and add the map -let map: google.maps.Map; -let polygonLayer: deck.PolygonLayer; // Declare polygonLayer outside for button access -let googleMapsOverlay: deck.GoogleMapsOverlay; // Declare googleMapsOverlay outside for button access - async function initMap(): Promise { // Progress bar logic moved from index.html var progress, progressDiv = document.querySelector(".mdc-linear-progress"); diff --git a/dist/samples/deckgl-polygon/dist/assets/index--YAHIMlV.js b/dist/samples/deckgl-polygon/dist/assets/index--YAHIMlV.js deleted file mode 100644 index 1e6c2ce4..00000000 --- a/dist/samples/deckgl-polygon/dist/assets/index--YAHIMlV.js +++ /dev/null @@ -1 +0,0 @@ -(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))a(e);new MutationObserver(e=>{for(const o of e)if(o.type==="childList")for(const t of o.addedNodes)t.tagName==="LINK"&&t.rel==="modulepreload"&&a(t)}).observe(document,{childList:!0,subtree:!0});function p(e){const o={};return e.integrity&&(o.integrity=e.integrity),e.referrerPolicy&&(o.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?o.credentials="include":e.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(e){if(e.ep)return;e.ep=!0;const o=p(e);fetch(e.href,o)}})();let g,l,u;async function y(){var r,n=document.querySelector(".mdc-linear-progress");n&&(r=new mdc.linearProgress.MDCLinearProgress(n),r.open(),r.determinate=!1,r.done=function(){r.close(),n?.remove()});const p={lat:37.752954624496304,lng:-122.44754059928648},{Map:a}=await google.maps.importLibrary("maps"),e=document.getElementById("map");if(!e){console.error("Map element not found!");return}g=new a(e,{zoom:12,center:p,tilt:90,heading:-25,mapId:"c306b3c6dd3ed8d9",streetViewControl:!1}),l=new deck.PolygonLayer({id:"PolygonLayer",data:"https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/sf-zipcodes.json",getPolygon:t=>t.contour,getElevation:t=>t.population/t.area/10,getFillColor:t=>[t.population/t.area/60,140,0],getLineColor:[255,255,255],getLineWidth:20,lineWidthMinPixels:1,visible:!0,opacity:.7,pickable:!0,onDataLoad:()=>{r&&setTimeout(()=>{r.done()},100)},onHover:({object:t,x:c,y:f})=>{const s=document.getElementById("tooltip");if(s)if(t){let d="";const i=t;i&&(i.zipcode!==void 0&&(d+=`Zipcode: ${i.zipcode}
`),i.population!==void 0&&(d+=`Population: ${i.population}
`),i.area!==void 0&&(d+=`Area: ${i.area}
`)),s.innerHTML=d,s.style.left=c+"px",s.style.top=f+"px",s.style.display="block"}else s.style.display="none"}}),u=new deck.GoogleMapsOverlay({layers:[l]}),u.setMap(g);const o=document.getElementById("toggleButton");o&&o.addEventListener("click",()=>{const t=l.props.visible,c=l.clone({visible:!t});u.setProps({layers:[c]}),l=c,o.textContent=t?"Show Polygon Layer":"Hide Polygon Layer"})}y(); diff --git a/dist/samples/deckgl-polygon/dist/assets/index-Cdk1EUKh.js b/dist/samples/deckgl-polygon/dist/assets/index-Cdk1EUKh.js new file mode 100644 index 00000000..cd0fe41a --- /dev/null +++ b/dist/samples/deckgl-polygon/dist/assets/index-Cdk1EUKh.js @@ -0,0 +1,5 @@ +(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))a(e);new MutationObserver(e=>{for(const o of e)if(o.type==="childList")for(const t of o.addedNodes)t.tagName==="LINK"&&t.rel==="modulepreload"&&a(t)}).observe(document,{childList:!0,subtree:!0});function p(e){const o={};return e.integrity&&(o.integrity=e.integrity),e.referrerPolicy&&(o.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?o.credentials="include":e.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(e){if(e.ep)return;e.ep=!0;const o=p(e);fetch(e.href,o)}})();/* + * @license + * Copyright 2025 Google LLC. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */let g,l,u;async function y(){var r,n=document.querySelector(".mdc-linear-progress");n&&(r=new mdc.linearProgress.MDCLinearProgress(n),r.open(),r.determinate=!1,r.done=function(){r.close(),n?.remove()});const p={lat:37.752954624496304,lng:-122.44754059928648},{Map:a}=await google.maps.importLibrary("maps"),e=document.getElementById("map");if(!e){console.error("Map element not found!");return}g=new a(e,{zoom:12,center:p,tilt:90,heading:-25,mapId:"c306b3c6dd3ed8d9",streetViewControl:!1}),l=new deck.PolygonLayer({id:"PolygonLayer",data:"https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/sf-zipcodes.json",getPolygon:t=>t.contour,getElevation:t=>t.population/t.area/10,getFillColor:t=>[t.population/t.area/60,140,0],getLineColor:[255,255,255],getLineWidth:20,lineWidthMinPixels:1,visible:!0,opacity:.7,pickable:!0,onDataLoad:()=>{r&&setTimeout(()=>{r.done()},100)},onHover:({object:t,x:c,y:f})=>{const s=document.getElementById("tooltip");if(s)if(t){let d="";const i=t;i&&(i.zipcode!==void 0&&(d+=`Zipcode: ${i.zipcode}
`),i.population!==void 0&&(d+=`Population: ${i.population}
`),i.area!==void 0&&(d+=`Area: ${i.area}
`)),s.innerHTML=d,s.style.left=c+"px",s.style.top=f+"px",s.style.display="block"}else s.style.display="none"}}),u=new deck.GoogleMapsOverlay({layers:[l]}),u.setMap(g);const o=document.getElementById("toggleButton");o&&o.addEventListener("click",()=>{const t=l.props.visible,c=l.clone({visible:!t});u.setProps({layers:[c]}),l=c,o.textContent=t?"Show Polygon Layer":"Hide Polygon Layer"})}y(); diff --git a/dist/samples/deckgl-polygon/dist/index.html b/dist/samples/deckgl-polygon/dist/index.html index 701b9817..e6b17be0 100644 --- a/dist/samples/deckgl-polygon/dist/index.html +++ b/dist/samples/deckgl-polygon/dist/index.html @@ -20,7 +20,7 @@ - + diff --git a/dist/samples/deckgl-polygon/docs/index.js b/dist/samples/deckgl-polygon/docs/index.js index 27a816f1..ae6b55a8 100644 --- a/dist/samples/deckgl-polygon/docs/index.js +++ b/dist/samples/deckgl-polygon/docs/index.js @@ -1,4 +1,10 @@ "use strict"; +/* + * @license + * 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 diff --git a/dist/samples/deckgl-polygon/docs/index.ts b/dist/samples/deckgl-polygon/docs/index.ts index 34c29964..5c27a689 100644 --- a/dist/samples/deckgl-polygon/docs/index.ts +++ b/dist/samples/deckgl-polygon/docs/index.ts @@ -4,6 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ /* [START maps_deckgl_polygon] */ +// Initialize and add the map +let map: google.maps.Map; +let polygonLayer: deck.PolygonLayer; // Declare polygonLayer outside for button access +let googleMapsOverlay: deck.GoogleMapsOverlay; // Declare googleMapsOverlay outside for button access + // Declare global namespace for Deck.gl to satisfy TypeScript compiler declare namespace deck { class PolygonLayer { @@ -20,11 +25,6 @@ declare namespace deck { // Add other Deck.gl types used globally if needed } -// Initialize and add the map -let map: google.maps.Map; -let polygonLayer: deck.PolygonLayer; // Declare polygonLayer outside for button access -let googleMapsOverlay: deck.GoogleMapsOverlay; // Declare googleMapsOverlay outside for button access - async function initMap(): Promise { // Progress bar logic moved from index.html var progress, progressDiv = document.querySelector(".mdc-linear-progress"); diff --git a/dist/samples/deckgl-polygon/jsfiddle/demo.js b/dist/samples/deckgl-polygon/jsfiddle/demo.js index 27a816f1..ae6b55a8 100644 --- a/dist/samples/deckgl-polygon/jsfiddle/demo.js +++ b/dist/samples/deckgl-polygon/jsfiddle/demo.js @@ -1,4 +1,10 @@ "use strict"; +/* + * @license + * 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