javascript - include google maps geocoder in reactjs -


hello have following code in regular js/html:

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> <script type="text/javascript">   function initialize()   {     var geocoder = new google.maps.geocoder();      ...   } </script> 

now want transfer react component.

export default class map extends component {    initialize() {           var geocoder = new google.maps.geocoder();            ....    }    render(){          .....    } } 

but doesn't work, since don't know how include google maps api component.

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> 

how can that?


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -