public function Base::removeObject in Openlayers 7.3
Remove an object from the collection.
Parameters
string $object_machine_name: The machine name of the object to remove.
Return value
ObjectInterface The parent object.
Overrides ObjectInterface::removeObject
4 calls to Base::removeObject()
- Map::removeComponent in src/
Types/ Map.php - Map::removeControl in src/
Types/ Map.php - Map::removeInteraction in src/
Types/ Map.php - Map::removeLayer in src/
Types/ Map.php
File
- src/
Types/ Base.php, line 268 - Class Object.
Class
- Base
- Class Base.
Namespace
Drupal\openlayers\TypesCode
public function removeObject($object_machine_name) {
$this
->getCollection()
->remove($object_machine_name);
foreach (Openlayers::getPluginTypes() as $type) {
$type .= 's';
$objects = $this
->getOption($type, array());
$objects = array_combine(array_values($objects), array_values($objects));
unset($objects[$object_machine_name]);
if (!empty($objects)) {
$this
->setOption($type, array_values($objects));
}
else {
$this
->clearOption($type);
}
}
return $this;
}