Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't publish WMTS for neither 4326 nor 900913 #18

Open
kanerlevent opened this issue Feb 15, 2018 · 1 comment
Open

Couldn't publish WMTS for neither 4326 nor 900913 #18

kanerlevent opened this issue Feb 15, 2018 · 1 comment

Comments

@kanerlevent
Copy link

I am trying to add the default WMTS Italy mosaic that can be found in GeoServer by default (nurc:mosaic, namely) to my map via Leaflet by tweaking the code shared here.
I get the WMTS link by simply right clicking on GeoServer's Web Admin page WMTS 1.0.0 and copy the link location. Here it is: http://localhost:8081/geoserver/gwc/service/wmts?REQUEST=GetCapabilities
And here is my code:

// The WMTS URL
var url = "http://localhost:8081/geoserver/gwc/service/wmts?REQUEST=GetCapabilities";

var italy = new L.TileLayer.WMTS( url ,
{
layer: 'nurc:mosaic',
style: "",
tilematrixSet: "EPSG:900913",
format: "image/png"
}
);
var map = L.map('map').setView([37, 24], 4);

L.control.scale({'position':'bottomleft','metric':true,'imperial':false}).addTo(map);

var osm = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© OpenStreetMap'
}).addTo(map);

var baseLayers = {
"ItalyWMTS" : italy,
"OpenStreetMap": osm
};

L.control.layers(baseLayers).addTo(map);

It didn't work.

I also checked if the nurc:mosaic has the EPSG:900913 defined, it has. ( I checked it from the GeoServer's Web Admin Page - Tile Layers - Tile Caching - Gridset, there are gridsets for both EPSG 4326 and EPSG 900913).
I couldn't manage to get it work with 4326 too

@zigacernigoj
Copy link

zigacernigoj commented Jul 11, 2018

It's because the rows and columns are computed differently.
You would want to check if it is EPSG:4326 and compute rows and cols the way that is described here.

I will try it "tomorrow" and will tell if it's doable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants