How to Use Zend 2 + Mapserver

Asked

Viewed 34 times

0

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

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

<?php 
$mapserver = MapServer();
$obj = $mapserver -> ms_newMapObj();
$obj -> draw();
$obj -> saveImage("mapa-exemplo" , "gif");
?>

1 answer

1


For all inetessados, I managed to make it works and there were no needs and make any changes.

follows 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();
    }
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.