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
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:
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
The text was updated successfully, but these errors were encountered:
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.
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
The text was updated successfully, but these errors were encountered: