diff --git a/dist/samples/deckgl-heatmap/app/index.ts b/dist/samples/deckgl-heatmap/app/index.ts index 41af0a2f..4e18597e 100644 --- a/dist/samples/deckgl-heatmap/app/index.ts +++ b/dist/samples/deckgl-heatmap/app/index.ts @@ -3,7 +3,16 @@ * Copyright 2025 Google LLC. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ + /* [START maps_deckgl_heatmap] */ +// Initialize and add the map +let map: google.maps.Map; +// Use global types for Deck.gl components +let heatmapLayer: deck.HeatmapLayer; +let googleMapsOverlay: deck.GoogleMapsOverlay; +let marker: google.maps.marker.AdvancedMarkerElement | undefined; +let infoWindow: google.maps.InfoWindow; + // Declare global namespace for Deck.gl to satisfy TypeScript compiler declare namespace deck { class HeatmapLayer { @@ -20,14 +29,6 @@ declare namespace deck { // Add other Deck.gl types used globally if needed } -// Initialize and add the map -let map: google.maps.Map; -// Use global types for Deck.gl components -let heatmapLayer: deck.HeatmapLayer; -let googleMapsOverlay: deck.GoogleMapsOverlay; -let marker: google.maps.marker.AdvancedMarkerElement | undefined; -let infoWindow: google.maps.InfoWindow; - async function initMap(): Promise { // Progress bar logic moved from index.html var progress, progressDiv = document.querySelector(".mdc-linear-progress"); @@ -195,4 +196,4 @@ async function initMap(): Promise { } initMap(); -/* [END maps_deckgl_heatmap] */ \ No newline at end of file +/* [END maps_deckgl_heatmap] */ diff --git a/dist/samples/deckgl-heatmap/dist/assets/index-CG8BDR0z.js b/dist/samples/deckgl-heatmap/dist/assets/index-gZB8khcW.js similarity index 51% rename from dist/samples/deckgl-heatmap/dist/assets/index-CG8BDR0z.js rename to dist/samples/deckgl-heatmap/dist/assets/index-gZB8khcW.js index 87ecd117..8ccb3b0c 100644 --- a/dist/samples/deckgl-heatmap/dist/assets/index-CG8BDR0z.js +++ b/dist/samples/deckgl-heatmap/dist/assets/index-gZB8khcW.js @@ -1,4 +1,8 @@ -(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))g(o);new MutationObserver(o=>{for(const n of o)if(n.type==="childList")for(const d of n.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&g(d)}).observe(document,{childList:!0,subtree:!0});function u(o){const n={};return o.integrity&&(n.integrity=o.integrity),o.referrerPolicy&&(n.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?n.credentials="include":o.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function g(o){if(o.ep)return;o.ep=!0;const n=u(o);fetch(o.href,n)}})();let l,p,f,c,s;async function b(){var r,a=document.querySelector(".mdc-linear-progress");a&&(r=new mdc.linearProgress.MDCLinearProgress(a),r.open(),r.determinate=!1,r.done=function(){r.close(),a?.remove()});const u={lat:37.77325660358167,lng:-122.41712341793448},{Map:g,InfoWindow:o}=await google.maps.importLibrary("maps"),{AdvancedMarkerElement:n}=await google.maps.importLibrary("marker"),d=document.getElementById("map");if(!d){console.error("Map element not found!");return}l=new g(d,{zoom:13,center:u,tilt:90,heading:-25,mapId:"6b73a9fe7e831a00",fullscreenControl:!1,clickableIcons:!1}),p=new deck.HeatmapLayer({id:"HeatmapLayer",data:"https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/sf-bike-parking.json",getPosition:t=>t.COORDINATES,getWeight:t=>t.SPACES,radiusPixels:25,visible:!0,pickable:!0,onHover:t=>{const e=document.getElementById("tooltip");if(e){if(console.log("Hovered object:",t.object),t.object){let i="

Bike Parking Info:

