-
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
src/Util.js - custom Leaflet prefix support #1360
src/Util.js - custom Leaflet prefix support #1360
Conversation
Thanks for the PR. Your explanation sounds reasonable, but also I want to make sure we have a full discussion and thoughtful understanding of the problem and solution first. Given that, would you mind opening an issue for this (and you can reference this PR within that issue), clarifying the issue and the replication cases? Thank you again! |
This issue has been automatically marked as stale because we're waiting on more information or details, but have not received any response. It will be closed if no further activity occurs. Thank you! |
and cleanup
also use a variable for this option value
Thanks a lot for this PR @markconnellypro. I added a few additional changes:
While I was adding unit tests, I noticed a few cases where this PR is not handling the attribution correctly. Specifically those are:
.. so there are now 3 unit tests on this PR that are failing intentionally -- demonstrating the above 2 issues. If you have time to update the code to resolve these cases, it would be great. Otherwise I will also try to find some time to resolve. Thank you again for the PR! |
I pushed a commit to address the empty string issue (item 2) -- hopefully this is sufficient to fix those tests. With respect to overwriting Powered by Esri (item 1), this appears to be a preexisting issue independent of this pull request. This is a bit at the border of my JS knowledge, but I assume to get this to work that Esri Leaflet would have to override the setPrefix method in the Control.Attribution class in Leaflet? I'm also not sure what impact such an override would have on the other functions in src/Util.js that call the setPrefix method. |
Closing this pull request due to #1366. |
When Esri Leaflet adds Powered by Esri to the attribution, it overwrites the preexisting attribution prefix. This pull request changes this process to retrieve the existing attribution prefix first, so that it can be used in lieu of the constant when overwriting and so that it can be restored in the event that all Esri layers are moved from the map display.