/** * {@inheritDoc} */ public function optionsToObjects() { $import = parent::optionsToObjects(); if ($source = $this->getOption('source')) { $source = Openlayers::load('source', $source); // This source is a dependency of the current one, we need a lighter weight. $this->setWeight($source->getWeight() + 1); $import = array_merge($source->getCollection()->getFlatList(), $import); } return $import; }
/** * {@inheritdoc} */ public function optionsToObjects() { $import = parent::optionsToObjects(); foreach ($this->getOptions() as $geometry_type => $data) { if ($styles = $this->getOption(array($geometry_type, 'styles'), array())) { foreach ($styles as $style) { $style = Openlayers::load('style', $style); // This source is a dependency of the current one, // we need a lighter weight. $this->setWeight($style->getWeight() + 1); $import = array_merge($style->getCollection()->getFlatList(), $import); } } } return $import; }