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

make owmloading.gif configurable option #504

Merged
merged 2 commits into from Feb 16, 2021
Merged

make owmloading.gif configurable option #504

merged 2 commits into from Feb 16, 2021

Conversation

jywarren
Copy link
Member

@jywarren jywarren commented Feb 16, 2021

Supercedes #473

We should be able to set this when we initialize LEL here using:

options.imageLoadingUrl = "someGifAnimation.gif"

For example in plots2, here:
https://github.com/publiclab/plots2/blob/30fb69618430b589889f7e20cb8ce845e0b89e8d/app/assets/javascripts/leafletHelper.js#L116-L122

@gitpod-io
Copy link

gitpod-io bot commented Feb 16, 2021

@RuthNjeri
Copy link

From the leaflet documentation, it states that

imageLoadingUrl: URL ( 'owmloading.gif' ). URL of the loading image, or a path relative to the HTML document. This is important when the image is not in the same directory as the HTML document!

And from #473 @Tlazypanda wrote images/owmloading.gif that somehow adds the path...

I tried looking for the leaflet-openweathermap in the public/lib folder but could not find it...
Screenshot 2021-02-16 at 23 16 50

Perhaps it should be added to load the owmloading.gif?

@jywarren
Copy link
Member Author

I think the issue is that we aren't even actually including the weathermap dependency -- it may only be compiled in? In any case i think i'll just merge in the version which includes the actual image into the LEL lib and then we'll be able to link to it from /lib/leaflet-environmental-layers/... from within Rails.

Gosh this was a can of worms, with getting the tests to pass again! i thought it was going to be quick -- 😅

hopefully almost done though!

@jywarren jywarren closed this Feb 16, 2021
@jywarren jywarren reopened this Feb 16, 2021
@gitpod-io
Copy link

gitpod-io bot commented Feb 16, 2021

@jywarren
Copy link
Member Author

Hmm, purple air marker failing. I wonder if these tests are cross-wired, if they're specific enough to be testing for the layer they say they are, or if they are somehow interconnected and testing for the wrong markers...

  1) Purple layer - markers
       has circle markers in minimal mode:
     AssertionError: Timed out retrying: Expected to find element: `.leaflet-overlay-pane svg g`, but never found it.
      at Context.eval (http://localhost:8080/__cypress/tests?p=cypress/integration/purpleAirMarker.spec.js:33:10)

  2) Purple layer - markers
       shows popup:
     AssertionError: Timed out retrying: Expected to find element: `.leaflet-overlay-pane svg g`, but never found it.
      at Context.eval (http://localhost:8080/__cypress/tests?p=cypress/integration/purpleAirMarker.spec.js:41:8)

  3) Purple layer - markers
       removes markers from the map and the layer name from the hash when clicked again:
     AssertionError: Timed out retrying: Expected to find element: `.leaflet-overlay-pane svg g`, but never found it.
      at Context.eval (http://localhost:8080/__cypress/tests?p=cypress/integration/purpleAirMarker.spec.js:53:8)

@jywarren jywarren merged commit 8365f00 into main Feb 16, 2021
@jywarren
Copy link
Member Author

Got it! I wonder if it was just a timeout issue, we can work that later.

@jywarren
Copy link
Member Author

OK, modifying this in #508

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

Successfully merging this pull request may close these issues.

None yet

2 participants