";t.object.ADDRESS!==void 0&&(i+=`Address: ${t.object.ADDRESS}
`),t.object.RACKS!==void 0&&(i+=`Racks: ${t.object.RACKS}
`),t.object.SPACES!==void 0&&(i+=`Spaces: ${t.object.SPACES}
`),e.innerHTML=i,e.style.left=t.x+"px",e.style.top=t.y+"px",e.style.display="block"}else e.style.display="none";console.log("Tooltip content set to:",e.innerHTML)}}}),p.pickable=!0,f=new deck.GoogleMapsOverlay({layers:[p],controller:!0}),f.setMap(l),r&&setTimeout(()=>{r.done()},100),s=new o,l.addListener("click",async t=>{const e=t.latLng;if(e)if(c){c.position=e;const i=` +(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))g(o);new MutationObserver(o=>{for(const n of o)if(n.type==="childList")for(const d of n.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&g(d)}).observe(document,{childList:!0,subtree:!0});function u(o){const n={};return o.integrity&&(n.integrity=o.integrity),o.referrerPolicy&&(n.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?n.credentials="include":o.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function g(o){if(o.ep)return;o.ep=!0;const n=u(o);fetch(o.href,n)}})();/* + * @license + * Copyright 2025 Google LLC. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */let l,p,f,c,s;async function b(){var r,a=document.querySelector(".mdc-linear-progress");a&&(r=new mdc.linearProgress.MDCLinearProgress(a),r.open(),r.determinate=!1,r.done=function(){r.close(),a?.remove()});const u={lat:37.77325660358167,lng:-122.41712341793448},{Map:g,InfoWindow:o}=await google.maps.importLibrary("maps"),{AdvancedMarkerElement:n}=await google.maps.importLibrary("marker"),d=document.getElementById("map");if(!d){console.error("Map element not found!");return}l=new g(d,{zoom:13,center:u,tilt:90,heading:-25,mapId:"6b73a9fe7e831a00",fullscreenControl:!1,clickableIcons:!1}),p=new deck.HeatmapLayer({id:"HeatmapLayer",data:"https://raw.githubusercontent.com/visgl/deck.gl-data/master/website/sf-bike-parking.json",getPosition:t=>t.COORDINATES,getWeight:t=>t.SPACES,radiusPixels:25,visible:!0,pickable:!0,onHover:t=>{const e=document.getElementById("tooltip");if(e){if(console.log("Hovered object:",t.object),t.object){let i="

Bike Parking Info:

";t.object.ADDRESS!==void 0&&(i+=`Address: ${t.object.ADDRESS}
`),t.object.RACKS!==void 0&&(i+=`Racks: ${t.object.RACKS}
`),t.object.SPACES!==void 0&&(i+=`Spaces: ${t.object.SPACES}
`),e.innerHTML=i,e.style.left=t.x+"px",e.style.top=t.y+"px",e.style.display="block"}else e.style.display="none";console.log("Tooltip content set to:",e.innerHTML)}}}),p.pickable=!0,f=new deck.GoogleMapsOverlay({layers:[p],controller:!0}),f.setMap(l),r&&setTimeout(()=>{r.done()},100),s=new o,l.addListener("click",async t=>{const e=t.latLng;if(e)if(c){c.position=e;const i=`
Location: ${e.lat().toFixed(3)}, ${e.lng().toFixed(3)}
Open in Google Maps
`;s.setContent(i),s.open(l,c)}else{c=new n({map:l,position:e,gmpClickable:!0}),c.addListener("click",()=>{s.close();const y=` diff --git a/dist/samples/deckgl-heatmap/dist/index.html b/dist/samples/deckgl-heatmap/dist/index.html index 8227af8b..a15833ca 100644 --- a/dist/samples/deckgl-heatmap/dist/index.html +++ b/dist/samples/deckgl-heatmap/dist/index.html @@ -20,7 +20,7 @@ - + diff --git a/dist/samples/deckgl-heatmap/docs/index.js b/dist/samples/deckgl-heatmap/docs/index.js index 4b08389a..b161f215 100644 --- a/dist/samples/deckgl-heatmap/docs/index.js +++ b/dist/samples/deckgl-heatmap/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_heatmap] */ // Initialize and add the map let map; // Use global types for Deck.gl components @@ -154,4 +160,4 @@ async function initMap() { } } initMap(); -/* [END maps_deckgl_heatmap] */ +/* [END maps_deckgl_heatmap] */ diff --git a/dist/samples/deckgl-heatmap/docs/index.ts b/dist/samples/deckgl-heatmap/docs/index.ts index 41af0a2f..4e18597e 100644 --- a/dist/samples/deckgl-heatmap/docs/index.ts +++ b/dist/samples/deckgl-heatmap/docs/index.ts @@ -3,7 +3,16 @@ * Copyright 2025 Google LLC. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ + /* [START maps_deckgl_heatmap] */ +// Initialize and add the map +let map: google.maps.Map; +// Use global types for Deck.gl components +let heatmapLayer: deck.HeatmapLayer; +let googleMapsOverlay: deck.GoogleMapsOverlay; +let marker: google.maps.marker.AdvancedMarkerElement | undefined; +let infoWindow: google.maps.InfoWindow; + // Declare global namespace for Deck.gl to satisfy TypeScript compiler declare namespace deck { class HeatmapLayer { @@ -20,14 +29,6 @@ declare namespace deck { // Add other Deck.gl types used globally if needed } -// Initialize and add the map -let map: google.maps.Map; -// Use global types for Deck.gl components -let heatmapLayer: deck.HeatmapLayer; -let googleMapsOverlay: deck.GoogleMapsOverlay; -let marker: google.maps.marker.AdvancedMarkerElement | undefined; -let infoWindow: google.maps.InfoWindow; - async function initMap(): Promise { // Progress bar logic moved from index.html var progress, progressDiv = document.querySelector(".mdc-linear-progress"); @@ -195,4 +196,4 @@ async function initMap(): Promise { } initMap(); -/* [END maps_deckgl_heatmap] */ \ No newline at end of file +/* [END maps_deckgl_heatmap] */ diff --git a/dist/samples/deckgl-heatmap/jsfiddle/demo.js b/dist/samples/deckgl-heatmap/jsfiddle/demo.js index 4b08389a..b161f215 100644 --- a/dist/samples/deckgl-heatmap/jsfiddle/demo.js +++ b/dist/samples/deckgl-heatmap/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_heatmap] */ // Initialize and add the map let map; // Use global types for Deck.gl components @@ -154,4 +160,4 @@ async function initMap() { } } initMap(); -/* [END maps_deckgl_heatmap] */ +/* [END maps_deckgl_heatmap] */ diff --git a/package-lock.json b/package-lock.json index 8bda4d63..002b2bac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5240,11 +5240,11 @@ "version": "1.0.0", "dependencies": { "@googlemaps/js-api-loader": "^1.16.8", - "terra-draw": "*", - "terra-draw-google-maps-adapter": "*" + "terra-draw": "latest", + "terra-draw-google-maps-adapter": "latest" }, "devDependencies": { - "@types/google.maps": "*", + "@types/google.maps": "latest", "typescript": "^5.9.2", "vite": "^7.1.3" }