Questions tagged [google-map-react]
87 questions
0
votes
1 answer
How to pass a state's value into props in React class component
I am getting geocode locations into the latt,lngg variables through axios and setState , i want to use this variables inside google-map-react package center How can i pass these state values into props .
Rest API
then(res => {
…

AnotherOne
- 78
- 2
- 11
0
votes
0 answers
How to use Link component inside marker infowindow in nextjs
Hi I am implementing google map in my nextjs app
Here is my map.js component file
import { AsYouType } from 'libphonenumber-js'
import { useState } from 'react';
import {get_location_slug} from '../utility/calculate_distance'
const phoneFormat =…

Puja Garg
- 251
- 3
- 11
0
votes
1 answer
How to click on markers in Google-Map-React?
my implementation of GoogleMapReact looks like this:

Red Baron
- 7,181
- 10
- 39
- 86
0
votes
0 answers
How to get roughly the whole country on the screen with zoom with 'google-map-react'?
basically I have this so far:
this is great and works for some countries. but when I put in different lat/lng then the zoom is…

Red Baron
- 7,181
- 10
- 39
- 86
0
votes
1 answer
Invalid prop 'children' of type 'array' supplied to 'InfoWindow', expected a single ReactElement
render() {
const { showingInfoWindow, activePosition, selected } = this.state;
return (

omcc
- 25
- 1
- 5
0
votes
1 answer
Dynamically change radius and update current position (google-map-react)
I am using google-map-react and want to be able to dynamically change position and radius. Currently the chosen radius is stored in a database and is fetched using the getRadius() function, but I don't know how and when to call it, therefore the…

Siri
- 1
- 1
0
votes
1 answer
How to find user location on google map and focusing on where they're located using google-map-react library
I am trying to use google-map-react library to locate the user's current location on Google Maps. I managed to use react-geolocated to get coordinates and fed them into the Latitude and Longitude props in the GoogleMapReact component but it was very…

muwonge nicholus
- 96
- 3
- 9
0
votes
1 answer
ReactJS - JavaScript: How to zoom on customized marker after click on it
Usig google-map-react, how do I zoom on a customized marker after I click on it?
I am able to click on the marker but it is not zooming after the click.
Below a snippet of code for the most important parts:
GoogleMap.js
import React, { Component }…

Emanuele
- 2,194
- 6
- 32
- 71
0
votes
3 answers
Function is declared but its value is never used
I am trying to create a dropdown menu carrying some checkboxes.
I found this reference and think is very valuable. I was implementing it in my example code but I get the function is declared but its value is never used error and don't understand…

Emanuele
- 2,194
- 6
- 32
- 71
0
votes
0 answers
Google Maps zoom-in/zoom-out buttons tilted
I am using google-map-react in one of my react sites:
https://pioneeredu.ca/school-boards/on-sb/ca-on-tdsb
The codes for generating the maps are almost the same as in the google-map-react examples. However, the zoom-in/zoom-out buttons are tilted.…

CodecDev
- 1
0
votes
2 answers
google-map-react populate multiple markers
I am currently trying to populate my google map with markers by using the map function. I can't seem to get anything to populate. Are there limitations that I am not understanding or am I missing something? I tried replacing FontAwesomeIcon with…

justinseo
- 61
- 6
0
votes
2 answers
How to use the same google map component instance on any child?
I'm looking for a way to use the same google map instance anywhere in my app. Each map load is charged after all...
I'm using google-map-react. A new Map instance is created on ComponentDidMount, so to me it makes sense that the 1st requirement…

Andros Rosa
- 23
- 3
0
votes
0 answers
Create markers on Google-maps, pull coordinates of location from API into the map
i am using google maps react.
I am trying to fetch data on latitude and longitude from my APIinto the Google Maps as markers.
Getting an error "TypeError: markers.map is not a function"
here is code snippet -
const [markers,setmarkers] =…

oceans
- 5
- 1
- 3
0
votes
0 answers
React component's local state not getting updated with onChildClick
I'm trying to update the react component's local state when an element is clicked
onChildClick={this.onChildClickCallback}
where onChildClickCallback is a helper function outside the render which is as follows:
onChildClickCallback = key => {
…

beta programmers
- 513
- 2
- 8
- 23
0
votes
1 answer
react google map returns empty element _ react
this is my react Map component.
import GoogleMapReact from 'google-map-react';
this.state = {
center: {
lat: 59.95,
lng: 30.33
},
}

Babak Abadkheir
- 2,222
- 1
- 19
- 46