Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

google map in react js

import React, { Component } from 'react';
import GoogleMapReact from 'google-map-react';

const AnyReactComponent = ({ text }) => <div>{text}</div>;

class SimpleMap extends Component {
  static defaultProps = {
    center: {
      lat: 59.95,
      lng: 30.33
    },
    zoom: 11
  };

  render() {
    return (
      // Important! Always set the container height explicitly
      <div style={{ height: '100vh', width: '100%' }}>
        <GoogleMapReact
          bootstrapURLKeys={{ key: /* YOUR KEY HERE */ }}
          defaultCenter={this.props.center}
          defaultZoom={this.props.zoom}
        >
          <AnyReactComponent
            lat={59.955413}
            lng={30.337844}
            text="My Marker"
          />
        </GoogleMapReact>
      </div>
    );
  }
}

export default SimpleMap;
Comment

google map react search place

npm install google-map-react
Comment

PREVIOUS NEXT
Code Example
Javascript :: map function react 
Javascript :: xlsx to csv javascript 
Javascript :: encrypt in js 
Javascript :: Material-ui account tree icon 
Javascript :: javascript detectar la pagina 
Javascript :: handlebarsjs each first element 
Javascript :: convert curl response to json format and echo the data 
Javascript :: inherit javascript 
Javascript :: some method javascript 
Javascript :: js event on change focus 
Javascript :: javascript remoe last character from string 
Javascript :: axios post request with authorization header and body 
Javascript :: clear all cookies 
Javascript :: react got error need to enable javascript 
Javascript :: how to enable emit on react in vs code 
Javascript :: nan javascript 
Javascript :: comparing two array of objects in javascript returning differences 
Javascript :: setinterval in react 
Javascript :: javascript get magnitude of number 
Javascript :: jquery replicate div on drag 
Javascript :: is knex built into node js 
Javascript :: get all child element of class javascript 
Javascript :: css variable value changing with javascript 
Javascript :: substring methods example 
Javascript :: access json object in javascript loop 
Javascript :: javascript arr.flat 
Javascript :: abrir dialog angular material 
Javascript :: Not Found The requested URL was not found on this server angular routing when going back to site from ecternal source 
Javascript :: javascript uppercase function 
Javascript :: javascript include a js file from another 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =