PHP Classes

File: usage.php

Recommend this page to a friend!
  Classes of Niko Peikrishvili   WMTS PHP Map Tile Downloader   usage.php   Download  
File: usage.php
Role: Example script
Content type: text/plain
Description: Example script
Class: WMTS PHP Map Tile Downloader
Download tiles of maps of a world region from WMTS
Author: By
Last change:
Date: 1 year ago
Size: 591 bytes
 

Contents

Class file image Download
<?php

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));