forked from MapComplete/MapComplete
17 lines
518 B
TypeScript
17 lines
518 B
TypeScript
|
import { Validator } from "../ValidatedTextField"
|
||
|
|
||
|
export default class LengthValidator extends Validator {
|
||
|
constructor() {
|
||
|
super(
|
||
|
"distance",
|
||
|
'A geographical distance in meters (rounded at two points). Will give an extra minimap with a measurement tool. Arguments: [ zoomlevel, preferredBackgroundMapType (comma separated) ], e.g. `["21", "map,photo"]',
|
||
|
"decimal"
|
||
|
)
|
||
|
}
|
||
|
|
||
|
isValid = (str) => {
|
||
|
const t = Number(str)
|
||
|
return !isNaN(t)
|
||
|
}
|
||
|
}
|