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

Fix issue with scriptTag definition #23

Closed
wants to merge 2 commits into from

Conversation

sirrah23
Copy link

Fix #22

If you are working on a Vue project and mappa is a dependency the
vue-cli bin command will uglify/minify your code. As a part of this
process all of the classes in exisiting Javascript files get renamed.
When this happens the check to see if this.constructor.name is equal to
'Leaflet' will fail as the class may have been renamed.

After examining the Leaflet class as well as well as other tile
providers I believe that this check itself is unnecessary and by
removing it we also solve the above issue.
@codecov-io
Copy link

codecov-io commented Aug 11, 2018

Codecov Report

Merging #23 into master will increase coverage by 0.22%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #23      +/-   ##
==========================================
+ Coverage   44.52%   44.75%   +0.22%     
==========================================
  Files          14       14              
  Lines         393      391       -2     
==========================================
  Hits          175      175              
+ Misses        218      216       -2
Impacted Files Coverage Δ
src/providers/tile/Leaflet.js 2% <0%> (+0.03%) ⬆️
src/providers/tile/Mapbox.js 6.25% <0%> (+0.36%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2ea199a...69a2895. Read the comment docs.

@sirrah23
Copy link
Author

I just realized that the by removing that if-statement in the Leaflet construct loadSrc would run twice in the MapBox constructor.

I made a tweak so that loadSrc only ever runs in Leaflet and any class that inherits from it would let Leaflet handle the call to that function.

@sirrah23 sirrah23 closed this Jan 5, 2021
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.

this.scriptTag is undefined
2 participants