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

react-google-maps StandaloneSearchBox set specific country restriction?

I am trying to set a specific country restriction using react-google-maps StandaloneSearchBox. I have tried componentRestrictions, but I'm not sure how to use it. Sharing my code below: export const AutoCompleteSearchBox = compose( …
0
votes
1 answer

Issue to pass callback from GMaps API to the DirectionsRenderer component from react-google-maps

I try to display gmaps with a direction route between 2 points. So I built: A container class: import React, { Component } from 'react'; import { DirectionsRenderer } from 'react-google-maps'; import Map from './Map'; class MapContainer extends…
fro
  • 437
  • 4
  • 16
0
votes
1 answer

Use react-google-maps methods with recompose

I'm using react google maps for fine tuning the user location after a geo location function, this is part of my Map.js code: const MyMapComponent = compose( withProps({ googleMapURL:…
BetoCuevas
  • 123
  • 8
0
votes
0 answers

how to stop map component re-mount after the state update (react-google-maps)

I use 'react-google-maps' There are some checkboxes and one GoogleMap component in my page. When I update react state after I click checkbox. The GoogleMap will unmount and mount again. The GoogleMap doesn't use the state which be changed by…
Hsueh-Jen
  • 267
  • 2
  • 9
0
votes
2 answers

How do I initialize a map in street view mode using react-google-maps

I've implemented the default react-google-map component and it is displaying the map correctly. However, is there a way to initialize it into street view with a given coordinate? Original code I would like to modify below: const Map = compose( …
Imran NZ
  • 1,327
  • 2
  • 12
  • 22
0
votes
1 answer

React google maps marker click event toggle class

I'm building a google map with clickable markers with the marker info hide in div elements. I want to have each marker toggle the "hide" class I created. Here is how my Map renders: render() { if (!this.props.loaded) { return…
Chris Gatherer
  • 55
  • 1
  • 13
0
votes
1 answer

Trigger Marker on external element hover without map re-rendering React

I have an airbnb-like app with cards on the left and a google map on the right (using the react-google-maps package) I would like to highlight (in the code below through an animation) a marker when the user hovers on its corresponding card. I…
Uj Corb
  • 1,959
  • 4
  • 29
  • 56
0
votes
1 answer

React-google-maps state update causes infoWindow into infinite loop render

So I have this weird problem with react-google-maps or maybe it's my limited understanding on how state works in react. // @flow import React, { Component } from 'react'; import { Marker } from 'react-google-maps'; import InfoBox from…
0
votes
1 answer

react-google-maps: How can I dynamically style the Google container (.pac-container) of multiple StandaloneSearchBox components?

The container of the Google Places searchbox that is created with react-google-maps has class called .pac-container. Now, I've got multiple of those on one page and I want to style them differently. For example, one should drop upwards, another one…
0
votes
1 answer

React state management between different components

So i have the following components structure : 1 / \ 2 4 | | 3 5 Component 3 is a marker displayed on a…
Mike.G
  • 125
  • 5
  • 14
0
votes
1 answer

how to set center on StandaloneSearchBox in react google maps

i'm using react google maps standalonesearchbox,every thing is ok,but how can i show first near by location in google map search hints(places),generally when we use map with search box then we attach both each other but here i didn't add map. so…
0
votes
1 answer

React Google Maps marker position is misplaced with usage of OverlayView

I am using react-google-maps and showing some markers on the map..the issue is that the actual latitude longitude where the marker should be looks far away from where it should be…only when you completely zoom in the marker is placed…
0
votes
1 answer

react-google-maps TypeError: Object doesn't support property or method 'setZoom'

I am using the react-google-maps package in my app. I want to access the Map.setZoom() method but I am getting TypeError: Object doesn't support property or method 'setZoom' Interestingly, the Map.panTo() method works just fine. They should both…
0
votes
1 answer

Marker not shown in google-maps-react

I want to show a simple map with a marker in it. This is my code: import React, { Component } from 'react'; import {Map, Marker, GoogleApiWrapper} from 'google-maps-react'; import demoFancyMapStyles from "./MapStyle.json"; export class MapContainer…
Fabian Schneider
  • 799
  • 1
  • 13
  • 40
0
votes
2 answers

react state not being updated

I am trying to toggle the info window in react-google-maps off and on through a custom component. The toggle method is being called as I checked if it's logged. Here's the code: /** * Created by. */ import * as React from 'react' import {Col, Row,…
SomethingsGottaGive
  • 1,646
  • 6
  • 26
  • 49