Skip to content

f-o-n/ImageTiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ImageTiler

ImageTiler is a ProcessWire Module to split large images into tiles which can be used with interactive maps like Leaflet. It uses PHPs GD library for image processing.

Installation

This module's files should be placed in /site/modules/ImageTiler/ How to install or uninstall modules

Example usage with Leaflet

Download and add Leaflet to your project. The data object is the object returned from the call to $image->tile()

var map = L.map('map', {
    crs: L.CRS.Simple,
    noWrap: true,
    maxBoundsViscosity:   1,
    attributionControl: false
});

var sw = map.unproject([0, data.imageHeight], data.maxZoom);
var ne = map.unproject([data.imageWidth, 0], data.maxZoom);
var bounds = new L.LatLngBounds(sw, ne);

var layer = L.tileLayer(data.url + '/{z}/{x}/{y}.jpg', {
  tileSize: data.tileSize,
  center: [0,0],
  minZoom: data.minZoom,
  maxZoom: data.maxZoom,
  bounds: bounds,
  noWrap: true
}).addTo(map);

map.setMaxBounds(bounds);

License

MIT

About

Processwire ImageTiler Module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages