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

Safari Compatibility Error - Map Drawing Fails #172

Closed
theodormarcu opened this issue May 29, 2020 · 3 comments · Fixed by #181
Closed

Safari Compatibility Error - Map Drawing Fails #172

theodormarcu opened this issue May 29, 2020 · 3 comments · Fixed by #181
Assignees
Labels
bug Something isn't working
Milestone

Comments

@theodormarcu
Copy link
Member

Describe the bug
Safari prevents proper map drawing because of a Mapbox API error. This prevents users from seeing the drawing menu.

To Reproduce

  1. Open safari.
  2. Go to "Draw a Community" section.
  3. Press on "Draw Polygon." Check console for errors.

Expected behavior
Safari should not fail. Better yet, Safari should fail silently if something happens with the Mapbox API.

@theodormarcu theodormarcu added the bug Something isn't working label May 29, 2020
@theodormarcu theodormarcu self-assigned this May 29, 2020
@theodormarcu theodormarcu changed the title Safari Compatibility Error Safari Compatibility Error - Map Drawing Fails May 29, 2020
@k-y-le
Copy link
Contributor

k-y-le commented May 30, 2020

The 404 errors are occurring because of the mbtiles format census block files, when out of view, are not loaded (apparently due to tippecanoe) -- this seems to be normal, and expected, although I'm not sure why it only happens in safari.

I'm not 100% convinced the 404 errors are related to the fact that the buttons aren't showing up. It seems that the onclick listener for the draw button is never being called. I'm going to keep looking into it and see what i find

For me, I can still draw a community, and it still highlights the census blocks when I do so -- are you getting the same?

@k-y-le
Copy link
Contributor

k-y-le commented Jun 1, 2020

still trying to explore this.. not totally getting anywhere. based off of this mapbox thread (mapbox/mapbox-gl-js#1800) and the behavior of 404s in general, i dont know that it's possible to suppress these errors? and they will always happen because of the way census blocks are loaded.

but what i don't understand is how they might impact the behavior of the buttons on the map. i've tried exploring the code a bit more and am still gettin ghte same bug

EDIT: so i think the problem may be that the event listener is not bound to the correct element since it isn't available in the DOM upon loading... looking into it

@indraneel
Copy link
Contributor

indraneel commented Jun 1, 2020

@k-y-le i got what you got — drawing and census block snapping works, but it looks like the buttons fail to appear. Seems like this function isn't firing in Safari:

.getElementById("draw-button-id")

edit: didn't see your EDIT, looks like you have identified it already

@lauren-johnston lauren-johnston added this to the v1.1.0 milestone Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants