OverlayView component allows you to render custom React content on a map at a specific geographic position or within specific bounds.
Import
Usage
Props
The map pane in which to display the overlay. See Pane Constants below.
The React content to render in the overlay.
The geographic position at which to anchor the overlay.
The bounds within which to position the overlay. Alternative to
position.The z-index of the overlay.
A function that returns the pixel offset for positioning the overlay relative to the anchor point.Parameters:
offsetWidth: The width of the overlay elementoffsetHeight: The height of the overlay element
x and y pixel offsetsCallback invoked when the overlay has been mounted and is ready.
Callback invoked when the overlay is about to be unmounted.
Pane Constants
The library exports constants for the available map panes. Use these with themapPaneName prop:
Pane for overlays that should float above all other map content. This pane is the topmost pane and appears above markers.
Pane containing the map’s tiles. This is the base layer.
Pane containing markers. This appears above the map tiles.
Pane containing polylines, polygons, ground overlays, and tile layer overlays.
Pane for elements that should receive DOM mouse events. This is the most commonly used pane for interactive overlays.