New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React Google Map InfoWindow showing all the info when I click on a single Mark #753
Comments
I fixed. I replaced with Marker and InfoWindow to its component. import React, {Component} from 'react'; class InfoWindowMap extends Component {
render() {
} export default InfoWindowMap; |
Hi @spaceforestchu - is this the complete code for the fix? I tried to replicate your fix but couldn't seem to do it. Is there a separate component for GoogleMap? If so, can you post your entire fix? Thanks for posting the solution! |
@hrashid sorry I just saw this.
then I put the infoWindowMap component in sindei google map component.
You can find the code in my github the project is called your 4 square. Let me know if you need any help. |
I have same problem and I solved like following..
(this code is not exact. cause I quickly typed it in this editor) It works good. I recommend this way. |
my solution below
and then :
|
@nguyenvanphuc2203 where did you put your ShowInfo ? |
@nguyenvanphuc2203 Thanks for your code. However, after opening an info window and closing it once. The info window will not be able to show up again. So below is the quick fix, I just added an additional condition for showing the info window (ie . props.isOpen).
If there is another better fix, please let me know! |
nice man :D |
@nguyenvanphuc2203 @pttse
|
**Hi guys! in the following peace of code: import React from 'react' import template from 'modules/template' import IconButton from '@material-ui/core/IconButton'; import blueGrey from '@material-ui/core/colors/blueGrey'; import { getColors } from 'utils/status' import PersonalizedInfoWindow from './PersonalizedInfoWindow' const disabledColor = blueGrey[500] const DefaultIcon = ({ class CustomOverlayMarker extends React.Component { constructor(props) {
} handleMouseOver = () => { handleMouseOver = () => { render() {
} } CustomOverlayMarker.propTypes = { export default CustomOverlayMarker Does someone know how to avoid this?? |
|
The solution was as simple as adding this: this.handleMouseOver()} onMouseOut={()=>this.handleMouseOver()} > |
My solution:
|
The infoWindow corresponding to the marker doesn't get shown up when i click on the marker. The markers keep refreshing when i click on them. I can't figure out what i've done wrong. Can anybody help me with this ?
|
@senelithperera We had rewrite it to TypeScript, and updating it frequently: https://github.com/JustFly1984/react-google-maps-api/tree/master/packages/react-google-maps-api You can see our docs: https://react-google-maps-api-docs.netlify.com/ Also a lot of examples: https://react-google-maps-api-gatsby-demo.netlify.com/ https://github.com/JustFly1984/react-google-maps-api/tree/master/packages/react-google-maps-api-gatsby-example/src/examples The bundle size is much smaller: https://bundlephobia.com/result?p=@react-google-maps/api@1.7.5 Enjoy! |
@JustFly1984 Just after posting this question, I found your github repo. The issue was fixed. |
Could you please share the all the code. I am trying with this but getting some issues |
@mahendragurav2 We had rewrite it to TypeScript, and updating it frequently: https://github.com/JustFly1984/react-google-maps-api/tree/master/packages/react-google-maps-api You can see our docs: https://react-google-maps-api-docs.netlify.com/ Also a lot of examples: https://react-google-maps-api-gatsby-demo.netlify.com/ https://github.com/JustFly1984/react-google-maps-api/tree/master/packages/react-google-maps-api-gatsby-example/src/examples The bundle size is much smaller: https://bundlephobia.com/result?p=@react-google-maps/api@1.7.7 Our Spectrum community: https://spectrum.chat/react-google-maps Enjoy! |
Here is a complete solution InfoWindow shows. i have also attached the link you can see for more understanding.. https://codesandbox.io/s/quizzical-hermann-5ehs7
|
Hi all,
I am having an issue with making the InfoWindow shows up for the Mark I click on.
The expect behavior is when I click on the mark it will only shows information about that mark in the InfoWindow.
However, What I am getting now is that when I click on a marker all the marker shows up. And when I tried to close it rerender the app.
Any Idea how to fix this?
The text was updated successfully, but these errors were encountered: