Skip to content
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

Google Map&Mapbox Issue #58

Open
zning opened this issue Oct 31, 2019 · 5 comments
Open

Google Map&Mapbox Issue #58

zning opened this issue Oct 31, 2019 · 5 comments
Assignees

Comments

@zning
Copy link

zning commented Oct 31, 2019

I'm trying to pop up a new window and put Map inside it. But have some issues:

  1. For Google Map(I'm using @react-google-maps/api package), the onDrag event won't fire after the onDragStart on the popup window until you click back to original window, the onDrag event will fire then. This leads to a weird result: Once you start to drag on the pop up window map, the map will not move at all, you click back to the original window and move around the mouse, the popup window start to move(pan) around.
  2. For Mapbox(I'm using react-mapbox-gl package), won't works due to "mapbox-gl.js:24480 Uncaught Error: Invalid type: 'container' must be a String or HTMLElement."

Any way to make anyone of them works? Thanks a lot

@kme211
Copy link

kme211 commented Nov 19, 2019

Hey, I have a similar issue to your first issue and this is what I've found out:

Since the content is being rendered in the original window, the global window that's being used by third party libraries is the original window, not the pop up window. Unfortunately, I don't have a fix or workaround besides using libraries where you can pass the window in through a prop.

@zning
Copy link
Author

zning commented Nov 19, 2019

Hey, I have a similar issue to your first issue and this is what I've found out:

Since the content is being rendered in the original window, the global window that's being used by third party libraries is the original window, not the pop up window. Unfortunately, I don't have a fix or workaround besides using libraries where you can pass the window in through a prop.

Thanks for your reply. Tried 5 different google map libraries and no one perfectly works...

@Totalbug92
Copy link

Totalbug92 commented Dec 23, 2019

Made a little 'hack' that let me run mapbox and communicate with it in a seperat window using react-routing and broadcastChannel API.

See: https://github.com/Totalbug92/React-New-Window-with-Mapbox-GL

@Jip-Hop
Copy link

Jip-Hop commented Jan 3, 2020

@Totalbug92 did you see issue #34? I think fixing that that would solve this issue with Google Maps, and any other issue related to the window reference.

@rmariuzzo rmariuzzo self-assigned this Nov 27, 2022
@rmariuzzo
Copy link
Owner

I'm wondering if this issue can be addressed using the new window instance returned by onOpen callback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants