diff --git a/dist/samples/3d-marker-customization/app/index.html b/dist/samples/3d-marker-customization/app/index.html index c466ccf4c..bc048bf6d 100644 --- a/dist/samples/3d-marker-customization/app/index.html +++ b/dist/samples/3d-marker-customization/app/index.html @@ -14,7 +14,8 @@ diff --git a/dist/samples/3d-marker-customization/app/index.ts b/dist/samples/3d-marker-customization/app/index.ts index 5b656cae7..1845e2ccc 100644 --- a/dist/samples/3d-marker-customization/app/index.ts +++ b/dist/samples/3d-marker-customization/app/index.ts @@ -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({ @@ -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); diff --git a/dist/samples/3d-marker-customization/dist/assets/index-BgKHEMX0.js b/dist/samples/3d-marker-customization/dist/assets/index-BgKHEMX0.js deleted file mode 100644 index 6e0d46e79..000000000 --- a/dist/samples/3d-marker-customization/dist/assets/index-BgKHEMX0.js +++ /dev/null @@ -1 +0,0 @@ -(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();async function e(){let[{Map3DElement:e,Marker3DElement:t},{PinElement:n}]=await Promise.all([google.maps.importLibrary(`maps3d`),google.maps.importLibrary(`marker`)]),r=new e({center:{lat:37.4176,lng:-122.02,altitude:0},tilt:67.5,range:7e3,mode:`HYBRID`});r.mode=`SATELLITE`;let i=new n({borderColor:`#FFFFFF`}),a=new t({position:{lat:37.415,lng:-122.035}});a.append(i);let o=new t({position:{lat:37.419,lng:-122.03},label:`Simple label`}),s=new n({scale:1.5}),c=new t({position:{lat:37.419,lng:-122.02}});c.append(s);let l=new n({glyphColor:`white`}),u=new t({position:{lat:37.415,lng:-122.025}});u.append(l);let d=new n({background:`#F0F6FC`,glyphText:`E`,glyphColor:`red`,borderColor:`#0000FF`}),f=new t({position:{lat:37.415,lng:-122.015,altitude:50},extruded:!0,altitudeMode:`RELATIVE_TO_GROUND`});f.append(d);let p=new t({position:{lat:37.4239163,lng:-122.0947209,altitude:100},altitudeMode:`RELATIVE_TO_GROUND`,extruded:!0}),m=new n({glyphText:``}),h=new t({position:{lat:37.415,lng:-122.005}});h.append(m);let g=new n({background:`#FBBC04`}),_=new t({position:{lat:37.419,lng:-122.01}});_.append(g),r.append(o),r.append(c),r.append(_),r.append(a),r.append(u),r.append(f),r.append(h),r.append(p),document.body.append(r)}e(); \ No newline at end of file diff --git a/dist/samples/3d-marker-customization/dist/assets/index-a5EaghHL.js b/dist/samples/3d-marker-customization/dist/assets/index-a5EaghHL.js new file mode 100644 index 000000000..2be900657 --- /dev/null +++ b/dist/samples/3d-marker-customization/dist/assets/index-a5EaghHL.js @@ -0,0 +1 @@ +(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();async function e(){let[{Map3DElement:e,Marker3DElement:t,Label3DElement:n},{PinElement:r,CollisionBehavior:i}]=await Promise.all([google.maps.importLibrary(`maps3d`),google.maps.importLibrary(`marker`)]),a=new e({center:{lat:37.4176,lng:-122.02,altitude:0},tilt:67.5,range:7e3,mode:`SATELLITE`}),o=new r({borderColor:`#FFFFFF`}),s=new t({position:{lat:37.415,lng:-122.035}});s.append(o);let c=new t({position:{lat:37.419,lng:-122.03},label:`Simple label`}),l=new r({scale:1.5}),u=new t({position:{lat:37.419,lng:-122.02}});u.append(l);let d=new r({glyphColor:`white`}),f=new t({position:{lat:37.415,lng:-122.025}});f.append(d);let p=new r({background:`#F0F6FC`,glyphText:`E`,glyphColor:`red`,borderColor:`#0000FF`}),m=new t({position:{lat:37.415,lng:-122.015,altitude:50},extruded:!0,altitudeMode:`RELATIVE_TO_GROUND`});m.append(p);let h=new t({position:{lat:37.4239163,lng:-122.0947209,altitude:100},altitudeMode:`RELATIVE_TO_GROUND`,extruded:!0}),g=new r({glyphText:``}),_=new t({position:{lat:37.415,lng:-122.005}});_.append(g);let v=new r({background:`#FBBC04`}),y=new t({position:{lat:37.419,lng:-122.01}});y.append(v);let b=new t({position:{lat:37.423,lng:-122.015}});b.id=`marker-1`;let x=new n({collisionBehavior:i.OPTIONAL_AND_HIDES_LOWER_PRIORITY,for:`marker-1`});x.append(`Independent label example`),a.append(b),a.append(x),a.append(c),a.append(u),a.append(y),a.append(s),a.append(f),a.append(m),a.append(_),a.append(h),document.body.append(a)}e(); \ No newline at end of file diff --git a/dist/samples/3d-marker-customization/dist/index.html b/dist/samples/3d-marker-customization/dist/index.html index 48bdcdcab..f199a0d32 100644 --- a/dist/samples/3d-marker-customization/dist/index.html +++ b/dist/samples/3d-marker-customization/dist/index.html @@ -12,10 +12,11 @@ - + diff --git a/dist/samples/3d-marker-customization/docs/index.html b/dist/samples/3d-marker-customization/docs/index.html index c466ccf4c..bc048bf6d 100644 --- a/dist/samples/3d-marker-customization/docs/index.html +++ b/dist/samples/3d-marker-customization/docs/index.html @@ -14,7 +14,8 @@ diff --git a/dist/samples/3d-marker-customization/docs/index.js b/dist/samples/3d-marker-customization/docs/index.js index a6f292bb7..41832b49c 100644 --- a/dist/samples/3d-marker-customization/docs/index.js +++ b/dist/samples/3d-marker-customization/docs/index.js @@ -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({ @@ -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); diff --git a/dist/samples/3d-marker-customization/docs/index.ts b/dist/samples/3d-marker-customization/docs/index.ts index 5b656cae7..1845e2ccc 100644 --- a/dist/samples/3d-marker-customization/docs/index.ts +++ b/dist/samples/3d-marker-customization/docs/index.ts @@ -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({ @@ -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); diff --git a/dist/samples/3d-marker-customization/jsfiddle/demo.html b/dist/samples/3d-marker-customization/jsfiddle/demo.html index 9d0425112..c3b72e144 100644 --- a/dist/samples/3d-marker-customization/jsfiddle/demo.html +++ b/dist/samples/3d-marker-customization/jsfiddle/demo.html @@ -14,7 +14,8 @@ diff --git a/dist/samples/3d-marker-customization/jsfiddle/demo.js b/dist/samples/3d-marker-customization/jsfiddle/demo.js index 6195b4707..9e96615f3 100644 --- a/dist/samples/3d-marker-customization/jsfiddle/demo.js +++ b/dist/samples/3d-marker-customization/jsfiddle/demo.js @@ -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', @@ -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);