Questions tagged [google-map-react]
87 questions
0
votes
1 answer
How can I set another state to pass data to from the initial state in a react class component
can anyone help me out and explain how I can set another state in this component:
export class MapContainer extends Component {
constructor(props) {
super(props);
this.state = {
attorneys: []
}
}
…

mcdoodle
- 3
- 1
0
votes
1 answer
How does a marker in 'google-map-react' get its location based on latitude and longitude from props?
According to https://www.npmjs.com/package/google-map-react, the marker on the map get its location on the map from the longitude and latitude from props.
import React from "react";
import GoogleMapReact from 'google-map-react';
const…

Rongeegee
- 866
- 3
- 10
- 30
0
votes
2 answers
React ref callback updating 'this' to update child props not working
I've been hitting the issue mentioned in this thread where, when using the ref callback the refs are updating AFTER componentDidMount.
Apparently this can happen when you pass refs to elements that are being passed to a component as children, but I…

Weardian
- 211
- 4
- 13
0
votes
1 answer
How to draw Polyline with google-map-react?
Everyone I am using google-map-react and not react-google-map. Can you help me drawing a line between two points.

Fakhar Abbas
- 19
- 3
0
votes
1 answer
GoogleMapReact : Next.js: TypeError: Cannot read properties of undefined (reading 'getChildren')
I'm developing a basic nextjs app with the google-map-react component and nextjs. I got the following error every time I try to use the component
TypeError: can't access property "getChildren", n.props.dispatcher is undefined
Idk what to do .. it…

Matt
- 1
0
votes
1 answer
How to Get latitude and longitude from Google Maps React onClick
i want to get the coordinates of google map react onclick.
this is my code :
return (
{
…

Rival_D21
- 1
- 1
- 1
0
votes
1 answer
Google map react
{!loading ? (

Mohammed Mak
- 47
- 1
- 7
0
votes
1 answer
How do I point to a location on map with a click event
In React, I'm trying to make an onClick event point a marker on a map to a new location using google-map-react library. My map is showing and I have a button on the map but I'm not sure how to make a marker on the map point to a new coordinates I…

Victor Ok
- 11
- 1
0
votes
1 answer
Google Map React Throwing "refused to apply inline styles error"
CSP Issue:
Our project have strict content security issue i.e. we are using style-src * and cannot add unsafe-inline option here.
I am getting "refused to apply inline styles error" and CSS is not applied for google Map due above strict content…

Vishal Shinde
- 11
- 1
0
votes
0 answers
google-map-react - change path colour
I am using google-map-react to render a google map, for a path, using GPS positions. At the moment, I am rendering a path in a single colour.
I would like to change the colour of the line, based on speed. Is there a way to update the colour of the…

Craig
- 18,074
- 38
- 147
- 248
0
votes
1 answer
React.js geo position not working in browser on iPhone/Android
I'm trying to get my position on a map and it works fine on my computer in Google Chrome, but when simulating to android/iPhone nothing happens when using for example Custom Location on iPhone Simulator. Tried it on my actual iPhone as well without…

Michael
- 1
- 3
0
votes
1 answer
Handle button events inside of google.maps.infoWindow - ReactJS
I'm trying to handle the click event of a button inside a google.maps.infoWindow. I tried to pass the function name to onClick via infoWindow contents but didn't work. So, I moved to getElementById but also without success.The return of…

bmalbusca
- 353
- 1
- 4
- 15
0
votes
1 answer
Is there a way to get Formik to work in Internet Explorer 11 using NextJS
I've been creating a small website using NextJS. I used formik and google-map-react to validate a form and show a basic map.
IE11 is "not cooperating" in using these libraries. I've tried changing the babel config and used the next-transpile-modules…

Kurt Van Hal
- 35
- 3
0
votes
1 answer
use-supercluster gets empty array
After figuring out how to deal with TypeScript and use-supercluster library I have "made it work" until I got a new problem: I get an empty array whenever I use useSuperCluster() function.
I am following the creator's guide so I can handle my own…

Maramal
- 3,145
- 9
- 46
- 90
0
votes
1 answer
Ternary operator doesn't work as expected
I have a map component where I need to pass default coordinates which will be coming from custom useSwr hook. After fetching the data I pass them to the state and render it if the values or not undefined. Apparently I do something wrong and its not…

em_code
- 379
- 5
- 17