PHPackages                             fedik/php-maptiles - 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. fedik/php-maptiles

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

fedik/php-maptiles
==================

Simple Map Tiles Generator. Allow to make a Map Tiles with PHP and Imagick.

v2.0.0(3y ago)536121GPL-2.0-or-laterPHP

Since Aug 14Pushed 3y ago4 watchersCompare

[ Source](https://github.com/Fedik/php-maptiles)[ Packagist](https://packagist.org/packages/fedik/php-maptiles)[ RSS](/packages/fedik-php-maptiles/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (2)Used By (0)

PHP MapTiles, Simple Map Tiles Generator
========================================

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

Simple Map Tiles Generator allow to make a Map Tiles with PHP and Imagick. That allows to build a simple custom map. It does not include any geographical calculations.

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

[](#requirements)

- PHP &gt;= 5.3 version
- PHP Imagick 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 a tiles:

```
// Setup
$tiler = new Fedik\MapTiles\MapTiles('/full/path/to/my-image.jpg', array(
  'tiles_path' => '/full/path/to/where-to-store-tiles/',
  'zoom_max' => 3
));

// Generate tiles
$tiler->process(true);
```

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

```

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

      const map = L.map('map', {
          center: [0, 0],
          zoom: 1,
          layers:[tiles]
      });

```

API
---

[](#api)

### Options

[](#options)

- `tile_size` A tile size (def: 256);
- `store_structure` A 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 a 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 scaling up still allowed, when a base image have less size than need for a requested zoom level (def: `0`);
- `format` Image format (def: `jpeg`);
- `quality_jpeg` Quality for jpeg format (def: `80`);
- `imagick_tmp` Temporary folder for ImageMagick, useful if system /tmp folder have not enough free space (def: null);

### Publick Methods

[](#publick-methods)

- `__construct($image_path, $options = array())` Class constructor.
- `setOptions($options)` Set/change options.
- `getOptions()` Get options array.
- `process($clean_up = false)` Generate tiles, set `$clean_up=true` to remove a base zoom images.
- `prepareZoomBaseImages($min = null, $max = null)` Prepare a base zoom images, `$min` - min zoom level, `$max` - max zoom level.
- `removeZoomBaseImages($min = null, $max = null)` Remove the base zoom images.
- `tilesForZoom($zoom)` Generate tiles for given `$zoom` level.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.9% 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1409d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/61e054b76a4123e4d969381b7813c6f8c173f3d705c63a376f148db50f929783?d=identicon)[Fedik](/maintainers/Fedik)

---

Top Contributors

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

---

Tags

map tilemap tile generatorphp map tilesphp tile generatorphp map generatorconvert image to mapmap from image

### Embed Badge

![Health badge](/badges/fedik-php-maptiles/health.svg)

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

###  Alternatives

[ntavelis/mercure-php

Publish messages to mercure hub

3016.7k](/packages/ntavelis-mercure-php)

PHPackages © 2026

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