Source for file MapServerService.php

Documentation is available at MapServerService.php

  1. <?php
  2. /**
  3. * Service de type mapserver
  4. *
  5. * PHP versions 5
  6. @category  PHP
  7. @package   GeoPrisma
  8. @author    Pascal Martin
  9. @copyright 2009, Boreal - Information Strategies
  10. @license   http://www.geoprisma.org/license BSD License
  11. @link      http://www.geoprisma.org
  12. */
  13.  
  14. /**
  15. * Service de type mapserver
  16. @category   PHP
  17. @package    GeoPrisma
  18. @subpackage Service
  19. @author     Pascal Martin
  20. */   
  21. {
  22.     const MAPSERVER_SERVICE = 'mapserver';
  23.     const TYPE = 'mapserver';
  24.     const TYPE_ID = 6;
  25.  
  26.     private $m_strMapFile null;
  27.     
  28.     /**
  29.     * Construit un instance de org_geoprisma_service_MapServerService
  30.     * 
  31.     * @param array $pobjArray Config array
  32.     * 
  33.     * @return org_geoprisma_service_MapServerService 
  34.     */
  35.     public function __construct($pobjArray
  36.     {
  37.         if (isset($pobjArray['id'])) 
  38.         {
  39.             $strName = (string)$pobjArray['id'];
  40.         }
  41.         else
  42.         {
  43.             $strName = (string)$pobjArray['name'];
  44.         }
  45.  
  46.         $strSource = (string)$pobjArray['source'];
  47.         
  48.         $this->m_strMapFile = (string)$pobjArray['mapfile'];
  49.         
  50.         parent::__construct($strName$strSourceself::TYPE$pobjArray);
  51.     }
  52.     
  53.     /**
  54.     * Return the mapfile
  55.     * 
  56.     * @return string 
  57.     */
  58.     public function getMapFile()
  59.     {
  60.         return $this->m_strMapFile;
  61.     }
  62.  
  63.     /**
  64.     * Return the OpenLayers.Layer default options using this type of service.
  65.     * 
  66.     * @param org_geoprisma_config_Config &$pobjConfig Config object
  67.     *
  68.     * @return array 
  69.     */
  70.     public function getDefaultLayerOptions(&$pobjConfig)
  71.     {
  72.         return array();
  73.     }
  74.     
  75.     /**
  76.     *  Ajout le service courant (this) dans le xml
  77.     * 
  78.     * @param DOMElement  &$pobjDomElementServices Noeud xml ou le service doit ĂȘtre ajouter
  79.     * @param DOMDocument &$pobjDomDocument        Document XMl ou le noeud xml datastore est ajouter, utiliser pour construire les noeuds
  80.     * 
  81.     * @return void 
  82.     */
  83.     public function insertIntoXML(DOMElement &$pobjDomElementServicesDOMDocument &$pobjDomDocument)
  84.     {
  85.         $objDomElementService $pobjDomDocument->createElement('service')
  86.         $pobjDomElementServices->appendChild($objDomElementService);        
  87.         $objDomElementType $pobjDomDocument->createElement('type'self::MAPSERVER_SERVICE);
  88.         $objDomElementName $pobjDomDocument->createElement('name'$this->getName());
  89.         $objDomElementMapFile $pobjDomDocument->createElement('mapfile'$this->getMapFile());
  90.         $objDomElementService->appendChild($objDomElementType);
  91.         $objDomElementService->appendChild($objDomElementName)
  92.         $objDomElementService->appendChild($objDomElementMapFile);
  93.  
  94.         // options node
  95.         $objDomElementService->appendChild(
  96.             $this->getDomElements(
  97.                 'options'$this->getOptions()$pobjDomDocument
  98.             )
  99.         );
  100.     }
  101. }
  102.   
  103. ?>

Documentation generated on Thu, 19 Jan 2012 00:08:41 +0400 by phpDocumentor 1.4.1