-
Notifications
You must be signed in to change notification settings - Fork 142
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
Marker with Modal do not works #155
Comments
Hey, I think the issue is that you don't add the As you don't have the option to make the const RouteModel = (props) => {
const [modal, setModal] = useState(false);
return (
<>
<Marker onClick={() => setModal(!modal)} {...props} />
{(modal) && (
<Modal
isOpen={modal}
onRequestClose={() => setModal(!modal)}
ariaHideApp={false}
>
<h2>{props.name}</h2>
<p>{props.name}</p>
<button onClick={toggleModal}>Close</button>
</Modal>
)}
</>
);
} Note though for this to work you have to pass |
I have the same problem , could you solved? |
You need to put So, following is valid <Map>
<Marker ... />
</Map> This is also valid <Map>
{makersList.map(marker => ( <Marker ... /> ))}
</Map> Following is invalid const CustomMarker = () => (
<Marker ... />
)
.....
<Map>
<CustomMarker ... />
</Map> |
so im running into this problem. i have a dynamic marker count that comes from an external api, so having the map and marker in the same component is not really that feasible, espeically when it comes it simulating marker movement without having to re-render whole map etc. is there a way around this? cheers |
To be honest this issue should be closed. And what you are asking is not really related to this.
I think you can do this, you will need to write a custom component that receives all the mapping props. Most importantly |
Hello,
I have created a custom component to show a marker then when pressed opens a Modal;
here's the code
the modal works fine but the marker is placed on the top left corner of the webapp (check screenshot)
by doing some checking i've seen that the
lat
andlng
are passed correctly to the component but when rendered they somehow get lost as i don't see notransform
property in the style when running the inspector.am I missing something?
The text was updated successfully, but these errors were encountered: