PHPackages                             nikop/wmts-tile-downloader - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nikop/wmts-tile-downloader

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nikop/wmts-tile-downloader
==========================

1.0.3(2y ago)08MITPHPPHP ^8.2

Since Jun 12Pushed 2y ago1 watchersCompare

[ Source](https://github.com/nikopeikrishvili/WMTSTileDownloader)[ Packagist](https://packagist.org/packages/nikop/wmts-tile-downloader)[ RSS](/packages/nikop-wmts-tile-downloader/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

Description
===========

[](#description)

This library provides very basic functionality for downloading Tile layers from a WMTS server. Your goal is to implement the [DownloaderInterface](src/Downloader/DownloaderInterface.php) with you logic with your logic and pass it to the [WMTSTileDownloader](src/WMTSTileDownloader.php) class constructor when creating an object from it.

Data about the tile will be passed to the download method, and then you decide what to do.

```
int $x, int $y, int $z, int $counter
```

Example
-------

[](#example)

```
use WMTSTileDownloader\Downloader\BasicDownloader;
use WMTSTileDownloader\Helpers\Mercator;
use WMTSTileDownloader\Types\LatLng;
use WMTSTileDownloader\Types\ZoomLevel;
use WMTSTileDownloader\WMTSTileDownloader;

require 'vendor/autoload.php';

$downloader = new WMTSTileDownloader(mercator: new Mercator(), downloader: new BasicDownloader(saveTo: '/path/to/directory/for/storing/files'));
$nw = new LatLng(59.977005492196, -12.2607421875);
$se = new LatLng(49.610709938074, 1.93359375);
$downloader->generateFromLatLongs(northWest: $nw, southEast: $se, zoomLevel: new ZoomLevel(9));
```

The library comes with an example [BasicDownloader](src/Downloader/BasicDownloader.php)

```
