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
3
votes
0 answers

React move marker without re-rendering map in react-google-maps

I am using react-google-maps to display a marker from lat/long data. This works fine but the entire component is rendering every time the marker data is updated. Is there a way to only update the marker? My code is below. The data comes in fast…
Brian Kalski
  • 897
  • 9
  • 35
3
votes
1 answer

How to rotate marker icon (svg image) in react google maps

For my React app, I'm implementing Google Maps. I'm using react-google-maps library for maps. I want to rotate my customize marker icon. I have an SVG file (which has multiple paths and polygon) but Google Maps required in string type only (I think…
3
votes
1 answer

React google map getBounds

I use react-google-maps library and when I get the boundaries through function getBounds. I got the object which looks like this _.Kc {f: Jc, b: Fc} b:Fc {b: -69.44550556640627, f: -69.37409443359377} f:Jc {b: 5.843139027557267, f:…
coinhndp
  • 2,281
  • 9
  • 33
  • 64
3
votes
2 answers

Update Google Map based on Geolocation with React

I'm trying to show Google Map with centering the map based on latitude and longitude which are returned by Geolocation. However, the map shows as the default value and not get rendered by Geolocation values. I set latitude and longitude in component…
shinyatk
  • 855
  • 11
  • 28
3
votes
1 answer

Polyline not rendering on react-google-map

I'm making a geo data visualiser for many types of geometry POINT, LINESTRING, POLYLINE etc. by dynamically generating the , depending on the type. Basically the data is like this, normal geojson etc. "geometry": { "type": "Point", …
mewc
  • 135
  • 10
3
votes
0 answers

Text-based and bounds-based searching with react-google-maps

I'm using react-google-maps to add a map with search functionality that shows nearby, fetched POI's as markers and renders a list of those places below it (a-la Airbnb). This related question covered the majority of what I was aiming for, but I…
3
votes
1 answer

How to change Google Maps Marker icon when user clicked the marker icon

I created the Google Maps using tomchentw react-google-maps. The marker icon by default displays red marker icon, but whenever user clicks the marker icon it should change into grey marker icon and also increases the marker icon size. How can I…
Allu Manikyam
  • 481
  • 1
  • 8
  • 31
3
votes
0 answers

Entire map re-renders when I only want the change marker text in react-google-maps

I'm trying to use the react-google-maps package to show a map with a draggable marker, that has an infowindow that displays the address of the location of the marker. As of now it works and can retrieve the address and display it, however I have…
boking
  • 145
  • 1
  • 12
3
votes
2 answers

How to initialize a StandaloneSearchBox component with a given address?

I have a react component for a google.maps.places.SearchBox without the map, which is a StandaloneSearchBox. I want to pass it props with the initial value (which is only the formated version of the address, e.g "London, Kentucky, États-Unis") and…
3
votes
1 answer

react-google-maps : Super expression must either be null or a function, not undefined

I have this weird error (Super expression must either be null or a function, not undefined) when I just import react-google-maps. Any idea? import React from 'react'; import { GoogleMap } from 'react-google-maps'; class GoogleMapFlow extends…
icfeavoir
  • 41
  • 1
  • 6
3
votes
1 answer

react-google-maps : Can't get bounds

I have the following react component that loads a GoogleMap from 'react-google-maps' library. I'm following the documentation examples but I get undefined from getBounds() function. I think it is due to trying to get the bounds before map is fully…
2
votes
1 answer

How to render a Drawing manager in a Map or a polygon using "@react-google-maps/api"

I've been trying to render a Map using @react-google-maps/api": "^2.12.1 in my react-hook-form": "^7.33.1. The requirement was to show the map onClick of the input, and the user should draw a polygon on the Map using Drawing Manager. This is my…
Mahijendra
  • 335
  • 5
  • 15
2
votes
3 answers

Why react-google-maps/api doesn't show lines and polygons?

I use react-google-maps/api library in main project but I can't see the lines I drew on the map. So I created demo project for try same code. it works. But main project doesn't work. I looked react versions, react-dom versions, react-google-maps/api…
Ali
  • 305
  • 3
  • 14
2
votes
1 answer

How to ask about geolocation right before opening google maps?

I am junior front end working on a project in react where you can post job offers with information and google map location. How the component works? When I click on the component, an alert show with "www...want to know your location,…
bigBadWolf
  • 100
  • 1
  • 9
2
votes
1 answer

Use map instance outside onLoad in react-google-maps

I am trying to use places library, It requires map instance to call the library but map instance is only available inside onLoad, I am trying to use the places library whenever the center change(inside onCenterChange). import React, { useEffect,…
Fenaz
  • 23
  • 4