2017 © Pedro Peláez
 

library mapfile-php-library

PHP Library to read/write MapServer mapfiles

image

jbelien/mapfile-php-library

PHP Library to read/write MapServer mapfiles

  • Friday, December 29, 2017
  • by jbelien
  • Repository
  • 3 Watchers
  • 3 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 1 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

MapFile-PHP-Library

Latest Stable Version Total Downloads Monthly Downloads Software License, (*1)

PHP Library to read/write MapServer mapfiles., (*2)

This library is based on MapServer 7.2.0 documentation (last updated on 16 June 2017)., (*3)

Installation

composer require jbelien/mapfile-php-library

Usage

Write MapFile (example)

$map = new \MapFile\Model\Map();

$map->name = 'my-mapfile';
$map->projection = 'EPSG:4326';

$map->scalebar = new \MapFile\Model\Scalebar();
$map->scalebar->units = 'kilometers';

$layer = new \MapFile\Model\Layer();
$layer->name = 'my-layer';
$layer->type = 'POLYGON';
$layer->status = 'ON';
$layer->data = 'my-shapefile';
$layer->projection = 'EPSG:4326';

$class = new \MapFile\Model\LayerClass();

$style = new \MapFile\Model\Style();
$style->color = [0, 0, 0];
$class->style->add($style);

$label = new \MapFile\Model\Label();
$label->text = '[label]';
$label->color = [0, 0, 0];
$label->size = 12;
$class->label->add($label);

$layer->class->add($class);

$map->layer->add($layer);

(new \MapFile\Writer\Map($map))->save('my-mapfile.map');

Have a look at the source code to see all the available options., (*4)

Parse MapFile (example)

$map = (new \MapFile\Parser\Map())->parse('my-mapfile.map');

foreach ($map->layer as $layer) {
    echo $layer->name;
}

The Versions

29/12 2017

dev-master

9999999-dev

PHP Library to read/write MapServer mapfiles

  Sources   Download

GPL-2.0

by Jonathan Beliën

29/12 2017

dev-analysis-XN09ag

dev-analysis-XN09ag

PHP Library to read/write MapServer mapfiles

  Sources   Download

GPL-2.0

by Jonathan Beliën

29/05 2017

v1.3.1

1.3.1.0

PHP Library to read/write MapServer mapfiles

  Sources   Download

GPL-2.0

by Jonathan Beliën

03/12 2016

v1.3.0

1.3.0.0

PHP Library to read/write MapServer mapfiles

  Sources   Download

GPL-2.0

by Jonathan Beliën