Update README.md (#698)

* Update README.md

* Update README.md

* Update README.md

* Add javascript tag

* Update README.md
This commit is contained in:
Michael Diego 2018-12-18 13:32:04 -03:00 committed by GitHub
parent 4d863d9ddc
commit 3d7c9823e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,7 +37,7 @@ class SimpleMap extends Component {
<AnyReactComponent
lat={59.955413}
lng={30.337844}
text={'Kreyser Avrora'}
text="My Marker"
/>
</GoogleMapReact>
</div>
@ -83,6 +83,38 @@ It renders components on the map before (and even without) the Google Maps API l
There is no need to place a `<script src=` tag at top of page. The Google Maps API loads upon the first usage of the `GoogleMapReact` component.
### Anything you can do with Google Maps, you can do with Google Map React
You can access to Google Maps `map` and `maps` objects by using `onGoogleApiLoaded`, in this case you will need to set `yesIWantToUseGoogleMapApiInternals` to `true`
```javascript
...
const handleApiLoaded = (map, maps) => {
// use map and maps objects
};
...
<GoogleMapReact
bootstrapURLKeys={{ key: /* YOUR KEY HERE */ }}
defaultCenter={this.props.center}
defaultZoom={this.props.zoom}
yesIWantToUseGoogleMapApiInternals
onGoogleApiLoaded={({ map, maps }) => handleApiLoaded(map, maps)}
>
<AnyReactComponent
lat={59.955413}
lng={30.337844}
text="My Marker"
/>
</GoogleMapReact>
```
PST: Remember to set `yesIWantToUseGoogleMapApiInternals` to true.
[Example here](https://github.com/google-map-react/google-map-react-examples/blob/master/src/examples/Main.js#L69)
### Internal Hover Algorithm
Now every object on the map can be hovered (however, you can still use css hover selectors if you want). If you try zooming out here [example](http://google-map-react.github.io/google-map-react/map/main), you will still be able to hover on almost every map marker.