function leaflet_max_zoom_validate in Leaflet 7
Validation callback for max zoom level.
1 string reference to 'leaflet_max_zoom_validate'
- leaflet_form_elements in ./
leaflet.formatters.inc - Helper function to standardize forms between views and field formatters.
File
- ./
leaflet.formatters.inc, line 949 - Leaflet field formatter functions.
Code
function leaflet_max_zoom_validate($element, &$form_state, $form) {
$input_root = _leaflet_get_form_input_path($form_state['input'], $element['#parents']);
$min_zoom = (int) $input_root['minZoom'];
$max_zoom = (int) $input_root['maxZoom'];
if (isset($max_zoom) && $max_zoom != "-1" && isset($min_zoom)) {
if ($min_zoom > $max_zoom) {
form_error($element, t('The maximum zoom setting must be greater than or equal to the minimum zoom setting'));
}
}
}