Last active
September 12, 2016 16:21
-
-
Save MicheleBertoli/8108a9c47a6381cc36001b4113afa9e9 to your computer and use it in GitHub Desktop.
Gmaps zoom_changed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { Gmaps } from 'react-gmaps'; | |
const App = React.createClass({ | |
handleZoomChanged() { | |
console.log('zoom:', this.refs.Gmaps.getMap().getZoom()); | |
}, | |
render() { | |
return ( | |
<Gmaps | |
height={300} | |
lat={51.5258541} | |
lng={-0.08040660000006028} | |
onZoomChanged={this.handleZoomChanged} | |
ref="Gmaps" | |
width={400} | |
zoom={12} | |
/> | |
); | |
} | |
}); | |
ReactDOM.render(<App />, document.getElementById('gmaps')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment