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
5 changes: 4 additions & 1 deletion dist/samples/3d-camera-to-around/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,19 @@ async function init() {
};

// Fly the camera from San Francisco to Hawaii, can be controlled by a button alternatively.
// [START maps_3d_camera_to_around_flyto]
map.flyCameraTo({
// Where we are going to.
endCamera: flyToCamera,
// How long we want the flight to take.
durationMillis: 30000,
});

// [END maps_3d_camera_to_around_flyto]
// When the animation has completed, fly around the location.
map.addEventListener(
'gmp-animationend',
() => {
// [START maps_3d_camera_to_around_flyaround]
map.flyCameraAround({
// Location to fly around.
camera: flyToCamera,
Expand All @@ -56,6 +58,7 @@ async function init() {
// Number of rotations to make in the specified time.
repeatCount: 1,
});
// [END maps_3d_camera_to_around_flyaround]
},
{ once: true }
); // Stop animation after flying around.
Expand Down
5 changes: 4 additions & 1 deletion dist/samples/3d-camera-to-around/docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,19 @@ async function init() {
};

// Fly the camera from San Francisco to Hawaii, can be controlled by a button alternatively.
// [START maps_3d_camera_to_around_flyto]
map.flyCameraTo({
// Where we are going to.
endCamera: flyToCamera,
// How long we want the flight to take.
durationMillis: 30000,
});

// [END maps_3d_camera_to_around_flyto]
// When the animation has completed, fly around the location.
map.addEventListener(
'gmp-animationend',
() => {
// [START maps_3d_camera_to_around_flyaround]
map.flyCameraAround({
// Location to fly around.
camera: flyToCamera,
Expand All @@ -57,6 +59,7 @@ async function init() {
// Number of rotations to make in the specified time.
repeatCount: 1,
});
// [END maps_3d_camera_to_around_flyaround]
},
{ once: true }
); // Stop animation after flying around.
Expand Down
5 changes: 4 additions & 1 deletion dist/samples/3d-camera-to-around/docs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,19 @@ async function init() {
};

// Fly the camera from San Francisco to Hawaii, can be controlled by a button alternatively.
// [START maps_3d_camera_to_around_flyto]
map.flyCameraTo({
// Where we are going to.
endCamera: flyToCamera,
// How long we want the flight to take.
durationMillis: 30000,
});

// [END maps_3d_camera_to_around_flyto]
// When the animation has completed, fly around the location.
map.addEventListener(
'gmp-animationend',
() => {
// [START maps_3d_camera_to_around_flyaround]
map.flyCameraAround({
// Location to fly around.
camera: flyToCamera,
Expand All @@ -56,6 +58,7 @@ async function init() {
// Number of rotations to make in the specified time.
repeatCount: 1,
});
// [END maps_3d_camera_to_around_flyaround]
},
{ once: true }
); // Stop animation after flying around.
Expand Down
1 change: 1 addition & 0 deletions dist/samples/3d-camera-to-around/jsfiddle/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ async function init() {
};

// Fly the camera from San Francisco to Hawaii, can be controlled by a button alternatively.

map.flyCameraTo({
// Where we are going to.
endCamera: flyToCamera,
Expand Down
4 changes: 3 additions & 1 deletion dist/samples/3d-marker-collision-behavior/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ async function init() {
});

for (const [lng, lat] of positions) {
// [START maps_3d_marker_collision_behavior_setbehavior]
const marker = new Marker3DElement({
position: { lat, lng },
// Try setting a different collision behavior here.
collisionBehavior: 'REQUIRED',
});
// [END maps_3d_marker_collision_behavior_setbehavior]

markers.push(marker);
map.append(marker);
Expand Down Expand Up @@ -59,7 +61,7 @@ dropdown.addEventListener('change', drawMap);
function drawMap() {
for (const marker of markers) {
marker.collisionBehavior =
(dropdown.value as google.maps.CollisionBehavior) || 'REQUIRED';
dropdown.value as google.maps.CollisionBehavior;
}
}

Expand Down

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

2 changes: 1 addition & 1 deletion dist/samples/3d-marker-collision-behavior/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8"
});
</script>
<script type="module" crossorigin src="./assets/index-Bksae6wd.js"></script>
<script type="module" crossorigin src="./assets/index-DdMMonGb.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-Cbor2Vab.css">
</head>
<body>
Expand Down
4 changes: 3 additions & 1 deletion dist/samples/3d-marker-collision-behavior/docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ async function init() {
});

for (const [lng, lat] of positions) {
// [START maps_3d_marker_collision_behavior_setbehavior]
const marker = new Marker3DElement({
position: { lat, lng },
// Try setting a different collision behavior here.
collisionBehavior: 'REQUIRED',
});
// [END maps_3d_marker_collision_behavior_setbehavior]

markers.push(marker);
map.append(marker);
Expand Down Expand Up @@ -57,7 +59,7 @@ dropdown.addEventListener('change', drawMap);

function drawMap() {
for (const marker of markers) {
marker.collisionBehavior = dropdown.value || 'REQUIRED';
marker.collisionBehavior = dropdown.value;
}
}

Expand Down
4 changes: 3 additions & 1 deletion dist/samples/3d-marker-collision-behavior/docs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ async function init() {
});

for (const [lng, lat] of positions) {
// [START maps_3d_marker_collision_behavior_setbehavior]
const marker = new Marker3DElement({
position: { lat, lng },
// Try setting a different collision behavior here.
collisionBehavior: 'REQUIRED',
});
// [END maps_3d_marker_collision_behavior_setbehavior]

markers.push(marker);
map.append(marker);
Expand Down Expand Up @@ -59,7 +61,7 @@ dropdown.addEventListener('change', drawMap);
function drawMap() {
for (const marker of markers) {
marker.collisionBehavior =
(dropdown.value as google.maps.CollisionBehavior) || 'REQUIRED';
dropdown.value as google.maps.CollisionBehavior;
}
}

Expand Down
2 changes: 1 addition & 1 deletion dist/samples/3d-marker-collision-behavior/jsfiddle/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ dropdown.addEventListener('change', drawMap);

function drawMap() {
for (const marker of markers) {
marker.collisionBehavior = dropdown.value || 'REQUIRED';
marker.collisionBehavior = dropdown.value;
}
}
21 changes: 20 additions & 1 deletion dist/samples/3d-marker-customization/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ async function init() {

map.mode = 'SATELLITE';

// [START maps_3d_marker_customization_pin_border]
// Change the border color.
const pinBorder = new PinElement({
borderColor: '#FFFFFF',
Expand All @@ -30,13 +31,15 @@ async function init() {
position: { lat: 37.415, lng: -122.035 },
});
markerWithBorder.append(pinBorder);
// [END maps_3d_marker_customization_pin_border]

// Add a label.
const markerWithLabel = new Marker3DElement({
position: { lat: 37.419, lng: -122.03 },
label: 'Simple label',
});

// [START maps_3d_marker_customization_scale]
// Adjust the scale.
const pinScaled = new PinElement({
scale: 1.5,
Expand All @@ -45,7 +48,9 @@ async function init() {
position: { lat: 37.419, lng: -122.02 },
});
markerWithScale.append(pinScaled);
// [END maps_3d_marker_customization_scale]

// [START maps_3d_marker_customization_glyph_color]
// Change the glyph color.
const pinGlyph = new PinElement({
glyphColor: 'white',
Expand All @@ -54,7 +59,9 @@ async function init() {
position: { lat: 37.415, lng: -122.025 },
});
markerWithGlyphColor.append(pinGlyph);
// [END maps_3d_marker_customization_glyph_color]

// [START maps_3d_marker_customization_glyph_text]
// Change many elements together and extrude marker.
const pinTextGlyph = new PinElement({
background: '#F0F6FC',
Expand All @@ -68,6 +75,16 @@ async function init() {
altitudeMode: 'RELATIVE_TO_GROUND',
});
markerWithGlyphText.append(pinTextGlyph);
// [END maps_3d_marker_customization_glyph_text]

// [START maps_3d_marker_customization_extruded]
// Change a marker's altitude and add an extrusion.
const extrudedMarker = new Marker3DElement({
position: { lat: 37.4239163, lng: -122.0947209, altitude: 100 },
altitudeMode: 'RELATIVE_TO_GROUND',
extruded: true,
});
// [END maps_3d_marker_customization_extruded]

// Hide the glyph.
const pinNoGlyph = new PinElement({
Expand All @@ -77,7 +94,7 @@ async function init() {
position: { lat: 37.415, lng: -122.005 },
});
markerWithNoGlyph.append(pinNoGlyph);

// [START maps_3d_marker_customization_background]
// Change the background color.
const pinBackground = new PinElement({
background: '#FBBC04',
Expand All @@ -87,6 +104,7 @@ async function init() {
position: { lat: 37.419, lng: -122.01 },
});
markerWithBackground.append(pinBackground);
// [END maps_3d_marker_customization_background]

map.append(markerWithLabel);
map.append(markerWithScale);
Expand All @@ -95,6 +113,7 @@ async function init() {
map.append(markerWithGlyphColor);
map.append(markerWithGlyphText);
map.append(markerWithNoGlyph);
map.append(extrudedMarker);

document.body.append(map);
}
Expand Down

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

2 changes: 1 addition & 1 deletion dist/samples/3d-marker-customization/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
key: "AIzaSyA6myHzS10YXdcazAFalmXvDkrYCp5cLc8"
});
</script>
<script type="module" crossorigin src="./assets/index-F8rmfRi2.js"></script>
<script type="module" crossorigin src="./assets/index-DdOsP7L-.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-BVXE32j3.css">
</head>
<body>
Expand Down
21 changes: 20 additions & 1 deletion dist/samples/3d-marker-customization/docs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ async function init() {

map.mode = 'SATELLITE';

// [START maps_3d_marker_customization_pin_border]
// Change the border color.
const pinBorder = new PinElement({
borderColor: '#FFFFFF',
Expand All @@ -31,13 +32,15 @@ async function init() {
position: { lat: 37.415, lng: -122.035 },
});
markerWithBorder.append(pinBorder);
// [END maps_3d_marker_customization_pin_border]

// Add a label.
const markerWithLabel = new Marker3DElement({
position: { lat: 37.419, lng: -122.03 },
label: 'Simple label',
});

// [START maps_3d_marker_customization_scale]
// Adjust the scale.
const pinScaled = new PinElement({
scale: 1.5,
Expand All @@ -46,7 +49,9 @@ async function init() {
position: { lat: 37.419, lng: -122.02 },
});
markerWithScale.append(pinScaled);
// [END maps_3d_marker_customization_scale]

// [START maps_3d_marker_customization_glyph_color]
// Change the glyph color.
const pinGlyph = new PinElement({
glyphColor: 'white',
Expand All @@ -55,7 +60,9 @@ async function init() {
position: { lat: 37.415, lng: -122.025 },
});
markerWithGlyphColor.append(pinGlyph);
// [END maps_3d_marker_customization_glyph_color]

// [START maps_3d_marker_customization_glyph_text]
// Change many elements together and extrude marker.
const pinTextGlyph = new PinElement({
background: '#F0F6FC',
Expand All @@ -69,6 +76,16 @@ async function init() {
altitudeMode: 'RELATIVE_TO_GROUND',
});
markerWithGlyphText.append(pinTextGlyph);
// [END maps_3d_marker_customization_glyph_text]

// [START maps_3d_marker_customization_extruded]
// Change a marker's altitude and add an extrusion.
const extrudedMarker = new Marker3DElement({
position: { lat: 37.4239163, lng: -122.0947209, altitude: 100 },
altitudeMode: 'RELATIVE_TO_GROUND',
extruded: true,
});
// [END maps_3d_marker_customization_extruded]

// Hide the glyph.
const pinNoGlyph = new PinElement({
Expand All @@ -78,7 +95,7 @@ async function init() {
position: { lat: 37.415, lng: -122.005 },
});
markerWithNoGlyph.append(pinNoGlyph);

// [START maps_3d_marker_customization_background]
// Change the background color.
const pinBackground = new PinElement({
background: '#FBBC04',
Expand All @@ -88,6 +105,7 @@ async function init() {
position: { lat: 37.419, lng: -122.01 },
});
markerWithBackground.append(pinBackground);
// [END maps_3d_marker_customization_background]

map.append(markerWithLabel);
map.append(markerWithScale);
Expand All @@ -96,6 +114,7 @@ async function init() {
map.append(markerWithGlyphColor);
map.append(markerWithGlyphText);
map.append(markerWithNoGlyph);
map.append(extrudedMarker);

document.body.append(map);
}
Expand Down
Loading