Leaflet / Leaflet.VectorGrid

Display gridded vector data (sliced GeoJSON or protobuf vector tiles) in Leaflet 1.0.0
598 stars 194 forks source link

Need a polyfill for 'fetch' #96

Closed aidangarza closed 7 years ago

aidangarza commented 7 years ago

I'm building an app that uses multiple Protobuf tile layers. It is working great in Chrome, Firefox, and Edge, but was failing in Safari 10.0.3. Some digging revealed that the cause of the issue was the use of the native 'fetch' function in the _getVectorTilePromise method. The 'fetch' function is not supported in IE, or Safari 10 and earlier. There are polyfills available for this functionality that should be added to this project if the native 'fetch' function is going to be used e.g. https://github.com/github/fetch

jdesboeufs commented 7 years ago

Or just use https://polyfill.io/v2/docs/ Modern mobile phones don't have to pay this price ;)

perliedman commented 7 years ago

This was really closed by #98, but I agree with @jdesboeufs that a better solution is to leave it up to the application using Leaflet.VectorGrid to pull in any polyfills it needs. If every library includes polyfills (potentially different ones), there's going to be a lot of bloat.

chriszrc commented 6 years ago

I agree that automatically pulling in the polyfills is not the way to go, but what is the way to go is to mention this somewhere in the readme or the docs, otherwise you have annoyed users who are wondering what the heck is wrong with their app in IE 11 (and IE 11 is already making them annoyed enough as is)