How to Use Zend 2 + MapServer

0

How do I use the MapServer() functions inside the Zend controller? I'm using MS4W which has Apache, PHP and MapServer.

If it were straight, it would look something like this:

<?php 
$mapserver = MapServer();
$obj = $mapserver -> ms_newMapObj();
$obj -> draw();
$obj -> saveImage("mapa-exemplo" , "gif");
?>
    
asked by anonymous 22.10.2014 / 13:41

1 answer

1

For all those inept, I managed to make it work and there was no need and make any changes.

Here is an example:

public function Mapserver($map , $mapPath , $img , $imgPath){
    $path = array(
        'img' => $imgPath . $img ,
        'map' => $mapPath . $map
    );

    try{
        $mapa = ms_newMapObj($path['map']);

        $mapa -> draw() 
              -> saveImage($path['img']);


    } catch (Zend_Exception $ex ) { 
        echo $ex -> getMessage();
    }
}
    
27.10.2014 / 19:03