Custom div style options (#634)

* Custom div style options

* fix es-lint issue

* props naming fix

* docs update

* words
This commit is contained in:
Jurgis Kacens 2018-09-29 12:37:08 +03:00 committed by Michael Diego
parent 6bca0a4d37
commit 53e0979acb
2 changed files with 13 additions and 0 deletions

4
API.md
View File

@ -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

View File

@ -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(