TMS/XYZ Tiles Not Displaying with EPSG:4326 in OpenLayers 3 from GeoServer
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript
Research direction
Start with the OpenLayers 3 XYZ source shown in the issue and the linked GeoWebCache layers and blobstores documentation. Compare the EPSG:4326 TMS URL, requested z/x/y values, and the stated layer extent; done means identifying a reproducible configuration or request correction that displays the tiles in EPSG:4326.
Written by the indexing model from the issue text.
Description
• GeoWebCache Bounding Box to Tile Conversion Not Working Properly (EPSG:4326)
• I am working on loading TMS and XYZ tiles from GeoServer into an OpenLayers 3 map using the EPSG:4326 projection. My implementation works with EPSG:900913 (Web Mercator), but when I switch to EPSG:4326 (WGS 84), the tiles do not display.
• The tiles for zoom levels 0-15 were generated using the gdal2tiles command, following a directory structure format of zoomLevel/xTile/yTile.png. These tiles work fine when loaded directly into OpenLayers 3. However, I encounter issues when trying to display the GeoServer TMS layer tiles.
Problem Details:
• Requesting tiles using EPSG:900913 works as expected in GeoServer.
• Requesting tiles using EPSG:4326 does not display the tiles(i.e /5/21/17.png,7/91/73.png,...), and it seems like the tile requests are targeting incorrect zoom levels or tile indices.
• Layer extent is : 67.9999999892922062,6.7500084218887384 97.4152926721475438,35.5000646459131772
• I would prefer to display the map using EPSG:4326 since my data is in that projection. However, the TMS tiles from GeoServer fail to load in this projection. It seems there may be issues with coordinate transformations or the way OpenLayers 3 requests the tiles.
Sample code :
var epsg_projection = '4326';
var layerCity = 'cite:layername';
var epsg_projection2 = 'EPSG:' + epsg_projection;
var testlayer = new ol.layer.Tile({
source: new ol.source.XYZ({
url: 'http://localhost:8080/geoserver/gwc/service/tms/1.0.0/' + layerCity + '@EPSG%3A' + epsg_projection +'@png/{z}/{x}/{-y}.png',
minZoom: 0,
maxZoom: 15
})
});
My Questions:
• Is there a way to instruct GeoServer to generate tiles with the XYZ structure (zoom/x/y) for EPSG:4326?
• How can I configure OpenLayers 3 to request the TMS tiles correctly from GeoServer for EPSG:4326?
• Is there a better approach to handle TMS with EPSG:4326 in GeoWebCache?
Any guidance or insights on resolving this issue would be highly appreciated!
Reference link:
https://docs.geoserver.org/main/en/user/geowebcache/webadmin/blobstores.html
https://docs.geoserver.org/main/en/user/geowebcache/webadmin/layers.html
https://github.com/geoserver/geoserver
- Dominant language
- JavaScript
- Stars
- 12.6k
- Forks
- 3.2k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 21
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openlayers/openlayers
-
feature request
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
openlayers/openlayers#17145 ·
-
feature request
Difficulty 1/5 Under an hour Newbie friendliness 70/100
openlayers/openlayers#16410 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 68/100
openlayers/openlayers#16042 ·
-
feature request
Difficulty 5/5 Over a week Newbie friendliness 45/100
openlayers/openlayers#17630 · 7 comments ·
-
Openfreemap 3D Openfeature request
Difficulty 5/5 Over a week Newbie friendliness 25/100
openlayers/openlayers#17590 · 14 comments ·
All issues in openlayers/openlayers
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100