-
Notifications
You must be signed in to change notification settings - Fork 196
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
Syntax error of Worker code in IE11 #58
Comments
We'll need more information. What is the exact parse error? By using an instance of Chrome (or Chromium) and using the "sources" tab of the dev console, it's easy to see the code that the worker is running. If you copy-paste that code into a standalone file and load it with IE11, does a (better) error appear? |
Setup: Leaflet v1.0.2 Screenshot: |
Yeah, it's failing to parse the code inside the |
@IvanSanchez Too bad :( I can spend some time on this issue today.. |
I had this same issue at the office, but I can't seem to replicate at home. I think I solved it by adding some polyfills to the head of my HTML like so:
Does that solve your issue? Make sure you grab the latest versions of those polyfills because I think there was some bad code in earlier versions. You can try my demo and see if you have any issues with the web workers: https://goo.gl/GeavZS |
I am also getting this in IE all version except Edge. Very hard to debugg since its inside the blob. Any news / suggestions on this? The solution by dosstx did not work. |
@jklongi Did you add the function to your code to call the polyfills?
I'm using IE11 and it works for me.... |
I don't think any of the maintainers have IE as a priority, so this would be a good time to step up and submit a PR! We would really appreciate help with this. |
@dosstx Yes I did but it doesn't help. I cant get my code or nor even your example to work. Just facing the same error as @wyleung . I am using browserstack and couple real windows machines to get IE 11 & 10 but not any of them work. I looked into it and I think the function that gives the worker code __$strToBlobUri is returning the blob in every other browser like so: "blob:http://localhost:8000/fe350922-c073-4d79-af88-cf5c194ccfac" but in IE it returns the blob input as a string but it has been cut off like so:
However the stuff inside that function might be beyond my skill to debugg.. |
I was actually able to (kind of) solve this by using the workerCode from version 1.1.0 and calling the worker with |
Thanks @IvanSanchez for creating a great Leaflet Plugin. Any recommendations for a fix? |
@IvanSanchez this may be helpful in understanding the IE 11 issue. |
@msully Hhhhmmm, not very helpful, albeit interesting. Maybe loading the VectorGrid file with a |
@IvanSanchez unfortunately loading the VectorGrid file <script src=... crossorigin='anonymous'> had no effect. Two steps to resolve the IE11 issue:
A working example : Grass cutting map |
Thanks @msully For me I changed one line in the From... Then when creating my layer
The code that goes in WebWorker came from |
@Harvinator does VectorGrid still work in Chrome/Firefox etc. after these changes? If so, would you be able to make a pull request? It's very hard to review the changes you made when just pasting code into a comment. Pull requests are ideal for this. |
@perliedman I've tested in Chrome and it does work yes. Created pull request #109 (Also edited my above comment to remove all of the worker code I unnecessarily copy/pasted in) |
Are there any plans to merge #109 and publish updated version to npm? |
Any update on this problem for IE 11? Thanks |
@Harvinator do you please provide a working example I can't find a way to make it works ! Thanks in advance |
For those who search a working WebWorker.js here is the gist: https://gist.github.com/2803media/2c2e370fb317311969bd9efcea09e521 The trick is to load the regular script for all browsers except for IE like that:
Notice the difference for Leaflet.VectorGrid.bundled.min2.js versus Leaflet.VectorGrid.bundled.min.js which is the official one. The gist of Leaflet.VectorGrid.bundled.min2.js is here: https://gist.github.com/2803media/f32ec54340d1d03b44fa0f3609480690 After as @Harvinator said you load the slice like that:
|
Thank you for the great work on this VectorGrid!
It works fine in Webkit based browsers and Edge. However, when I was testing it in IE 11, it was crashing on: https://github.com/Leaflet/Leaflet.VectorGrid/blob/master/src/Leaflet.VectorGrid.Slicer.js#L33
I'd not take any actions yet to debug / rewrite this part of code. Is anyone seeing the same issue ?
The text was updated successfully, but these errors were encountered: