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 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.
rendering context for developers to access WebGL.
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.
rendering context for developers to access WebGL.
convenience class for providing camera transforms to center objects at latitude/longitude coordinates.
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.
Triggers the map to redraw a frame.
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
Available only in the v=beta channel: https://goo.gle/3oAthT3. 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.