@@ -38,10 +38,12 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | public function init() |
| 40 | 40 | { |
| 41 | - if (!isset($this->options['id'])) |
|
| 42 | - $this->options['id'] = $this->getId(); |
|
| 43 | - if (!isset($this->jsVarName)) |
|
| 44 | - $this->jsVarName = $this->options['id']; |
|
| 41 | + if (!isset($this->options['id'])) { |
|
| 42 | + $this->options['id'] = $this->getId(); |
|
| 43 | + } |
|
| 44 | + if (!isset($this->jsVarName)) { |
|
| 45 | + $this->jsVarName = $this->options['id']; |
|
| 46 | + } |
|
| 45 | 47 | $this->mapOptions['target'] = $this->options['id']; |
| 46 | 48 | OpenLayersBundle::register($this->view); |
| 47 | 49 | } |
@@ -75,11 +77,13 @@ discard block |
||
| 75 | 77 | */ |
| 76 | 78 | protected function processOptions() |
| 77 | 79 | { |
| 78 | - if (isset($this->mapOptions['view']) && is_array($this->mapOptions['view'])) |
|
| 79 | - $this->mapOptions['view'] = new OL('View', $this->mapOptions['view']); |
|
| 80 | + if (isset($this->mapOptions['view']) && is_array($this->mapOptions['view'])) { |
|
| 81 | + $this->mapOptions['view'] = new OL('View', $this->mapOptions['view']); |
|
| 82 | + } |
|
| 80 | 83 | |
| 81 | - if (isset($this->mapOptions['layers'])) |
|
| 82 | - $this->processSimplifiedLayers(); |
|
| 84 | + if (isset($this->mapOptions['layers'])) { |
|
| 85 | + $this->processSimplifiedLayers(); |
|
| 86 | + } |
|
| 83 | 87 | } |
| 84 | 88 | |
| 85 | 89 | /** |
@@ -93,13 +97,15 @@ discard block |
||
| 93 | 97 | { |
| 94 | 98 | if (is_string($type)) |
| 95 | 99 | { |
| 96 | - if (is_string($options)) |
|
| 97 | - $options = ['source' => new OL("source.$options")]; |
|
| 100 | + if (is_string($options)) { |
|
| 101 | + $options = ['source' => new OL("source.$options")]; |
|
| 102 | + } |
|
| 98 | 103 | |
| 99 | 104 | $processedLayers []= new OL("layer.$type", $options); |
| 100 | - } |
|
| 101 | - else // Therefore $type is simply an integer array key |
|
| 105 | + } else { |
|
| 106 | + // Therefore $type is simply an integer array key |
|
| 102 | 107 | $processedLayers []= $options; |
| 108 | + } |
|
| 103 | 109 | } |
| 104 | 110 | $this->mapOptions['layers'] = $processedLayers; |
| 105 | 111 | } |
@@ -75,10 +75,11 @@ |
||
| 75 | 75 | */ |
| 76 | 76 | protected function generateExpression() |
| 77 | 77 | { |
| 78 | - if (isset($this->properties)) |
|
| 79 | - $properties = Json::encode($this->properties); |
|
| 80 | - else |
|
| 81 | - $properties = ''; |
|
| 78 | + if (isset($this->properties)) { |
|
| 79 | + $properties = Json::encode($this->properties); |
|
| 80 | + } else { |
|
| 81 | + $properties = ''; |
|
| 82 | + } |
|
| 82 | 83 | return "new ol.$this->class($properties)"; |
| 83 | 84 | } |
| 84 | 85 | |