Skip to content

Commit 85fa2f5

Browse files
Update dist folder [skip ci] (#1256)
1 parent 0380c72 commit 85fa2f5

21 files changed

Lines changed: 3088 additions & 0 deletions

dist/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ <h1>Maps JSAPI Samples</h1>
7777
<li><a href='/samples/deckgl-heatmap/dist'>deckgl-heatmap</a></li>
7878
<li><a href='/samples/deckgl-kml/dist'>deckgl-kml</a></li>
7979
<li><a href='/samples/deckgl-kml-updated/dist'>deckgl-kml-updated</a></li>
80+
<li><a href='/samples/deckgl-points/dist'>deckgl-points</a></li>
8081
<li><a href='/samples/deckgl-polygon/dist'>deckgl-polygon</a></li>
8182
<li><a href='/samples/deckgl-tripslayer/dist'>deckgl-tripslayer</a></li>
8283
<li><a href='/samples/event-click-latlng/dist'>event-click-latlng</a></li>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": [
3+
"plugin:@typescript-eslint/recommended"
4+
],
5+
"parser": "@typescript-eslint/parser",
6+
"rules": {
7+
"@typescript-eslint/ban-ts-comment": 0,
8+
"@typescript-eslint/no-this-alias": 1,
9+
"@typescript-eslint/no-empty-function": 1,
10+
"@typescript-eslint/explicit-module-boundary-types": 1,
11+
"@typescript-eslint/no-unused-vars": 1
12+
}
13+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Google Maps JavaScript Sample
2+
3+
## deckgl-points
4+
5+
This example visualizes recent earthquakes using the deck.gl GeoJsonLayer and a ScatterPlot of earthquakes.
6+
7+
## Setup
8+
9+
### Before starting run:
10+
11+
`npm i`
12+
13+
### Run an example on a local web server
14+
15+
`cd samples/deckgl-points`
16+
`npm start`
17+
18+
### Build an individual example
19+
20+
`cd samples/deckgl-points`
21+
`npm run build`
22+
23+
From 'samples':
24+
25+
`npm run build --workspace=deckgl-points/`
26+
27+
### Build all of the examples.
28+
29+
From 'samples':
30+
31+
`npm run build-all`
32+
33+
### Run lint to check for problems
34+
35+
`cd samples/deckgl-points`
36+
`npx eslint index.ts`
37+
38+
## Feedback
39+
40+
For feedback related to this sample, please open a new issue on
41+
[GitHub](https://github.com/googlemaps-samples/js-api-samples/issues).
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!doctype html>
2+
<!--
3+
@license
4+
Copyright 2026 Google LLC. All Rights Reserved.
5+
SPDX-License-Identifier: Apache-2.0
6+
-->
7+
<!-- [START maps_deckgl_points] -->
8+
<html>
9+
<head>
10+
<title>deck.gl and Google Maps Platform</title>
11+
<link rel="stylesheet" type="text/css" href="./style.css" />
12+
<script type="module" src="./index.js"></script>
13+
<!-- prettier-ignore -->
14+
<script>(g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})
15+
({key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8", v: "weekly"});</script>
16+
</head>
17+
<body>
18+
<gmp-map center="40, -110" zoom="4" map-id="DEMO_MAP_ID"></gmp-map>
19+
</body>
20+
</html>
21+
<!-- [END maps_deckgl_points] -->
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/**
2+
* @license
3+
* Copyright 2026 Google LLC. All Rights Reserved.
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
// [START maps_deckgl_points]
7+
8+
import { Feature } from 'geojson';
9+
import { GoogleMapsOverlay } from '@deck.gl/google-maps';
10+
import { GeoJsonLayer } from '@deck.gl/layers';
11+
12+
type Properties = { mag: number };
13+
14+
const mapElement = document.querySelector('gmp-map') as google.maps.MapElement;
15+
let innerMap: google.maps.Map;
16+
17+
interface EarthquakeProperties {
18+
mag: number;
19+
place: string;
20+
time: number;
21+
}
22+
23+
/**
24+
* Validates that a feature has the properties we need for rendering.
25+
*/
26+
function isEarthquake(f: Feature): f is Feature & { properties: EarthquakeProperties } {
27+
return (
28+
f.properties !== null &&
29+
typeof f.properties === 'object' &&
30+
typeof (f.properties as any).mag === 'number'
31+
);
32+
}
33+
34+
// Initialize and add the map
35+
async function initMap() {
36+
// Request the needed libraries.
37+
await google.maps.importLibrary('maps');
38+
39+
innerMap = await mapElement.innerMap;
40+
41+
const deckOverlay = new GoogleMapsOverlay({
42+
layers: [
43+
new GeoJsonLayer({
44+
id: 'earthquakes',
45+
data: 'https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_month.geojson',
46+
filled: true,
47+
pointRadiusMinPixels: 2,
48+
pointRadiusMaxPixels: 200,
49+
opacity: 0.4,
50+
pointRadiusScale: 0.3,
51+
getPointRadius: (f: Feature): number => {
52+
if (isEarthquake(f)) {
53+
return Math.pow(10, f.properties.mag);
54+
}
55+
return 0; // Fallback for invalid data.
56+
},
57+
getFillColor: (f: Feature): [number, number, number, number] => {
58+
return [255, 70, 30, 180]; // Default color for other earthquakes.
59+
},
60+
autoHighlight: true,
61+
transitions: {
62+
getPointRadius: {
63+
type: 'spring',
64+
stiffness: 0.1,
65+
damping: 0.15,
66+
enter: () => [0], // grow from size 0,
67+
duration: 10000,
68+
},
69+
},
70+
onDataLoad: () => {
71+
console.log('Data is loaded.');
72+
},
73+
}),
74+
],
75+
});
76+
77+
deckOverlay.setMap(innerMap);
78+
}
79+
80+
initMap();
81+
// [END maps_deckgl_points]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "@js-api-samples/deckgl-points",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"build": "tsc && bash ../jsfiddle.sh deckgl-points && bash ../app.sh deckgl-points && bash ../docs.sh deckgl-points && npm run build:vite --workspace=. && bash ../dist.sh deckgl-points",
6+
"test": "tsc && npm run build:vite --workspace=.",
7+
"start": "tsc && vite build --base './' && vite",
8+
"build:vite": "vite build --base './'",
9+
"preview": "vite preview"
10+
},
11+
"dependencies": {
12+
"@deck.gl/core": "^8.9.0",
13+
"@deck.gl/google-maps": "^8.9.0",
14+
"@deck.gl/layers": "^8.9.0",
15+
"deck.gl": "^8.9.0"
16+
}
17+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
* @license
3+
* Copyright 2026 Google LLC. All Rights Reserved.
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
:root {
7+
--mdc-theme-primary: #1a73e8;
8+
--mdc-theme-secondary: #rgb(225, 245, 254);
9+
--mdc-theme-on-primary: #fff;
10+
--mdc-theme-on-secondary: rgb(1, 87, 155);
11+
}
12+
13+
.mdc-text-field--focused:not(.mdc-text-field--disabled) .mdc-floating-label {
14+
color: var(--mdc-theme-primary);
15+
}
16+
17+
/* [START maps_deckgl_points] */
18+
/*
19+
* Optional: Makes the sample page fill the window.
20+
*/
21+
html,
22+
body {
23+
height: 100%;
24+
margin: 0;
25+
padding: 0;
26+
}
27+
28+
/* [END maps_deckgl_points] */
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"compilerOptions": {
3+
"module": "esnext",
4+
"target": "esnext",
5+
"strict": true,
6+
"noImplicitAny": false,
7+
"skipLibCheck": true,
8+
"lib": [
9+
"es2015",
10+
"esnext",
11+
"es6",
12+
"dom",
13+
"dom.iterable"
14+
],
15+
"moduleResolution": "Node",
16+
"jsx": "preserve"
17+
}
18+
}

dist/samples/deckgl-points/dist/assets/index-BcDlnQP2.js

Lines changed: 1639 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/samples/deckgl-points/dist/assets/index-CSJjPZy4.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)