From 087f25289fff4c9cca3beb1f0202c8540dee920e Mon Sep 17 00:00:00 2001 From: Ari Oppenheimer Date: Mon, 24 Aug 2026 13:22:08 -0700 Subject: [PATCH 1/2] Updated marker customization sample for label independence change. --- samples/3d-marker-customization/index.html | 3 ++- samples/3d-marker-customization/index.ts | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/samples/3d-marker-customization/index.html b/samples/3d-marker-customization/index.html index c466ccf4c..bc048bf6d 100644 --- a/samples/3d-marker-customization/index.html +++ b/samples/3d-marker-customization/index.html @@ -14,7 +14,8 @@ diff --git a/samples/3d-marker-customization/index.ts b/samples/3d-marker-customization/index.ts index 5b656cae7..a502cd9da 100644 --- a/samples/3d-marker-customization/index.ts +++ b/samples/3d-marker-customization/index.ts @@ -6,7 +6,7 @@ // [START maps_3d_marker_customization] async function init() { - const [{ Map3DElement, Marker3DElement }, { PinElement }] = + const [{ Map3DElement, Marker3DElement, Label3DElement}, { PinElement }] = await Promise.all([ google.maps.importLibrary('maps3d'), google.maps.importLibrary('marker'), @@ -16,11 +16,9 @@ async function init() { 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({ @@ -105,6 +103,19 @@ 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.419, lng: -122.01 }, + }); + markerWithIndependentLabel.id = 'marker-1'; + const label = new Label3DElement({ + collisionBehavior: google.maps.CollisionBehavior.OPTIONAL_AND_HIDES_LOWER_PRIORITY, + for: 'marker-1', + }); + map.append(markerWithIndependentLabel); + label.append('Collision behavior label'); + // [END maps_3d_marker_customization_collisionbehavior] + map.append(markerWithLabel); map.append(markerWithScale); map.append(markerWithBackground); From 33c2ead5c5efdbe2e9952591fae47c82533ebf06 Mon Sep 17 00:00:00 2001 From: Ari Oppenheimer Date: Mon, 31 Aug 2026 18:24:02 +0200 Subject: [PATCH 2/2] Updated independent label example --- samples/3d-marker-customization/index.ts | 25 ++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/samples/3d-marker-customization/index.ts b/samples/3d-marker-customization/index.ts index a502cd9da..1845e2ccc 100644 --- a/samples/3d-marker-customization/index.ts +++ b/samples/3d-marker-customization/index.ts @@ -4,13 +4,21 @@ * 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, Label3DElement}, { 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 }, @@ -105,15 +113,16 @@ async function init() { // [START maps_3d_marker_customization_collisionbehavior] const markerWithIndependentLabel = new Marker3DElement({ - position: { lat: 37.419, lng: -122.01 }, + position: { lat: 37.423, lng: -122.015 }, }); markerWithIndependentLabel.id = 'marker-1'; const label = new Label3DElement({ - collisionBehavior: google.maps.CollisionBehavior.OPTIONAL_AND_HIDES_LOWER_PRIORITY, + collisionBehavior: CollisionBehavior.OPTIONAL_AND_HIDES_LOWER_PRIORITY, for: 'marker-1', }); + label.append('Independent label example'); map.append(markerWithIndependentLabel); - label.append('Collision behavior label'); + map.append(label); // [END maps_3d_marker_customization_collisionbehavior] map.append(markerWithLabel);