PHPackages                             drps/php-maptiler - 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. [Image &amp; Media](/categories/media)
4. /
5. drps/php-maptiler

ArchivedLibrary[Image &amp; Media](/categories/media)

drps/php-maptiler
=================

Tiles image for use in Google/Yandex etc maps

033PHP

Since Feb 27Pushed 7y ago1 watchersCompare

[ Source](https://github.com/drps/php-maptiler)[ Packagist](https://packagist.org/packages/drps/php-maptiler)[ RSS](/packages/drps-php-maptiler/feed)WikiDiscussions master Synced 5mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP MapTiler, Simple Map Tiles Generator
========================================

[](#php-maptiler-simple-map-tiles-generator)

Simple Map Tiles Generator allow to make the Map Tiles using PHP. That allow to build simple custom map. Here not exist any geographical calculations, because I have no idea how to :) Just fork/pull it if you know how to make it better ;)

Requirements
------------

[](#requirements)

- PHP &gt;= 5.3 version
- PHP Imagic extension &gt;= 3.0 version
- A lot CPU time (for images with high resolution and for high zoom level)
- A lot free disc space
- Patience ;)

Usage example
-------------

[](#usage-example)

Make custom map, based on my-image.jpg.

Generate the Tiles:

```
//init
$map_tiler = new MapTiler('/full/path/to/my-image.jpg', array(
  'tiles_path' => '/full/path/to/where-store-result/',
  'zoom_max' => 3,
  'format' => 'png',
  'tms' => false,
  'store_structure' => '%d/tile-%d-%d',
));
//execute
try {
  $map_tiler->process(true);
} catch (Exception $e) {
  echo $e->getMessage();
  echo $e->getTraceAsString();
}
```

Display the result using [Leaflet.js](http://leafletjs.com)

```

  var tiles = L.tileLayer('tiles-path/{z}/{x}/{y}.jpg', {
    minZoom: 0,
    maxZoom: 3,
    tms: true
  });

  var map = L.map('map', {
    center: [0, 0],
    zoom:1,
    minZoom: 0,
    maxZoom: 3,
    //crs: L.CRS.Simple, //available in dev version
    layers:[tiles]
  });

```

API
---

[](#api)

### Options

[](#options)

- `tile_size` - the tile size (def: 256);
- `store_structure` - the tile name, can contain `/` for split `zoom`, `x` , `y` by folder (def: '%d/%d/%d');
- `force` - force create new tile if it already exist (def: false);
- `tms` - use TMS tile addressing, which is used in open-source projects like OpenLayers or TileCache (def: true);
- `fill_color` - color for fill free space if tile is not a square (def: 'white');
- `zoom_min` - minimum zoom level for make tiles (def: 0);
- `zoom_max` - maximum zoom level for make tiles (def: 8);
- `scaling_up` - zoom level when scalling up still allowed, when the base image have less size than need for a curent zoom level (def: 0);
- `format` - image fomat (def: jpeg);
- `quality_jpeg` - quality for jpeg format (def: 80);
- `imagick_tmp` - temp folder for ImageMagick, useful if system /tmp folder have not enough free space (def: null);

### Publick Methods

[](#publick-methods)

- `__construct($image_path, $options = array())` - constructor
- `setOptions($options)` - can be used for set/change options
- `getOptions()` - return options array
- `process($clean_up = false)` - run process for the tiles generation, set $clean\_up=true to remove the base zoom images
- `prepareZoomBaseImages($min = null, $max = null)` - prepare the base zoom images, $min - min zoom level, $max - max zoom level
- `removeZoomBaseImages($min = null, $max = null)` - remove the base zoom images
- `tilesForZoom($zoom)` - generate the tiles for given $zoom level

Attention
---------

[](#attention)

This script do **NOT** related to **maptiler.com**, that is stand alone project.

###  Health Score

20

—

LowBetter than 12% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

---

Top Contributors

[![Fedik](https://avatars.githubusercontent.com/u/1568198?v=4)](https://github.com/Fedik "Fedik (28 commits)")[![drps](https://avatars.githubusercontent.com/u/7323907?v=4)](https://github.com/drps "drps (6 commits)")[![jcrombez](https://avatars.githubusercontent.com/u/777666?v=4)](https://github.com/jcrombez "jcrombez (1 commits)")

### Embed Badge

![Health badge](/badges/drps-php-maptiler/health.svg)

```
[![Health](https://phpackages.com/badges/drps-php-maptiler/health.svg)](https://phpackages.com/packages/drps-php-maptiler)
```

###  Alternatives

[goat1000/svggraph

Generates SVG graphs

135931.0k3](/packages/goat1000-svggraph)[stefangabos/zebra_image

A single-file, lightweight PHP library designed for efficient image manipulation featuring methods for modifying images and applying filters

138121.6k7](/packages/stefangabos-zebra-image)[treinetic/imageartist

ImageArtist is a php gd Wrapper which makes Image manipulation insanely easy, we introduce ImageArtist as Photoshop for php

8783.2k](/packages/treinetic-imageartist)[johncarter/filament-focal-point-picker

An image focal point picker for Filament Admin.

4431.7k1](/packages/johncarter-filament-focal-point-picker)[yk/laravel-ocr

A wrapper for gocr.

1356.6k](/packages/yk-laravel-ocr)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
