1
var map = L.map('map').setView([55.42, 53.50], 6);

var wmts = L.tileLayer('C:/Program Files(x86)/GeoServer 2.15.1/data_dir/gwc/web/{z}/{x}/{y}.png', {
    wmts: true,
});
wmts.addTo(map);

The data I cache with geowebcache is stored C:/Program Files(x86)/GeoServer 2.15.1/data_dir/gwc/web/{z}/{x}/{y}.png. How can I view this cached data with Leaflet my file formats image or png.

enter image description here

2

1 Answer 1

2

If you want to use browser to view files on file system on your local machine, then for security reasons you cannot refer to those files by absolute path, you have to use relative path.

In your case that would mean that you have to put for example myTileViewer.html file with your code somewhere on the path to tiles, let's say in the folder C:/Program Files(x86)/GeoServer 2.15.1/data_dir, and then your code could look something like this:

var map = L.map('map').setView([55.42, 53.50], 6);

var wmts = L.tileLayer('gwc/web/{z}/{x}/{y}.png', {
    wmts: true,
});
wmts.addTo(map);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.