title: geolocation in React, use react-google-maps
body: <p>How to change defaultCenter in react-google-maps ?
  I need to find my geolocation and change default values lat and lng.</p>
  
  <pre><code>import React from "react";
  import { withScriptjs, withGoogleMap, GoogleMap, Marker } from "react-google-maps";
  
  const getLocation = () =&gt;{
     const pos = {};
     const geolocation = navigator.geolocation;
     if (geolocation) {
        geolocation.getCurrentPosition(findLocal, showEror);
     }
     function findLocal(position){
        pos.lat = position.coords.latitude;
        pos.lng = position.coords.longitude;
     }
     function showEror(){console.log(Error)}
     return pos;
  };
  const myLocation = getLocation(); // object has lat and lng
  </code></pre>
  
  <p>I need to transfer my data to the component MapWithAMarker next: Сenter={myLocation} and Marker position={myLocation} </p>
  
  <pre><code>class GoogleMapCenter extends React.Component{
      render(){  
      const MapWithAMarker = withScriptjs(withGoogleMap(props =&gt;
          &lt;GoogleMap
              defaultZoom={10}
              defaultCenter={{ lat: -34.397, lng: 150.644 }}&gt;
              {props.isMarkerShown &amp;&amp; &lt;Marker position={{ lat: -34.397, lng: 150.644 }} /&gt;}
          &lt;/GoogleMap&gt;
      ));
  
      return(
          &lt;MapWithAMarker
              isMarkerShown
              googleMapURL="https://maps.googleapis.com/maps/api/js?key=AIzaSyC4R6AN7SmujjPUIGKdyao2Kqitzr1kiRg&amp;v=3.exp"
              loadingElement={&lt;div style={{ height: `100%` }} /&gt;}
              containerElement={&lt;div style={{ height: `400px` }} /&gt;}
              mapElement={&lt;div style={{ height: `100%` }} /&gt;}
          /&gt;
      )
    }
  }
  export default GoogleMapCenter;
  </code></pre>
  
  <p>If I use this.props, it does not work.</p>
  
  <pre><code> &lt;MapWithAMarker
              center={this.props.myLocation}
              position={this.props.myLocation}
              isMarkerShown
              googleMapURL="https://maps.googleapis.com/maps/api/js?key=AIzaSyC4R6AN7SmujjPUIGKdyao2Kqitzr1kiRg&amp;v=3.exp"
              loadingElement={&lt;div style={{ height: `100%` }} /&gt;}
              containerElement={&lt;div style={{ height: `400px` }} /&gt;}
              mapElement={&lt;div style={{ height: `100%` }} /&gt;}
          /&gt;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>        &lt;GoogleMap
              defaultZoom={10}
              defaultCenter={this.props.myLocation}&gt;
              {props.isMarkerShown &amp;&amp; &lt;Marker position={this.props.myLocation} /&gt;}
          &lt;/GoogleMap&gt;
  </code></pre>