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 - Property 'directions' does not exist

I am encountering this error when I try to run the sample code for react-google-maps: Property 'directions' does not exist on type '{ children?: ReactNode; }'. I am trying to run the directions renderer. Here's the code: import * as React from…
SomethingsGottaGive
  • 1,646
  • 6
  • 26
  • 49
0
votes
1 answer

geolocation in React, use react-google-maps

How to change defaultCenter in react-google-maps ? I need to find my geolocation and change default values lat and lng. import React from "react"; import { withScriptjs, withGoogleMap, GoogleMap, Marker } from "react-google-maps"; const getLocation…
magnum888
  • 23
  • 1
  • 4
0
votes
0 answers

Action for clicked marker on Google Map

I am making a Google Map applications in React with 'react-google-maps', and I have this code: in App.js file I have declaration an image in state: ... state = { markers: markers_all, pageTitle: "Warsaw Cultural Map", …
0
votes
0 answers

addListener not working on react-google-maps

I have a problem: I'm using react-google-maps DirectionsRenderer like at this link: directionsrenderer I'm showing directions and also markers but when finishing dragging route I want that also markers be changed, but it doesn't work. In…
batt
  • 3,382
  • 2
  • 11
  • 12
0
votes
0 answers

React Google Maps: display Markers on MapWithADirectionRenderer recompose Component

I have my component MapWithADirectionsRenderer defined like here var markers = []; const MapWithADirectionsRenderer = compose( withProps({ googleMapURL: "https://maps.googleapis.com/maps/api/js?...", loadingElement:
batt
  • 3,382
  • 2
  • 11
  • 12
0
votes
1 answer

How to display results[0].formatted_address in InfoWindow

I am making now a google map with react, and I have a problem with display result from placeId. I have this code:
0
votes
1 answer

react google maps icons not displayed

I have a problem with displays icons on google map. Here is my code: import React, { Component } from 'react' import { compose, withProps, withStateHandlers } from 'recompose' import { withScriptjs, withGoogleMap, GoogleMap, Marker, InfoWindow }…
0
votes
0 answers

Geocode func inside HOC func

I'm triying to execute a setState inside the callback function of geocode but isn't possible so how can I execute this.setState inside of the func or wait the func until finish and get some results in order to set that info in a new…
Erick Vivanco
  • 239
  • 4
  • 10
0
votes
1 answer

React Google Maps InfoWindow toggle display one at a time

I am currently using react-google-maps and I am able to display the marker and InfoWindow correctly by clicking on the marker (from the map or from the list). But once I click on a marker to open, the previous InfoWindow stays open even when I…
0
votes
1 answer

Add markers to map/clusterer after mount using react-google-maps

Using react-google-maps with MarkerClusterer, how can I add and remove markers from the map/clusterer after the map is mounted, eg. when a button is clicked or in onMarkerClustererClick? I've tried simply making a new Marker with map set to…
0
votes
1 answer

Typescript react dealing with props types

I am using react-google-maps library for Google maps api. According to documentation this is how I use maps: const GoogleMapComponent: React.ComponentClass<{}> = compose( withProps({ googleMapURL: "url", loadingElement:
yerassyl
  • 2,958
  • 6
  • 42
  • 68
0
votes
1 answer

How to change strokeColor between points when using DirectionsRenderer

I'm using react-google-maps to render map in website. I have a problem about strokeColor for each line when using waypoints for DirectionsService. How to change strokeColor between them and how to callback after using DirectionsService . This is my…
0
votes
0 answers

How can I show alternative routes between origin and destination on the map?

This is the code I use. I produce alternate roots and paint in different colors. But the screen does not work. Which part is wrong. If you set the response to direction, it draws a single…
0
votes
1 answer

set size for default marker icon in react-google-maps

I'm using react-google-maps library and would like to show the default marker, but with different sizes. I known that I can just use my own custom marker and set its size but that is not what I want. Is this possible to change the default marker's…
Sabrina
  • 1,621
  • 2
  • 11
  • 16
0
votes
1 answer

How to preview google-maps on ReactJS

I'm really new in ReactJS. I want to visualize a map of Bulgaria and set markers in each city only when I receive rainfall data. For now I try with examples from this link: React google-maps But I get an error when placing the code in my…