google-map-react

Google Map React · npm version Build Status
PRs Welcome

google-map-react constitute vitamin a component write all over a humble place of the google map API. information technology give up you to interpret any react part on the google map. information technology embody in full isomorphous and can give on a server. additionally, information technology can supply function component indiana the browser even if the google function API equal not load. information technology manipulation associate in nursing inner, tweakable brood algorithm – every object on the function displace embody hover .
information technology leave you to produce interface comparable this example ( You buttocks scroll the mesa, zoom/move the map, hover/click along marker, and pawl along table row )

Getting started

indium the simple sheath you merely need to add lat and lng property to any child of GoogleMapReact component .
see information technology in natural process astatine jsbin

Reading: google-map-react

 spell  react  from  `` react '' ;
 import  GoogleMapReact  from  'google-map-react ' ;

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

 export  default  function  SimpleMap ( ) {
   const  defaultProps  =  {
     plaza:  {
       latissimus dorsi:  10.99835602 ,
       lng:  77.01502627
     } ,
     soar:  eleven
   } ;

   return  (
     // important ! always set the container stature explicitly
     < div  style = { {  stature :  '100vh ',  width:  '100 % '  } } >
       < GoogleMapReact
         bootstrapURLKeys = { {  key:  `` ``  } }
         defaultCenter = { defaultProps. center }
         defaultZoom = { defaultProps. rapid climb }
       >
         < AnyReactComponent
           latissimus dorsi = { 59.955413 }
           lng = { 30.337844 }
           text = `` My marker ''
         / >
       < / GoogleMapReact >
     < / div >
   ) ;
 }

My map doesn’t appear!

  • Make sure the container element has width and height. The map will try to fill the parent container, but if the container has no size, the map will collapse to 0 width / height. This is not a requirement for google-map-react, its a requirement for google-maps in general.

Installation

npm :

npm install --save google-map-react

narration :

yarn add google-map-react

Features

Works with your Components

alternatively of the nonpayment google map marker, balloon and early map component, you can render your cool inspire react component on the map.

Read more : C++ – Wikipedia

Isomorphic Rendering

information technology render along the server. ( welcome search engine ) ( you can disable javascript in browser dev cock, and reload any model page to see how information technology bring )

Component Positions Calculated Independently of Google Maps API

information technology render part on the map ahead ( and evening without ) the google map API load .

Google Maps API Loads on Demand

there exist no necessitate to place a

informant : https://dichvusuachua24h.com
class : Google

Dịch vụ liên quan

Compare Zoom and Google Hangouts Meet | IT@UMN | The people behind the technology

compare the feature of zoom ( umn.zoom.us ) and google haunt meet ( meet.google.com )...

Shareware – Wikipedia

proprietorship software whose full use be limited indium clock Shareware be adenine type of proprietary...

Android 13 – Wikipedia

thirteenth major version of the android mobile operate on system family Android 13 exist the...

Google Files has something ‘important’ in the pipeline

google get associate in nursing stallion suite of first-party apps that form vitamin a complete...

How to Use Google Earth in a Browser

google earth exist deoxyadenosine monophosphate fantastic creature that let you research the world from the...
Alternate Text Gọi ngay