Skip to content

Instantly share code, notes, and snippets.

@MicheleBertoli
Last active September 12, 2016 16:21
Show Gist options
  • Save MicheleBertoli/8108a9c47a6381cc36001b4113afa9e9 to your computer and use it in GitHub Desktop.
Save MicheleBertoli/8108a9c47a6381cc36001b4113afa9e9 to your computer and use it in GitHub Desktop.
Gmaps zoom_changed
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