Latitude, expected in [-90, 90].
Longitude, expected in [-180, 180].
See ValidatorOptions.
{ valid, error }; error is null when valid.
// Coordonnées valides
const result = GeoLeaf.Validators.validateCoordinates(45.5017, -73.5673);
// Returns: { valid: true, error: null }
// Latitude invalide (> 90)
const result2 = GeoLeaf.Validators.validateCoordinates(95, -73);
// Returns: { valid: false, error: 'Latitude must be between -90 and 90' }
// Mode strict (lance exception)
try {
GeoLeaf.Validators.validateCoordinates(95, -73, { throwOnError: true });
} catch (error) {
console.error("Coordonnées invalides:", error.message);
}
Validates a latitude/longitude pair.
Delegates the range check to the security module, so the bounds are the same ones the rest of the kernel enforces. Like every validator here, it reports by default and only throws when asked — which is what lets it be used directly in a condition.