Questions tagged [react-google-maps]

Questions regarding Reactjs component for google maps by tomchentw.

Questions regarding Reactjs component for google maps by tomchentw. https://github.com/tomchentw/react-google-maps.

462 questions
0
votes
1 answer

Is there any way to put a image inside a marker on the google maps?

I am using react-google-maps and want to use user's image inside marker. How can i put dynamic image inside a marker? I tried using icon object of marker but it did not work because it just put a image on the map not inside a marker. Something like…
0
votes
1 answer

How to add street view thumbnail to marker tooltip in Google Maps API

Im trying to embed google maps in my app (using react-google-maps package as a wrapper) and would like to show the street view of the selected location in the marker info window (tooltip). Im trying to understand how to achieve this via reading the…
Aviram Gabay
  • 191
  • 2
  • 15
0
votes
3 answers

ReactJS lifecycle methods not working in sequence

I am working on Google Maps rendering in ReactJS. For that, I am using 'react-google-maps' library. The logical flow is; at the page load, get the user's location and plot them on the map. A user is provided with navigation links to hit different…
Swapnil
  • 801
  • 3
  • 19
  • 42
0
votes
1 answer

IF else statement in React to change the color of markers in Google Maps

So I have a variable "L", that variable can have a value between 1,2,3,4. That is my levels of how serious a crime was committed. I want to change the color of my markers . I have problems understanding where my logic goes in react. This is my code…
developers
  • 95
  • 3
  • 15
0
votes
1 answer

How to create an on and off toggle button for google maps react for a heatmap

I want create a button that turns on and off the heatmap part of this map. I have trouble doing this in react javacript. Not sure where to put the logic and where to put the button ? any help , this an example of the code that google provides…
0
votes
0 answers

How do i parse these two string inside this function in order to be used inside my positions={} , i need integers

I need to parse my "M" and "N", inside my return ( {this.props.policeCall.map(({ A, M, N }) => { …
0
votes
1 answer

Redux store updating but mapStateToProps not updating component props

When I click on a pointer on my Google Maps component, I can see my store being updated in Redux Devtools but mapStateToProps does not seem to update my component props. Therefore, my Google Maps pointers does not open. If I navigate to…
0
votes
2 answers

How to fit multipe circle when using react-google-map?

Below is the way I use to fit multiple markers when I do react-google-map projects. The map.props is marker objects: zoomToMarkers: map => { if (!map) { return } const bounds = new window.google.maps.LatLngBounds() if…
Coolguy
  • 2,225
  • 12
  • 54
  • 81
0
votes
1 answer

Perform action when user clicks on map or marker in react-google-maps

I am trying to implement google maps in my react project using react-google-maps package. The map is visible however I am not able to perform other event actions like onClick. The documentation and examples are not useful as they are using…
0
votes
2 answers

How to set travel mode of google directions api dynamically in reactjs?

I am trying to update the travel mode dynamically based on the selected radio buttons. I have read the documentations of the directions api and have tried the following. class Transport extends React.Component { state={ origin: '', …
rajput sufiyaan
  • 61
  • 1
  • 14
0
votes
1 answer

How to calculate a route between 2 points using google maps directions API in my React app without displaying a map?

I'm trying to calculate a route between 2 points using google maps directions. When I tried the following code, I got an error: Access to fetch at…
0
votes
2 answers

Can't set state when onRadiusChanged

I can not set state in this code. I understand it because I did not bind the function getvalue. Otherwise I cannot call this.radius. I this code this.radius is 5000. If I changed it to getvalues = (e)=> { console.log(e)} it returns undefined. So…
Wouter
  • 427
  • 1
  • 4
  • 15
0
votes
1 answer

Can react-google-maps use Image Map Types?

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…
Phoenix5650
  • 17
  • 11
0
votes
1 answer

cannot access state in componentDidMount

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…
rajatgalav
  • 329
  • 1
  • 6
  • 19
0
votes
1 answer

react-google-maps: how to use fitBounds API in the parent component

I reproduce my issue in this live demo: https://codesandbox.io/s/p3yv83o7x7 Simple speaking, in the following code: class MapWrapper extends React.Component { constructor() { super(); this.state = { zoom: 8, strictMode: false …
Chris Bao
  • 2,418
  • 8
  • 35
  • 62