mirror of
https://github.com/google-map-react/google-map-react.git
synced 2025-12-08 18:26:32 +00:00
Custom div style options (#634)
* Custom div style options * fix es-lint issue * props naming fix * docs update * words
This commit is contained in:
parent
6bca0a4d37
commit
53e0979acb
4
API.md
4
API.md
@ -153,6 +153,10 @@ To prevent warning message add _yesIWantToUseGoogleMapApiInternals_ property to
|
||||
/>
|
||||
```
|
||||
|
||||
#### overlayViewDivStyle (object)
|
||||
|
||||
Add custom style to `div` (marker container element) created by OverlayView, for example: `{pointerEvents: 'none'}`.
|
||||
|
||||
## Child Component API
|
||||
|
||||
### parameters
|
||||
|
||||
@ -601,6 +601,15 @@ export default class GoogleMap extends Component {
|
||||
div.style.width = K_MAX_WIDTH; // prevents some chrome draw defects
|
||||
div.style.height = K_MAX_HEIGHT;
|
||||
|
||||
if (this_.props.overlayViewDivStyle) {
|
||||
const { overlayViewDivStyle } = this_.props;
|
||||
if (typeof overlayViewDivStyle === 'object') {
|
||||
Object.keys(overlayViewDivStyle).forEach(property => {
|
||||
div.style[property] = overlayViewDivStyle[property];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const panes = this.getPanes();
|
||||
panes.overlayMouseTarget.appendChild(div);
|
||||
this_.geoService_.setMapCanvasProjection(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user