PHP code example of taviroquai / mapserver

1. Go to this page and download the library: Download taviroquai/mapserver library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

taviroquai / mapserver example snippets


			"taviroquai/mapserver": "~2.0"
	}

	'providers' => array(
		...
		'Taviroquai\Mapserver\MapserverServiceProvider',
	),

	// 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;

php composer.phar update