Comments (7)
This is actually a problem with relative URLs in the style's root.json
. Esri knows about their bug, and we had to remove a workaround for that in the code base because it broke other style docs with correct relative URLs. You'll need to use the transformRequest
option to fix the url, similar to the one shown in https://github.com/openlayers/ol-mapbox-style/blob/main/examples/esri-transformrequest.js.
from ol-mapbox-style.
@lsmallwood Two things:
The problem is that e.g. in https://www.arcgis.com/sharing/rest/content/items/2afe5b807fa74006be6363fd243ffb30/resources/styles/root.json, the referenced tilejson is https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer, but should be https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/ (note the trailing slash). Otherwise the relative tile url in that tilejson will resolve to the wrong directory.
has to be fixed by Esri. This affects almost all root.json
docs provided by Esri.
The root.json of your style has this glyphs url:
"sprite":"https://cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/../sprites/sprite?token=[your-token]"
has to be fixed by us (ol-mapbox-style).
Sorry for the confusion. Let me know if anything is still unclear.
from ol-mapbox-style.
@ahocevar can you provide more information about the problem with the relative URLs? Is there another issue somewhere where this is documented? I'm trying to construct a workaround but I don't know the source of the problem
from ol-mapbox-style.
The root.json of your style has this glyphs
url:
"sprite":"https://cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/../sprites/sprite?token=[your-token]"
When you paste this url into the address bar of your browser, you'll see that it's invalid. I don't even know what the correct url is, but if you know you use a config like
apply('map', styleUrl, {
transformRequest(url, type) {
if (type === 'Sprite') {
return new Request([your_correct_sprite_url]);
}
}
});
from ol-mapbox-style.
@ahocevar, @gowin20 let us know if there is a way we can safely update the root.json
to be correct without affecting other clients.
from ol-mapbox-style.
@lsmallwood @gowin20 Thanks for helping out! The problem is that e.g. in https://www.arcgis.com/sharing/rest/content/items/2afe5b807fa74006be6363fd243ffb30/resources/styles/root.json, the referenced tilejson is https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer, but should be https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/ (note the trailing slash). Otherwise the relative tile url in that tilejson will resolve to the wrong directory.
In the specific case here, after some more research, I figured out the problem and how it can be fixed in ol-mapbox-style without breaking other styles - it's because ?token=
appended to .../sprite
, but .../sprite
is only a url fragment, where .json
or .png
or the @2x
equivalents will be appended. This is indeed a regression in ol-mapbox-style.
from ol-mapbox-style.
Thanks for the info @ahocevar.
This is indeed a regression in ol-mapbox-style.
Just to confirm, is this something you think we should change, or is the problem with ol-mapbox-style
?
I'm going to log an issue to look at this as part of our new basemap styles service (due to be released in beta version at the end of April). We won't be able to fix it in time for that release I don't think but we could consider it a bug-fix that we can look to incorporate. That would give us an opportunity to fix the json when accessed via the styles service - but not if someone just accesses the item directly (as in your link above).
I will also pass the details on to the content team - they may be able to assess whether this is something that can be/should be changed at source.
from ol-mapbox-style.
Related Issues (20)
- Mapbox streets-v12 style trys to load invalid fonts HOT 1
- Make source available in transformRequest HOT 2
- Guessing of access token parameter may lead to bad requests HOT 1
- Requests to third-party server for fonts HOT 8
- issue with standalone example using recent versions of olms (METERS_PER_UNIT error) HOT 1
- applyBackground issue HOT 3
- line-pattern webgl HOT 3
- Provide a default URL template for fonts when 'ol:webfonts' not available HOT 1
- Issue rendering fill layers above symbol layers HOT 2
- 加载mapboxgl的样式时文本标签显示错乱 HOT 1
- Maybe a bug in stylefunction HOT 2
- Vector tile layer with MVT format clip circle style HOT 6
- Is there a possibility to use raster source with ol-mapbox-style HOT 4
- Hillshade uses incorrect resolution when determining slope angles HOT 3
- Cannot add mapbox layer if source was not referenced before HOT 6
- Resolve a Mapbox layer to an OL Style HOT 3
- Refreshing symbols HOT 7
- Change attribution HOT 1
- VectorTile layers with source `minZoom` 0 not visible when view is zoomed out HOT 1
- Rendering very slow when there are many text labels HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ol-mapbox-style.