Implement boundsMode fit.

This commit is contained in:
David Molineus
2015-01-27 00:02:17 +01:00
parent 37b10c14fe
commit e2eceab60e
20 changed files with 388 additions and 72 deletions

View File

@@ -51,4 +51,37 @@ class Marker
return $builder->getOptions();
}
/**
* Save the coordinates.
*
* @param string $value The raw data.
* @param \DataContainer $dataContainer The data container driver.
*
* @return string
*/
public function saveCoordinates($value, $dataContainer)
{
$combined = array(
'latitude' => null,
'longitude' => null,
'altitude' => null
);
$values = trimsplit(',', $value);
$keys = array_keys($combined);
if (count($values) >= 2 && count($values) <= 3) {
for ($i = 0; $i < count($values); $i++) {
$combined[$keys[$i]] = $values[$i];
}
}
\Database::getInstance()
->prepare('UPDATE tl_leaflet_marker %s WHERE id=?')
->set($combined)
->execute($dataContainer->id);
return $value;
}
}