Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dist/samples/3d-marker-customization/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
<script>
// prettier-ignore
(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))})({
key: "GOOGLE_MAPS_API_KEY"
key: "GOOGLE_MAPS_API_KEY",
v: "alpha"
});
</script>
</head>
Expand Down
36 changes: 28 additions & 8 deletions dist/samples/3d-marker-customization/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,29 @@
* SPDX-License-Identifier: Apache-2.0
*/

/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */

// [START maps_3d_marker_customization]
async function init() {
const [{ Map3DElement, Marker3DElement }, { PinElement }] =
await Promise.all([
google.maps.importLibrary('maps3d'),
google.maps.importLibrary('marker'),
]);
const [
// @ts-expect-error - Label3DElement is not yet in @types/google.maps
{ Map3DElement, Marker3DElement, Label3DElement },
{ PinElement, CollisionBehavior },
] = await Promise.all([
google.maps.importLibrary('maps3d'),
google.maps.importLibrary('marker'),
]);

const map = new Map3DElement({
center: { lat: 37.4176, lng: -122.02, altitude: 0 },
tilt: 67.5,
range: 7000,
mode: 'HYBRID',
mode: 'SATELLITE',
});

map.mode = 'SATELLITE';

// [START maps_3d_marker_customization_pin_border]
// Change the border color.
const pinBorder = new PinElement({
Expand Down Expand Up @@ -105,6 +111,20 @@ async function init() {
markerWithBackground.append(pinBackground);
// [END maps_3d_marker_customization_background]

// [START maps_3d_marker_customization_collisionbehavior]
const markerWithIndependentLabel = new Marker3DElement({
position: { lat: 37.423, lng: -122.015 },
});
markerWithIndependentLabel.id = 'marker-1';
const label = new Label3DElement({
collisionBehavior: CollisionBehavior.OPTIONAL_AND_HIDES_LOWER_PRIORITY,
for: 'marker-1',
});
label.append('Independent label example');
map.append(markerWithIndependentLabel);
map.append(label);
// [END maps_3d_marker_customization_collisionbehavior]

map.append(markerWithLabel);
map.append(markerWithScale);
map.append(markerWithBackground);
Expand Down

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions dist/samples/3d-marker-customization/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
<script>
// prettier-ignore
(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))})({
key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8"
key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8",
v: "alpha"
});
</script>
<script type="module" crossorigin src="./assets/index-BgKHEMX0.js"></script>
<script type="module" crossorigin src="./assets/index-a5EaghHL.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-BVXE32j3.css">
</head>
<body>
Expand Down
3 changes: 2 additions & 1 deletion dist/samples/3d-marker-customization/docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
<script>
// prettier-ignore
(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))})({
key: "GOOGLE_MAPS_API_KEY"
key: "GOOGLE_MAPS_API_KEY",
v: "alpha"
});
</script>
</head>
Expand Down
30 changes: 22 additions & 8 deletions dist/samples/3d-marker-customization/docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@

