Exemplo n.º 1
0
 /**
  * Parses the provided string and returns the result.
  *
  * @since 3.0
  *
  * @param string $value
  *
  * @return WmsOverlay
  */
 protected function stringParse($value)
 {
     $separator = " ";
     $metaData = explode($separator, $value);
     if (count($metaData) >= 2) {
         $wmsOverlay = new WmsOverlay($metaData[0], $metaData[1]);
         if (count($metaData) == 3) {
             $wmsOverlay->setWmsStyleName($metaData[2]);
         }
         return $wmsOverlay;
     }
     throw new ParseException('Need at least two parameters, url to WMS server and map layer name');
 }
Exemplo n.º 2
0
 /**
  * @see ValueParserTestBase::validInputProvider
  *
  * @since 3.0
  *
  * @return array
  */
 public function validInputProvider()
 {
     $argLists = array();
     $valid = array("http://demo.cubewerx.com/demo/cubeserv/cubeserv.cgi? Foundation.GTOPO30" => array("http://demo.cubewerx.com/demo/cubeserv/cubeserv.cgi?", "Foundation.GTOPO30"), "http://maps.imr.no:80/geoserver/wms? vulnerable_areas:Identified_coral_area coral_identified_areas" => array("http://maps.imr.no:80/geoserver/wms?", "vulnerable_areas:Identified_coral_area", "coral_identified_areas"));
     foreach ($valid as $value => $expected) {
         $expectedOverlay = new WmsOverlay($expected[0], $expected[1]);
         if (count($expected) == 3) {
             $expectedOverlay->setWmsStyleName($expected[2]);
         }
         $argLists[] = array((string) $value, $expectedOverlay);
     }
     return $argLists;
 }