Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

@react-google-maps/api npm

npm i -S @react-google-maps/api
Comment

@react-google-maps/api

with NPM 

npm i -S @react-google-maps/api 

or 

Yarn 
yarn add @react-google-maps/api
Comment

npm google map react

import React from "react";
import GoogleMapReact from 'google-map-react';

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

export default function SimpleMap(){
  const defaultProps = {
    center: {
      lat: 10.99835602,
      lng: 77.01502627
    },
    zoom: 11
  };

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

PREVIOUS NEXT
Code Example
Javascript :: rounding number to x decimals javascript 
Javascript :: how to set css variables in javascript 
Javascript :: number round 
Javascript :: cypress foreach li 
Javascript :: foreach javascript arrow function 
Javascript :: toast message angular 
Javascript :: how to find last element of array react 
Javascript :: sweet alert in java Script 
Javascript :: Error: Unable to resolve module ./index from 
Javascript :: clear html element javascript 
Javascript :: how to get video duration in javascript 
Javascript :: renemane object key js 
Javascript :: $lookup in mongodb 
Javascript :: datetime to date javascript 
Javascript :: jquery show password 
Javascript :: javascript format date time 
Javascript :: deserialize json jquery 
Javascript :: chart js small bars too thin 
Javascript :: pipe data to json angular 
Javascript :: click events javascript 
Javascript :: res.locals in express 
Javascript :: how to know actual scroll js 
Javascript :: get closest parent tr table row jquery 
Javascript :: currying in javascript 
Javascript :: ruby hash to json 
Javascript :: array_diff in jquery 
Javascript :: javascript 1 line if 
Javascript :: jqery get text 
Javascript :: ionic react use yarn 
Javascript :: on resize javascript 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =