Skip to content

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

Closed

Description

@Danielku15

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:

// REQUIRED. An array of tile endpoints. {z}, {x} and {y}, if present,
// are replaced with the corresponding integers. If multiple endpoints are specified, clients
// may use any combination of endpoints. All endpoints MUST return the same
// content for the same URL. The array MUST contain at least one endpoint.
"tiles": [
"http://localhost:8888/admin/1.0.0/world-light,broadband/{z}/{x}/{y}.png"
],

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.

Activity

  1. GretaCB commented on Jul 30, 2018

    @GretaCB
    Contributor

    Thanks so much for the ticket @Danielku15 👍 . We've added the clarification as part of the upcoming TileJSON 3.0.0 release over at #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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions