Adds the given listener function to the given event name. Returns an
identifier for this listener that can be used with
google.maps.event.removeListener
.
Binds a View to a Model.
Gets a value.
Notify all observers of a change on this property. This notifies both objects that are bound to the object's property as well as the object that it is bound to.
Implement this method to fetch or create intermediate data structures before the overlay is drawn that don’t require immediate access to the WebGL rendering context. This method must be implemented to render.
This method is called when the rendering context is lost for any reason, and is where you should clean up any pre-existing GL state, since it is no longer needed.
This method is called once the rendering context is available. Use it to initialize or bind any WebGL state such as shaders or buffer objects.
that allow developers to restore the GL context.
Implement this method to draw WebGL content directly on the map. Note that if the overlay needs a new frame drawn then call google.maps.WebGLOverlayView.requestRedraw.
that allow developers to render content to an associated Google basemap.
This method is called when the overlay is removed from the map with
WebGLOverlayView.setMap(null)
, and is where you should
remove all intermediate objects. This method must be implemented to
render.
Implement this method to handle any GL state updates outside of the render animation frame.
that allow developerse to restore the GL context.
Triggers the map to redraw a frame.
Triggers the map to update GL state.
Sets a value.
Adds the overlay to the map.
The map to access the div, model and view state.
Sets a collection of key-value pairs.
Removes a binding. Unbinding will set the unbound property to the current value. The object will not be notified, as the value has not changed.
Removes all bindings.
Generated using TypeDoc
The WebGL Overlay View provides direct access to the same WebGL rendering context Google Maps Platform uses to render the vector basemap. This use of a shared rendering context provides benefits such as depth occlusion with 3D building geometry, and the ability to sync 2D/3D content with basemap rendering.
With WebGL Overlay View you can add content to your maps using WebGL directly, or popular Graphics libraries like Three.js or deck.gl. To use the overlay, you can extend
google.maps.WebGLOverlayView
and provide an implementation for each of the following lifecycle hooks: google.maps.WebGLOverlayView.onAdd, google.maps.WebGLOverlayView.onContextRestored, google.maps.WebGLOverlayView.onDraw, google.maps.WebGLOverlayView.onContextLost and google.maps.WebGLOverlayView.onRemove.You must call google.maps.WebGLOverlayView.setMap with a valid google.maps.Map object to trigger the call to the
onAdd()
method andsetMap(null)
in order to trigger theonRemove()
method. ThesetMap()
method can be called at the time of construction or at any point afterward when the overlay should be re-shown after removing. TheonDraw()
method will then be called whenever a map property changes that could change the position of the element, such as zoom, center, or map type. WebGLOverlayView may only be added to a vector map having a google.maps.MapOptions.mapId.Access by calling
const {WebGLOverlayView} = await google.maps.importLibrary("maps")
. See https://developers.google.com/maps/documentation/javascript/libraries.