function openlayers_layer_type::__construct in Openlayers 7.2
Same name and namespace in other branches
- 6.2 openlayers.module \openlayers_layer_type::__construct()
Set configuration and store map.
Parameters
stdClass $layer: Configuration object with the options for the layer.
$map: Array with the current map.
File
- ./
openlayers.module, line 1278 - Main OpenLayers API File
Class
- openlayers_layer_type
- We define base classes in the core module. All other parent classes can be autoloaded through ctools.
Code
function __construct($layer = array(), $map = array()) {
foreach (array(
'name',
'title',
'description',
'data',
'export_type',
) as $k) {
if (isset($layer->{$k})) {
$this->{$k} = $layer->{$k};
}
}
// Extend options with the defaults.
$this->data += $this
->options_init();
$this->map = $map;
}