react-google-maps

How to focus on the marker position with zoom in react using react-google-maps package

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-02 09:38:08
问题 How to focus with zoom to the marker position. Once the marker position changes to different location I need to manually zoom in and out and go to the market location. Literally I need to manually scroll and zoom into the position of the marker which is difficult. I am using https://github.com/tomchentw/react-google-maps package Sample output of below code. Output Gif Image Link import React from 'react'; import { compose, withStateHandlers } from "recompose"; import { InfoWindow,

How to focus on the marker position with zoom in react using react-google-maps package

非 Y 不嫁゛ 提交于 2021-02-02 09:37:14
问题 How to focus with zoom to the marker position. Once the marker position changes to different location I need to manually zoom in and out and go to the market location. Literally I need to manually scroll and zoom into the position of the marker which is difficult. I am using https://github.com/tomchentw/react-google-maps package Sample output of below code. Output Gif Image Link import React from 'react'; import { compose, withStateHandlers } from "recompose"; import { InfoWindow,

cannot access state in componentDidMount

落花浮王杯 提交于 2021-01-29 21:34:45
问题 I am using library react-google-maps, and i want to use DirectionsRenderer between two nodes. Here is my state this.state={ currentPosition:{lat: 26.84 ,lng: 75.80}, destinationPosition:{lat: 26.84 ,lng: 75.80}, }; I want to show the direction between my current location and marker. And my componentDidMount() is inside render method. Here is the code for render method class map extends React.PureComponent{ constructor(props){ super(props); this.state={ currentPosition:{lat: 26.84 ,lng: 75.80}

Can react-google-maps use Image Map Types?

淺唱寂寞╮ 提交于 2021-01-29 13:19:22
问题 i'm tring to reproduce the example show in: https://developers.google.com/maps/documentation/javascript/examples/maptype-image with react-google-maps. it doesn't seem to have the same class google.maps.ImageMapType. Did u know if there's a class that can help me or if someone already did this, link me the example? <GoogleMap className="maps" defaultZoom={17} defaultCenter={{ lat: 46.215951, lng: 12.306994 }} defaultMapTypeId="moon" defaultExtraMapTypes={[{id:"moon", mapType:{ getTileUrl: