Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

@react-google-maps/api npm

npm i -S @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 :: moment format dates 
Javascript :: open json javascript 
Javascript :: js duplicate 
Javascript :: singleton class in js 
Javascript :: async await return promise 
Javascript :: loop backwards javascript 
Javascript :: sweetalert2 redirect after ok 
Javascript :: instance in javascript 
Javascript :: online convert python to javascript 
Javascript :: how to convert string to reverse title case in javascript 
Javascript :: leaflet limit map panning 
Javascript :: hex color js 
Javascript :: useScrollPrecent 
Javascript :: how to make navbar links scroll to component react 
Javascript :: javascript Benefit of Using Symbols in Object 
Javascript :: javascript Skip Items 
Javascript :: javascript Using yield to Pause Execution 
Javascript :: error:0308010C:digital nextjs 
Javascript :: JavaScript / jQuery DOM Selectors 
Javascript :: bootstrap on tabs change 
Javascript :: javascript döngü dizisi 
Javascript :: phaser place items on circle reverse 
Javascript :: phaser animation on stop event 
Javascript :: javascript accordion 
Javascript :: angular reactive forms bootstrap 4 
Javascript :: rxact 6 number long in yup validation 
Javascript :: how to run javascript in terminal 
Javascript :: delete parent js 
Javascript :: javascript basic programs 
Javascript :: what is closures in javascript 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =