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

How to import MarkerClusterer from react google maps instead of require

In the example they use const { MarkerClusterer } = require("react-google-maps/lib/components/addons/MarkerClusterer"); , but I want to use import. I tried using import { MarkerClusterer } from…
Taylor Austin
  • 5,407
  • 15
  • 58
  • 103
0
votes
1 answer

Correct way to populate 45k elements into attribute in React

I have 45k objects of cordinates in JSON format and I want to put them as markers in my map component. I have the following code: const MapWithMarkers = withGoogleMap(props =>GoogleMap defaultZoom={8} defaultCenter={{ lat: -34.397, lng:…
0
votes
1 answer

react-google-maps multiple markers breaks on open

My app loads all my markers just fine, but crashes when I try and click a marker. I get the following error: "React.Children.only expected to receive a single React element child." In the main map component I build the map and bring in all the…
doublenit
  • 59
  • 1
  • 7
0
votes
0 answers

Pass back coordinates to display in react-google-maps

Below is my code: const SiteGoogleMap = compose( withProps({ googleMapURL: `https://maps.googleapis.com/maps/api/js?key=${GOOGLE_MAP_API_KEY}&v=3.exp&libraries=geometry,drawing,places`, loadingElement:
, …
Coolguy
  • 2,225
  • 12
  • 54
  • 81
0
votes
2 answers

How to stop drawing after completing one polygon or rectangle in DrawingManager on react-google-maps?

I'll use my code as a reference: export default class DrawingContainer extends Component { static propTypes = { onPolygonComplete: PropTypes.func }; state = { drawingMode: 'rectangle' }; render() { return ( …
psr
  • 2,619
  • 4
  • 32
  • 57
0
votes
0 answers

react-google-maps use without re-render

I Have 1 task and 1 problem. I use react-google-maps . My task is: add markers by the event. My problem - after every adding point position marker re-render component GoogleMap. And map has flicker effect if i use statefull component or HOC. I've…
0
votes
2 answers

props dont get passed when submitting Form

I'm trying to pass the Value of my Input Form to my AppMap Component, it centers the Map on the prop city. It works when I hardcode the state of searchValue, but when i submit the form it does not pass the state as a prop to the AppMap Component.…
0
votes
1 answer

Get coordinates (latitude and longitude) from marker in Google Maps

I started to use great package react-google-maps. Could you help me how can I get the values of latitude and longitude from inserted (clicked) marker? If I log returned object I get scope which consist of latitude and longitude.. but I can not…
Štefan Ondáš
  • 358
  • 1
  • 5
  • 18
-1
votes
0 answers

Live Tracking for google react api

How to get live tracking GPS location for google react api as shown in below image check for reference of issue Should i need to use marker or is it a inbuilt feature to track our device GPS Is there any possibility for integrating this gps into…
-1
votes
1 answer

How to auto center coordinates and zoom for multiple markers in react-google-maps/api

I want to show multiple dynamic markers on the map. What I mean by dynamic markers is that the markers are determined by the user's past activity. I want to determine the appropriate zoom level and center coordinates so that the user does not have…
-1
votes
1 answer

Set marker on react-google-maps when user clicks on map

I want to set multiple markers on google maps whenever any user clicking on any location in the map. I am using functional approach in my react app.
-1
votes
3 answers

Markers not rendering using @react-google-maps/api

I'm relatively new to react world and particularly to using google maps. I'm using @react-google-maps/api and React version 18. I'm trying to display multiple locations (as markers), however, they are not being displayed on the initial render. I…
-1
votes
1 answer

Not a LatLng or LatLngLiteral

Uncaught ge {message: 'not a LatLng or LatLngLiteral: in property lat: not a number', name: 'InvalidValueError', stack: 'Error\n at new ge (https://maps.googleapis.com/m…tp://localhost:3001/static/js/bundle.js:82399:27) The latitude and…
-1
votes
1 answer

How can implement react-google-maps DirectionsRenderer in my project

I am building a simple project that if a user clicks a button it should show directions from the user's location to the destination which I mark. Here is my code. I have just implemented some parts but I did not understand how to implement…
Dilshod Sh
  • 264
  • 2
  • 11
-1
votes
3 answers

How to change marker label color of react-google-maps

I am using @react-google-maps/api library. I've integrated google map but I am facing marker label color, I tried very hard but didn't find any solution. Could someone please help me with how to resolve this issue. import { Marker, } from…