I install "meteor add dburles:google-maps" in Meteor. I added this code to the React Component,
...
import { GoogleMaps } from 'meteor/dburles:google-maps';
...
export default class Location extends TrackerReact(React.Component){
constructor(props) {
super(props);
this.state = {
...
};
GoogleMaps.load();
}
componentDidUpdate(){
GoogleMaps.create({
name: 'exampleMap',
element: document.getElementById('basic_map'),
options: {
center: new google.maps.LatLng(-37.8136, 144.9631),
zoom: 8
}
});
}
render() {
...
return (
...
<div id="basic_map" style={{"width":"300px","height":"300px"}}></div>
...
)
}
The problem here is the error "google not defined". I think it is from this line of code,
google.maps.LatLng(-37.8136, 144.9631),
Did I miss something in installation? How can I fix this? I am using Meteor, ReactJs, Flow router and TrackerReact