Category : google-map-react

I am trying to use google-map-react with multiple markers. I have a useState const [onlineUsers, setOnlineUsers] = useState([]); But when I iterate it with the map function, it doesnt show any markers. return ( <div style={{ height: ‘100vh’, width: ‘100%’ }}> <GoogleMapReact bootstrapURLKeys={{ key: ‘PRIVATE’, }} defaultCenter={{ lat: 39.8097343, lng: -98.5556199 }} defaultZoom={4.8} > {/* ..

Read more

I have been recently working with "google-map-react "(https://www.npmjs.com/package//google-map-react), which I chose because it seemed to be the most popular google map react package. The way you set up markers and stuff like that is great, and pretty simple to understand. You can also directly load geojson files onto the map, which is nice. However, more ..

Read more

I have a reactjs application using the google-map-react library and I’m having trouble defining so that the map leaves the option of Markers selected in the satellite map option mapOptionsCreator(map) { return { mapTypeControl: true, mapTypeId: map.MapTypeId.SATELLITE, mapTypeControlOptions: { style: map.MapTypeControlStyle.HORIZONTAL_BAR, position: map.ControlPosition.TOP_CENTER, mapTypeIds: [ map.MapTypeId.ROADMAP, map.MapTypeId.SATELLITE, map.MapTypeId.HYBRID ] }, zoomControl: true, zoomControlOptions: { position: ..

Read more

I’m trying to handle the click event of a button inside a google.maps.infoWindow. I tried to pass the function name to onClick via infoWindow contents but didn’t work. So, I moved to getElementById but also without success.The return of getElementById("polyButton") is null. The code: fpolylineHandler(event) { console.log("handler", event); } infoPolyline(Polyline, map, maps, event) { var ..

Read more