// [START maps_3d_marker_customization]
async function init() {
const [{ Map3DElement, Marker3DElement }, { PinElement }] =
await Promise.all([
google.maps.importLibrary('maps3d'),
google.maps.importLibrary('marker'),
]);
const [
{ Map3DElement, Marker3DElement, Label3DElement },
{ PinElement, CollisionBehavior },
] = await Promise.all([
google.maps.importLibrary('maps3d'),
google.maps.importLibrary('marker'),
]);

const map = new Map3DElement({
center: { lat: 37.4176, lng: -122.02, altitude: 0 },
tilt: 67.5,
range: 7000,
mode: 'HYBRID',
mode: 'SATELLITE',
});

map.mode = 'SATELLITE';

// [START maps_3d_marker_customization_pin_border]
// Change the border color.
const pinBorder = new PinElement({
Expand Down Expand Up @@ -106,6 +106,20 @@ async function init() {
markerWithBackground.append(pinBackground);
// [END maps_3d_marker_customization_background]

// [START maps_3d_marker_customization_collisionbehavior]
const markerWithIndependentLabel = new Marker3DElement({
position: { lat: 37.423, lng: -122.015 },
});
markerWithIndependentLabel.id = 'marker-1';
const label = new Label3DElement({
collisionBehavior: CollisionBehavior.OPTIONAL_AND_HIDES_LOWER_PRIORITY,
for: 'marker-1',
});
label.append('Independent label example');
map.append(markerWithIndependentLabel);
map.append(label);
// [END maps_3d_marker_customization_collisionbehavior]

map.append(markerWithLabel);
map.append(markerWithScale);
map.append(markerWithBackground);
Expand Down
36 changes: 28 additions & 8 deletions dist/samples/3d-marker-customization/docs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,29 @@
* SPDX-License-Identifier: Apache-2.0
*/

/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */

// [START maps_3d_marker_customization]
async function init() {
const [{ Map3DElement, Marker3DElement }, { PinElement }] =
await Promise.all([
google.maps.importLibrary('maps3d'),
google.maps.importLibrary('marker'),
]);
const [
// @ts-expect-error - Label3DElement is not yet in @types/google.maps
{ Map3DElement, Marker3DElement, Label3DElement },
{ PinElement, CollisionBehavior },
] = await Promise.all([
google.maps.importLibrary('maps3d'),
google.maps.importLibrary('marker'),
]);

const map = new Map3DElement({
center: { lat: 37.4176, lng: -122.02, altitude: 0 },
tilt: 67.5,
range: 7000,
mode: 'HYBRID',
mode: 'SATELLITE',
});

map.mode = 'SATELLITE';

// [START maps_3d_marker_customization_pin_border]
// Change the border color.
const pinBorder = new PinElement({
Expand Down Expand Up @@ -105,6 +111,20 @@ async function init() {
markerWithBackground.append(pinBackground);
// [END maps_3d_marker_customization_background]

// [START maps_3d_marker_customization_collisionbehavior]
const markerWithIndependentLabel = new Marker3DElement({
position: { lat: 37.423, lng: -122.015 },
});
markerWithIndependentLabel.id = 'marker-1';
const label = new Label3DElement({
collisionBehavior: CollisionBehavior.OPTIONAL_AND_HIDES_LOWER_PRIORITY,
for: 'marker-1',
});
label.append('Independent label example');
map.append(markerWithIndependentLabel);
map.append(label);
// [END maps_3d_marker_customization_collisionbehavior]

map.append(markerWithLabel);
map.append(markerWithScale);
map.append(markerWithBackground);
Expand Down
3 changes: 2 additions & 1 deletion dist/samples/3d-marker-customization/jsfiddle/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
<script>
// prettier-ignore
(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))})({
key: "GOOGLE_MAPS_API_KEY"
key: "GOOGLE_MAPS_API_KEY",
v: "alpha"
});
</script>
</head>
Expand Down
28 changes: 20 additions & 8 deletions dist/samples/3d-marker-customization/jsfiddle/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
*/

async function init() {
const [{ Map3DElement, Marker3DElement }, { PinElement }] =
await Promise.all([
google.maps.importLibrary('maps3d'),
google.maps.importLibrary('marker'),
]);
const [
{ Map3DElement, Marker3DElement, Label3DElement },
{ PinElement, CollisionBehavior },
] = await Promise.all([
google.maps.importLibrary('maps3d'),
google.maps.importLibrary('marker'),
]);

const map = new Map3DElement({
center: { lat: 37.4176, lng: -122.02, altitude: 0 },
tilt: 67.5,
range: 7000,
mode: 'HYBRID',
mode: 'SATELLITE',
});

map.mode = 'SATELLITE';

// Change the border color.
const pinBorder = new PinElement({
borderColor: '#FFFFFF',
Expand Down Expand Up @@ -94,6 +94,18 @@ async function init() {
});
markerWithBackground.append(pinBackground);

const markerWithIndependentLabel = new Marker3DElement({
position: { lat: 37.423, lng: -122.015 },
});
markerWithIndependentLabel.id = 'marker-1';
const label = new Label3DElement({
collisionBehavior: CollisionBehavior.OPTIONAL_AND_HIDES_LOWER_PRIORITY,
for: 'marker-1',
});
label.append('Independent label example');
map.append(markerWithIndependentLabel);
map.append(label);

map.append(markerWithLabel);
map.append(markerWithScale);
map.append(markerWithBackground);
Expand Down