mapbox / tilejson-spec

JSON format for describing map tilesets.
255 stars 52 forks source link

tiles Property should clearly highlight if relative urls are supported or not. #51

Closed Danielku15 closed 6 years ago

Danielku15 commented 6 years ago

It appears that the tiles property is not clear enough regarding the support of relative and absolute URLs. I lately opened a issue on mapbox-gl-js that relative URLs are not correctly handled but the bug was closed with the info that absolute URLs are needed in the tiles property. From the current description it is not 100% clear that his is actually a requirement:

https://github.com/mapbox/tilejson-spec/blob/4820170ae79cadd783743c273fa8ff929ec59f50/2.2.0/README.md#L73-L79

It appears that some services like ESRI ArcGIS only specify relative URLs which need to be combined with the URL where the TileJSON is hosted.

Either the spec should mention that only absolute endpoints are supported or it should clearly define how relative URLs should be handled, especially in regards to leading slashes.

GretaCB commented 6 years ago

Thanks so much for the ticket @Danielku15 👍 . We've added the clarification as part of the upcoming TileJSON 3.0.0 release over at https://github.com/mapbox/tilejson-spec/pull/52.

The main reasoning behind requiring the url to be absolute is because it's ambiguous what a relative URL should be relative to. For example, is it the TileJSON URL, the style URL, or the page URL? What if the TileJSON is inline in the style?

Thanks again for your input.