Leaflet / Leaflet.VectorGrid

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

Loading .pbf tiles using relative path #111

Open Hfawad opened 7 years ago

Hfawad commented 7 years ago

I have to load .pbf tiles locally. In chrome, I am unable to get tiles using relative path. i.e. var url = "tiles/{z}/{x}/{y}.pbf"; while in Firefox its working.

IvanSanchez commented 7 years ago

Can you publish a fiddle/codepen/playground that displays this behaviour?

tylkomat commented 7 years ago

Do you use a webserver to display that website or is it displayed by opening the html file directly?

If it is directly than the problem is the fetch API which, when following the specification, does not allow the file//-scheme to be used. Firefox might not completely follow that specification.

Eng3l commented 6 years ago

You can't do that in Chrome, but it's because the navigator itself nothing to do with the library. In chrome you need to start a simple web server to make it work.