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
27
votes
6 answers

Marker not showing @react-google-maps/api on localhost next.js

I'm aware there are similar questions to this... but nothing has answered my question I'm trying to add a marker to my google map but it is not showing up when I'm running the project locally (It works fine when on my live site) Heres my…
Smokey Dawson
  • 8,827
  • 19
  • 77
  • 152
14
votes
2 answers

Difference between google-map-react and react-google-maps

There are two most popular react abstraction of google maps API(judging by the weekly npm downloads and github repo stars). For a beginner like me, it is very confusing as I am not able to decide what can these libraries bring to my project and what…
uneet7
  • 2,925
  • 7
  • 24
  • 41
11
votes
3 answers

Reposition the center of the map when the location changes?

Hi folks I'm using the react-google-maps library. I'm trying to recenter my map (zoom where the marker is) every time my location changes, but I'm getting a bit lost on how to implement the whole thing. I can see the marker being updated, but the…
intercoder
  • 2,171
  • 7
  • 23
  • 34
11
votes
1 answer

How can I use React with Google Places API, to display place markers on a Google map?

I'm trying to build a similar map as on Airbnb, where you can view place markers as you drag the map around. I would like to display "hotel" markers from the Google Places API on a map. Using the following JavaScript code from Google Maps, I can…
9
votes
1 answer

@react-google-maps/api onClick not working

I'm using @react-google-maps/api library and everything in package has been working correctly. Now I just noticed that component's onClick event has lost its functionality and in my website the functions attached to it are not working. I don't…
Hessuew
  • 583
  • 1
  • 4
  • 23
9
votes
3 answers

React Google Map InfoWindow showing all the info when I click on a single Mark

For some reason when I click on a single Marker all the InfoWindow shows up. I expected one InfoWindow show up when I click on one single Marker. Can someone explain why all the InfoWindow in all the Marker shows up? So when I close it InfoWindow…
Pak Chu
  • 253
  • 1
  • 5
  • 13
8
votes
3 answers

InfoWindow is showing two infowindows using react-google-maps

I'm using the react-google-maps library and I've been doing pretty well so far. My app receives a json with locations from my backend and I'm mapping them to add Markers on the map, they are displaying just fine. These markers have an OnClick…
8
votes
2 answers

How to add marker on map by Click using react-google-maps?

I'm struggling to find a very simple example of how to add a marker(s) to a Google Map when a user left clicks on the map using React-google-maps in components based. Need help. const Map = withScriptjs(withGoogleMap((props) =>
7
votes
1 answer

How i draw a route with react-google-maps component?

I'm traying to draw a route between two points with react-google-maps but is not working for me. Can u help me with this problem? Here's a example of my react component. import React from 'react'; import { withScriptjs, withGoogleMap, …
Raúl C. Rivero
  • 307
  • 1
  • 4
  • 20
7
votes
1 answer

How to disable street view with react-google-maps?

I'm using the react-google-maps package to render a Google Map in my react application. I would like to disable street view. From the documentation, I see there are props for: defaultStreetView streetView I have tried using both with false - but…
stevanpopo
  • 395
  • 3
  • 12
7
votes
1 answer

How to add marker onClick and show my geolocation in google-maps-react?

I found a lot of useful information on google maps documentation but with simple use of js in html, in case of react honestly I don't understand it. Source code: import React, { Component } from 'react'; import {Map, InfoWindow, Marker,…
German Varanytsya
  • 377
  • 1
  • 4
  • 16
7
votes
1 answer

How to curve a Polyline in react-google-maps?

I'm new to React and have been playing around with the react-google-maps package. I'm trying to curve a Polyline that joins two places. After going through the documentation, I'm trying to incorporate the curve polyline function under the 'editable'…
Ritwick
  • 73
  • 1
  • 6
7
votes
5 answers

How to use fitBounds in react-google-map once you have bounds

Where exactly do I call fitBounds or map.fitbounds. I am confused where to put it once I have the bounds or how to use it. I have set the bounds to a local state of bounds. I have looked at this post here react-google-maps: how to use fitBounds,…
Taylor Austin
  • 5,407
  • 15
  • 58
  • 103
6
votes
2 answers

How to add custom ico or SVG as marker icon in @react-google-maps/api

I am using @react-google-maps/api to show Google Map in my React Web application. Following their documentation I have added the marker as follows.
Lenzman
  • 1,177
  • 18
  • 30
6
votes
0 answers

react-google maps vehicle live tracking

I am trying to move the selected marker with deviceId by fetching data from api endpoint. At first render i am fetching the cordinates data for last 1 minute and pushing the cordinates in an empty array declared as Path and after every 30 seconds…
ang_123
  • 61
  • 1
  • 4
1
2 3
30 31