-
Notifications
You must be signed in to change notification settings - Fork 799
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
some BasemapLayers write 'null' to Leaflet's attribution control #647
Comments
👏 👏 👏 👏 Glad to see If you're a first timer, take advantage of this invitation. It's an invitation to get some hand holding on your first PR. Bravo @jgravois. It definitely takes more work to hold someone's hand through this, but it's totally worth it :-) 👏 👏 👏 👏 |
Hi there, I thought I solved the problems with my installation, but that was not the case. I'm going to try to jump into that later, but after looking at the real problem, it turned out to be an easier fix than I was expecting, being my first kick at this can. In this particular instance of the problem, I found that the OceanLabels class lacked an attribution value, and that's why the addAttribution() function pulls a null. If this is the correct path to go with the problem, then would adding attribution to the remainder of the classes in this file be the correct path of action? As far as the test, I believe that dropping a if/else loop that verifies whether the function pulls a null value. Right now, I'm testing something like the following:
|
awesome work. I don't even think we need an its valid that the labels layers don't have attribution (otherwise we'd just end up with duplicate references to the data sources used for the paired layers) |
So I've run into another series of first-timer issues. The idea of using the if loop should work, but when I've been attempting it locally, it hasn't been that lucky. The null still appears - even when I put a dummy attribution in the To troubleshoot further, I also used a statement guaranteed to return a false value to the if statement
Thanks for the encouragement and assistance so far! |
at this point, it'd be easiest to discuss the proposed change in more detail if you submitted a pull request so I can see the exact differences in your code and perhaps even test them locally. with regard to the strange behavior in your browser...
|
Ah, the I've created a pull request with what I've verified on Chrome and Firefox to be a solution to the bug. Once again, thanks for taking me on for this easy fix. I've learned a lot about git, command line that I wouldn't have otherwise in my spare time! |
That's exactly what this |
resolved by #651. well done @brianbancroft! |
A solution to issue Esri#647
when adding a 'Labels' layer to the map (OceansLabels, GrayLabels, DarkGrayLabels), 'null' is added (as a string) to Leaflet's attributionControl. see the bottom righthand corner of the screenshot below for an example.
to reproduce this bug:
debug/sample.html
and substitute the following basemapLayersthis is happening because we currently pass an actual
null
to theL.esri.basemapLayer
addAttribution() method here. bonus points if you're able to write a new test which checks for this kind of problem in the future.with inspiration from the folks at @yourfirstpr and 'First Timers Only' by @kentcdodds, we are looking for a fix from someone that is just getting started with contributing to open source. if you're interested, but need help getting started, please don't be shy!
The text was updated successfully, but these errors were encountered: