You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use ESRI basemap as styleURL property - e.g. https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/styles/arcgis/outdoor?token=${accessToken}
ESRI styles unfortunately don't conform fully to the TileJSON spec. This is a known issue in the maplibre-gl-js repo and there's been a variety of discussion about how to deal with it (e.g. maplibre/maplibre-gl-js#182). What seems like the best current solution was merged in maplibre/maplibre-gl-js#4962 a month ago — it allows the use of transformStyle to fix relative URLs that are encountered. I know that neither transformStyle nor transformRequest are currently available in the native library (#424), so pending that, I was just wondering if there are any workarounds for this. Presumably others have encountered this problem!
Unfortunately, retrieving the style, processing it, and then feeding it in as styleJSON prop doesn't solve the problem because the relative URLs are not in the initially retrieved JSON, but at another URL referenced as the URL for one of the sources, e.g. here:
Unfortunately both the old v1 styles (no longer documented) and the newer ones seem to include a reference to a second style that does not comply with the spec. We haven't had any issues running it in maplibre-gl on the web with the v1 styles, so I guess it's handling it smoothly there somehow? I confirmed that the styles our web app is retrieving also have the same problem. the rest of my team on this project is going to have a look at #424 to see if we can resolve it by contributing, but I've also tried out the self-hosting strategy you suggested and that does get the job done at least for now.
Steps to Trigger Behavior
styleURL
property - e.g.https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/styles/arcgis/outdoor?token=${accessToken}
Actual Behavior
Style fails to load with this error:
Additional context
ESRI styles unfortunately don't conform fully to the TileJSON spec. This is a known issue in the maplibre-gl-js repo and there's been a variety of discussion about how to deal with it (e.g. maplibre/maplibre-gl-js#182). What seems like the best current solution was merged in maplibre/maplibre-gl-js#4962 a month ago — it allows the use of
transformStyle
to fix relative URLs that are encountered. I know that neithertransformStyle
nortransformRequest
are currently available in the native library (#424), so pending that, I was just wondering if there are any workarounds for this. Presumably others have encountered this problem!Unfortunately, retrieving the style, processing it, and then feeding it in as
styleJSON
prop doesn't solve the problem because the relative URLs are not in the initially retrieved JSON, but at another URL referenced as the URL for one of the sources, e.g. here:The text was updated successfully, but these errors were encountered: