Awesome
Laravel Mapserver package
Install
Add to composer.json
require: {
"taviroquai/mapserver": "~2.0"
}
Add Service Provider on app/config/app.php
'providers' => array(
...
'Taviroquai\Mapserver\MapserverServiceProvider',
),
php composer.phar update
Usage
// Create a MapServer instance
$mapserver = new \Taviroquai\Mapserver\Mapserver();
// Create a new map object (mapObj)
$map = $mapserver->createMap(
'test',
storage_path('default.map'),
storage_path('template.html')
);
// Return WMS capabilities
$response = $mapserver->getCapabilitiesResponse($map);
// Return map image as Illuminate response
$response = $mapserver->getImageResponse($map);
return $response;
Requirements
Of course Laravel 5, Mapserver and MapScript must be installed
Features
- Check whether MapServer is installed or not at the requested machine
- Opens a mapfile
- Export a mapfile
- Return a GetCapabilities response as Illuminate\HTTP\Response
- Creates map image as Illuminate\HTTP\Response
Call for Collab
All GEO lovers are invited to fork and grow this project ;)