/**
* Load the settings
*/
protected function loadData()
{
$this->items = BackendLocationModel::getAll();
$this->settings = BackendLocationModel::getMapSettings(0);
$firstMarker = current($this->items);
// if there are no markers we reset it to the birthplace of Fork
if ($firstMarker === false) {
$firstMarker = array('lat' => '51.052146', 'lng' => '3.720491');
}
// load the settings from the general settings
if (empty($this->settings)) {
$this->settings = $this->get('fork.settings')->getForModule('Location');
$this->settings['center']['lat'] = $firstMarker['lat'];
$this->settings['center']['lng'] = $firstMarker['lng'];
}
// no center point given yet, use the first occurrence
if (!isset($this->settings['center'])) {
$this->settings['center']['lat'] = $firstMarker['lat'];
$this->settings['center']['lng'] = $firstMarker['lng'];
}
}