/**
  * Appends the layers of another WMC to this WMC.
  *
  * @return void
  * @param $xml2 Object
  */
 public function append($xml2)
 {
     $someWmc = new wmc();
     $someWmc->createFromXml($xml2);
     $this->mainMap->append($someWmc->mainMap);
     if (isset($this->overviewMap) && isset($someWmc->overviewMap)) {
         // There is only one WMS in the overview map; merge, not append
         $this->overviewMap->merge($someWmc->overviewMap);
     }
 }
예제 #2
0
 public function testMerge()
 {
     $this->properties->merge(['foo5' => 'bar5']);
     $this->assertEquals('bar5', $this->properties->get('foo5'));
 }
예제 #3
0
 private function removeDuplicates(Map $images, Map $figures) : Map
 {
     $urls = $figures->reduce(new Set(UrlInterface::class), function (Set $urls, UrlInterface $url) : Set {
         return $urls->add($url);
     });
     $urls = $images->reduce($urls, function (Set $urls, UrlInterface $url) : Set {
         return $urls->add($url);
     });
     $urls = (new RemoveDuplicatedUrls())($urls);
     return $figures->merge($images)->filter(function (UrlInterface $url) use($urls) : bool {
         return $urls->contains($url);
     });
 }