1: <?php
2:
3: namespace Mapbender\WmcBundle\Component;
4:
5: /*
6: * To change this template, choose Tools | Templates
7: * and open the template in the editor.
8: */
9:
10: /**
11: * Description of MapbenderWMC
12: *
13: * @author Paul Schmidt
14: */
15: class MapbenderWMC
16: {
17: public $wmc_json;
18:
19: public $sources_json;
20:
21: public function explodeWmcLayers(){
22: $wmc = new MapbenderWMC();
23: $wmc->wmc_json = array(
24: "id" => clone $this->$wmc_json["id"],
25: "version" => clone $this->$wmc_json["version"],
26: "general" => clone $this->$wmc_json["general"],
27: "layerlist" => array()
28: );
29: foreach($this->wmc_json["layerlist"] as $layer)
30: {
31: $names = explode(",", $layer->name);
32: if(count($names) > 1){
33: foreach($names as $name){
34: $layerDef = clone $layer;
35: $layerDef["name"] = $name;
36: $wmc->wmc_json["layerlist"][] = $layerDef;
37: }
38: }
39: }// @TODO legend, style
40: return $wmc;
41: }
42:
43: // public function implodeLayers(){
44: // $wmc_new = array(
45: // "id" => clone $this->$wmc_json["id"],
46: // "version" => clone $this->$wmc_json["version"],
47: // "general" => clone $this->$wmc_json["general"],
48: // "layerlist" => array()
49: // );
50: // }
51: }
52:
53: ?>
54: